--- title: "Mail Delivery Monitoring" slug: "mail-delivery-monitoring" status: "update" updated: 2026-09-15T13:44:36Z published: 2026-09-15T13:44:36Z canonical: "docs.catchpoint.com/mail-delivery-monitoring" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.catchpoint.com/llms.txt > Use this file to discover all available pages before exploring further. # Mail Delivery Monitoring ## **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. ![Fig 1: Email Delivery monitoring mechanism.](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/360082241952-mail_monitoring_mechanism.png?sv=2026-02-06&spr=https&st=2026-10-13T12%3A57%3A20Z&se=2026-10-13T13%3A57%3A20Z&sr=c&sp=r&sig=j%2BA5MRGnq3RxUDlNpMBSP1c1OBT8V1UcnA5a7HYJVRo%3D) ## **Prerequisites** 1. NodeJS v10 installed on Enterprise Node. ## **Installation and Configuration** 1. Navigate to `sandbox` directory. `$ cd /opt/3genlabs/hawk/syntheticnode/service/shellmonitor/sandbox` 2. 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:** 1. Download and copy all the attached files to the `sandbox` directory. (`email_monitoring.sh` `email_monitoring.js`) 2. 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`. ![mail_monitoring_test_setup1.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/360082239772-mail_monitoring_test_setup1.png?sv=2026-02-06&spr=https&st=2026-10-13T12%3A57%3A20Z&se=2026-10-13T13%3A57%3A20Z&sr=c&sp=r&sig=j%2BA5MRGnq3RxUDlNpMBSP1c1OBT8V1UcnA5a7HYJVRo%3D) 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. ![mail_monitoring_test_setup.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/360082289491-mail_monitoring_test_setup.png?sv=2026-02-06&spr=https&st=2026-10-13T12%3A57%3A20Z&se=2026-10-13T13%3A57%3A20Z&sr=c&sp=r&sig=j%2BA5MRGnq3RxUDlNpMBSP1c1OBT8V1UcnA5a7HYJVRo%3D) ## **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. ![mail_monitoring_insights.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/360082289451-mail_monitoring_insights.png?sv=2026-02-06&spr=https&st=2026-10-13T12%3A57%3A20Z&se=2026-10-13T13%3A57%3A20Z&sr=c&sp=r&sig=j%2BA5MRGnq3RxUDlNpMBSP1c1OBT8V1UcnA5a7HYJVRo%3D) The image below displays results of the test. Now we can set up Insight to capture and analyse the results. | **Indicator Name** | **Format** | | --- | --- | | End-to-End RTT | End-to-End\ RTT\ :\ (\d+(.\d{1,5})?) | | SMTP Submission Time | SMTP\ Submission\ Time\ :\ (\d+(.\d{1,5})?) | | Mail Delivery Latency | Mail\ Delivery\ Latency\ :\ (\d+(.\d{1,5})?) | ![mail_monitoring_results.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/360082289471-mail_monitoring_results.png?sv=2026-02-06&spr=https&st=2026-10-13T12%3A57%3A20Z&se=2026-10-13T13%3A57%3A20Z&sr=c&sp=r&sig=j%2BA5MRGnq3RxUDlNpMBSP1c1OBT8V1UcnA5a7HYJVRo%3D) ## Attachments - [email_monitoring.sh.txt](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/email_monitoring.sh.txt) - [email_monitoring.js.txt](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/email_monitoring.js.txt)