How to monitor delivery queue?

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
User avatar
Nime
Normal user
Normal user
Posts: 122
Joined: 2009-03-12 11:50
Contact:

How to monitor delivery queue?

Post by Nime » 2020-10-06 13:55

Sometimes the delivery queue might stuck. Is there any script or tool that monitors excessive queue? Restarting hMailServer service or Windows Server can help. Retry counts and queue counts combined might be useful to decide what to do.

User avatar
Nime
Normal user
Normal user
Posts: 122
Joined: 2009-03-12 11:50
Contact:

Re: How to monitor delivery queue?

Post by Nime » 2020-10-06 14:21

Oops, I've already wrote a tool to check server health including online check, SpamD, ClamAV, SMTP and POP3 send & receive. I just needed to reset the new password and that's it. If anyone interested I can share C# solution.

Image

palinka
Senior user
Senior user
Posts: 2180
Joined: 2017-09-12 17:57

Re: How to monitor delivery queue?

Post by palinka » 2020-10-06 15:07

I use powershell for that. I'd be interested in how you monitor things because I've found that simply checking the service state isn't enough to determine if hmailserver and other processes are not functioning properly.

For example, for hmailserver i check service state, and if running, then telnet in and wait for a response. If either are not true, then restart hmailserver service.

User avatar
Nime
Normal user
Normal user
Posts: 122
Joined: 2009-03-12 11:50
Contact:

Re: How to monitor delivery queue?

Post by Nime » 2020-10-06 15:57

I do fully test by sending a message and then waiting for to receive it again. The server might run locally, I also test at WAN wide, so if something is wrong I restart server instead of hMailServer service.

User avatar
SorenR
Senior user
Senior user
Posts: 3829
Joined: 2006-08-21 15:38
Location: Denmark

Re: How to monitor delivery queue?

Post by SorenR » 2020-10-06 16:13

I have never experienced hMailServer being unresponsive except for one time I was testing some script and I managed to completely overload the scripting engine...

Code: Select all

Option Explicit

'******************************************************************************************************************************
'********** Settings                                                                                                 **********
'******************************************************************************************************************************

'
'   COM authentication
'
Private Const ADMIN = "Administrator"
Private Const PASSWORD = "#VERYSECRET"

'******************************************************************************************************************************
'********** CODE                                                                                                     **********
'******************************************************************************************************************************

Dim oApp : Set oApp = CreateObject("hMailServer.Application")
Call oApp.Authenticate(ADMIN, PASSWORD)
Dim EventLog : Set EventLog = CreateObject("hMailServer.EventLog")
Dim FSO : Set FSO = CreateObject("Scripting.FileSystemObject")
'
'   Name of the logfile.
'   Default is monthly logs, for daily logs add: EventLogX.LogType = "D"
'
If oApp.ServerState = 1 Then
   If (FSO.FolderExists(oApp.Settings.Backup.Destination & "\DataBackup")) Then
      EventLog.Write("CheckState: Server is currently doing backup...")
   Else
      EventLog.Write("CheckState: Server was stopped for no reason, starting...")
      Call oApp.Start
   End If
End If

Set FSO = Nothing
Set EventLog = Nothing
Set oApp = Nothing

'******************************************************************************************************************************
'********** END                                                                                                      **********
'******************************************************************************************************************************
Regarding the delivery queue ...

Yet another project I got sucked into :mrgreen: I believe there is a confirmed functioning solution on page 2. :wink:

https://www.hmailserver.com/forum/viewt ... =9&t=33955
SørenR.

“Those who don't know history are doomed to repeat it.”
― Edmund Burke

palinka
Senior user
Senior user
Posts: 2180
Joined: 2017-09-12 17:57

Re: How to monitor delivery queue?

Post by palinka » 2020-10-06 16:20

The only time i found hmailserver unresponsive was trying to shut it down for backup during a syn flood attack. I don't remember any other circumstance it was unresponsive.

However, better safe than sorry. :D

Post Reply