Introduction
The Email Delivery Custom Monitor provides metrics that show how long it takes to deliver each outbound message, along with performance insights across the entire email delivery process. In addition, this monitor tracks the availability of both inbound and outbound email servers.
Once enabled, the monitor sends test emails to the specified email server using the SMTP protocol, retrieves them using the IMAP protocol, and measures the round-trip time to evaluate delivery performance.

Prerequisites
- NodeJS v10 installed on Enterprise Node.
Installation and Configuration
-
Navigate to
sandboxdirectory.
$ cd /opt/3genlabs/hawk/syntheticnode/service/shellmonitor/sandbox -
Install all the required NodeJS dependencies using NPM.
$ npm i nodemailer
$ npm i imap
$ npm i execution-time
$ npm i moment
$ npm i async
$ npm i util
Implementation
Place the custom script:
-
Download and copy all the attached files to the
sandboxdirectory. (email_monitoring.shemail_monitoring.js) -
Run these commands to change file permission and owner.
$ cd /opt/3genlabs/hawk/syntheticnode/service/shellmonitor/sandbox
$ chmod 500 email_monitoring.sh
$ chown serveruser email_monitoring.sh
$ chmod 500 email_monitoring.js
$ chown serveruser email_monitoring.js
Note: The script will check for arriving email under the folder in the mailbox.
Create the Custom Test
To configure the script in Catchpoint Portal, navigate to the test module and create a Custom Test. This will open the test configuraion blade.
The script file name should be the same as the file placed in the sandbox folder. This file would be the first point of execution when the run is triggered. In our example, it would be email_monitoring.sh.

We need to add the following custom fields to this script:
- SMTP Host
- SMTP Username
- SMTP Password
- SMTP port (Optional) uses port 465 if not given.
- IMAP Host
- IMAP Username
- IMAP Password
- IMAP port (Optional) uses port 987 if not given.

Result
Based on the output that gets printed in the console, you can create Indicators to capture the metrics and analyse it in the Portal.

The image below displays results of the test. Now we can set up Insight to capture and analyse the results.
| Indicator Name | Format |
|---|---|
| email response time | Total\ Response\ Time\ :\ (\d+(\.\d{1,5})?) |
| email round trip time | Email\ Round\ Trip\ Time\ :\ (\d+(\.\d{1,5})?) |
