Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Better way to monitor your SmarterMail email queue?

“The email that I have sent 30 minutes ago has not been received by the recipient, what’s going on? Is your Mail Server down?”

This message is not something new if you are the administrator of your Smartermail Windows Mail Server. As this happen, usually you will only found out that the mail server queue has been jammed with messages that has not been delivered. Before we dive into how we can better stay instant alert as the mail spool starts to build up, let’s go through the reasons your SmarterMail mail server spool would have jammed up:

  1. One of your email has been compromised, resulting in a massive SMTP email sent out from the malicious users using a valid login.
  2. Your SmarterMail has not been locked down to only relay (sending) of emails from only valid email users locally.
  3. One of the RBL could have creating issues – long timeout ie and SmarterMail have problems to process the spam checks.
  4. You are running an old version of SmarterMail that has performance problems to cope up with the volume of emails (occasionally).
  5. Your mail server disk performance have issues to handle the incoming volumes.

Staying Instant Alert – How?

As an administrator of your SmarterMail Windows Mail Server, how do you setup to be first to alert when your mail server starts to queue up the emails?

By default, SmarterMail have the built-in functions that allow you to setup an Event for mail spool monitoring and alert. However, the notifications options are limited to “Send Email” and “Toast Notifications” on your SmarterMail web admin. What if you are away from your workstation, how do you get the notifications trigger on the webmail? Plus, when your mail server queue starts to build up on either of the reasons above, you will have problems to receive the email notifications sent out from SmarterMail – you will get it but that would be a delay notifications and what’s the point?

There are other options such as using Nagios Check SmarterMail Queue plugin to monitor your SmarterMail mail server queue and leverage on Nagios to trigger the necessary notifications to you. But if you only have one single SmarterMail mail server to monitor, you will have to go through the hassle of installing Nagios with configuration and on-going maintenance for your Nagios monitoring server. Other route includes writing your own PHP/VB script if you have some programming knowledge to achieve the results.

PushOver + PowerShell

Here’s a quick way to setup your SmarterMail queue monitoring alert without going through the hassle of setting up your own Nagios monitoring box or writing your own script. Let’s move on!

1. Sign up for a PushOver account and pay for it. It’s just $4.99 for one-time payment, there’s no recurring monthly fees. Install the PushOver application on your Google PlayStore or Apple App Store and sign in with your PushOver account.

2. Once you are in your PushOver web account, you will notice your API key on your top of the page, something like below. Keep this key, you will need it later.

3. Scroll down to the bottom of the page, and you will see a section labelled as “Your Applications”. Click “Create an Application/API Token”)

4. You will be landed on the the page to fill up your Application, give your application a name and from the drop down, choose “Application” and click “Create Application”.

5. Your application is created and you will now see your Application Token. Keep this Token key as you will need it together with your User Key above.

6. Now back to SmarterMail as your default web admin. Click on Settings > Expand to Events and Create a new Event. and choose the Event Category as “System” with Event Type “Spool Count”. Fill up as below. For initial setup, you may want to set the Spool Count with “Greater than” 1 instead of higher volume, this is to allow you to test the notifications.

7. Click on Action tab and select Execute Command Line as the options. The full Arguments will be -ExecutionPolicy ByPass C:\Check\cron\checkspool.ps1

Depending on where you will keep your PowerShell script (as below) on your server path, reflect that accordingly over here.

Save the event and back to RDP on your SmarterMail server.

8. Save the following script as .ps1 on the actual folder/path you have setup on your Event as above. Replace the token and user key with the actual one from your account above.

$uri = “https://api.pushover.net/1/messages.json”
$parameters = @{
token = “a9fXXXXXXXXXXXXXXwh37
user = “uZXXXXXXXXXocsQ
message = “Spool Check > 500”
}
$parameters | Invoke-RestMethod -Uri $uri -Method Post

Modify the spool count to higher limit depend on your mail server average queue threshold. You want to avoid keep getting the alert of false notifications if you set it to low.

Now you have a working queue monitoring with a very low cost investment of just need to pay for $4.99 and you are 24×7 up with the instant alert notifications.



This post first appeared on Latest Blog Update —, please read the originial post: here

Share the post

Better way to monitor your SmarterMail email queue?

×

Subscribe to Latest Blog Update —

Get updates delivered right to your inbox!

Thank you for your subscription

×