Maddy is a Go-written, composable mail server that handles SMTP, message routing, DKIM signing, spam filtering, and IMAP delivery in a single binary — no Postfix/Dovecot combination required. That lean footprint is operationally elegant, but it means a single process failure takes down your entire mail stack. Vigilmon provides external monitoring across every Maddy-exposed protocol port so you catch failures in seconds rather than minutes.
What You'll Set Up
- TCP port checks for SMTP, IMAP, and submission ports
- SMTP banner verification to confirm the mail daemon is responding
- Health endpoint monitoring (if configured)
- TLS certificate expiry alerts
- Alert channels for immediate notification
Prerequisites
- Maddy installed and running (
maddybinary or systemd service) - Mail domain configured (e.g.
mail.yourdomain.com) - SMTP listening on port 25 and/or 587
- IMAP listening on port 143 and/or 993
- A free Vigilmon account
Step 1: TCP Port Check for SMTP (Port 25)
Port 25 handles inbound mail from other mail servers. Monitoring it from outside your network verifies that Maddy's SMTP listener is up and your firewall is passing traffic correctly.
- Log in to vigilmon.online and click Add Monitor.
- Set Type to
TCP Port. - Host:
mail.yourdomain.com, Port:25. - Set Check interval to
2 minutes. - Click Save.
A TCP failure on port 25 means remote MTAs cannot deliver mail to your domain — your MX records point to a dead socket.
Step 2: SMTP Submission (Port 587) and SMTPS (Port 465)
Port 587 is used by email clients and applications to send outbound mail with STARTTLS. Port 465 is used for implicit TLS submission.
Port 587:
- Add Monitor →
TCP Port. - Host:
mail.yourdomain.com, Port:587. - Set Check interval to
2 minutes. - Click Save.
Port 465:
- Add Monitor →
TCP Port. - Host:
mail.yourdomain.com, Port:465. - Click Save.
If port 587 goes down, every email client and application trying to send via Maddy will fail authentication and queue messages locally.
Step 3: IMAP Port Monitoring (Ports 143 and 993)
Maddy's built-in IMAP server stores and serves mail to clients. Monitor both the plain and TLS IMAP ports:
IMAP (port 143):
- Add Monitor →
TCP Port. - Host:
mail.yourdomain.com, Port:143. - Click Save.
IMAPS (port 993):
- Add Monitor →
TCP Port. - Host:
mail.yourdomain.com, Port:993. - Click Save.
A failure on port 993 means Thunderbird, Apple Mail, and mobile email clients can't sync — users start getting "connection refused" errors.
Step 4: Verify the SMTP Greeting Banner
A TCP connection to port 25 that never returns a greeting is a Maddy-specific failure mode — the socket opens but the daemon is hung. Verify the SMTP banner to catch this:
- Open the SMTP TCP monitor you created in Step 1.
- Under Advanced, enable Verify response and set the expected string to
220. - Click Save.
The SMTP 220 greeting must be the first response after the connection is established. If Maddy opens the socket but hangs before greeting, this check catches what a pure TCP check misses.
Step 5: Add a Lightweight HTTP Health Endpoint
Maddy doesn't expose an HTTP health endpoint by default, but you can add one with a small sidecar or use Maddy's control socket. The simplest approach is a shell script checked by a small HTTP server:
#!/bin/bash
# /usr/local/bin/maddy-healthcheck.sh
# Returns 0 if maddy is running, 1 otherwise
systemctl is-active --quiet maddy && echo "ok" || exit 1
Expose this via a lightweight HTTP endpoint using socat or a minimal Go/Python server, then add a Vigilmon HTTP monitor:
- Add Monitor →
HTTP / HTTPS. - URL:
http://mail.yourdomain.com:9090/health(your sidecar's port). - Set Expected HTTP status to
200. - Set Expected body contains to
ok. - Set Check interval to
1 minute. - Click Save.
Alternatively, if you run Maddy behind a reverse proxy with a management API, point Vigilmon at that API's health route instead.
Step 6: Monitor Maddy's systemd Service via a Heartbeat
If Maddy runs as a systemd service, set up a Vigilmon Heartbeat monitor that your systemd service pings after each successful startup:
- In Vigilmon, go to Add Monitor → Heartbeat.
- Give it a name like "Maddy service heartbeat".
- Set the expected interval to
5 minutes. - Copy the generated heartbeat URL.
- Add a systemd
ExecStartPostdirective to ping the URL after Maddy starts:
# /etc/systemd/system/maddy.service.d/override.conf
[Service]
ExecStartPost=/usr/bin/curl -fsS --max-time 5 https://hb.vigilmon.online/YOUR_HEARTBEAT_ID
- Reload systemd:
systemctl daemon-reload && systemctl restart maddy.
If Maddy crashes and restarts unexpectedly, the heartbeat URL is never pinged on schedule and Vigilmon raises an alert.
Step 7: TLS Certificate Expiry Alerts
Maddy uses Let's Encrypt (or manual certificates) for TLS on all mail ports. Expiry takes down SMTPS, IMAPS, and STARTTLS simultaneously.
For each monitor covering a TLS endpoint (SMTPS :465, IMAPS :993):
- Open the monitor.
- Enable Monitor SSL certificate.
- Set Alert when certificate expires in less than
14 days. - Click Save.
Maddy's ACME module auto-renews certificates but requires port 80 or DNS challenge access. Add a TCP monitor on port 80 if Maddy handles ACME directly:
- Add Monitor →
TCP Port, Host:mail.yourdomain.com, Port:80. - Click Save.
Step 8: Configure Alert Channels
- In Vigilmon, go to Alert Channels → Add Channel.
- Choose your preferred channel: Email, Slack, or Webhook.
- Assign all Maddy monitors to this channel.
- Set Consecutive failures before alert to
2on port monitors — brief network hiccups during Maddy's own TLS renewal can cause transient TCP failures.
Putting It All Together
Here's a reference Vigilmon monitor set for a standard Maddy deployment:
mail.yourdomain.com:25 → TCP (SMTP inbound) + SMTP banner: 220
mail.yourdomain.com:587 → TCP (Submission/STARTTLS)
mail.yourdomain.com:465 → TCP (SMTPS) + SSL cert expiry
mail.yourdomain.com:143 → TCP (IMAP)
mail.yourdomain.com:993 → TCP (IMAPS) + SSL cert expiry
mail.yourdomain.com:9090 → HTTP /health (sidecar)
Heartbeat → Maddy systemd restart ping
Summary
| Monitor | Target | What It Catches |
|---|---|---|
| SMTP | :25 + banner 220 | Inbound delivery broken, hung daemon |
| Submission | :587 | Outbound client email broken |
| SMTPS | :465 | Secure submission broken |
| IMAP | :143 | Mail retrieval failure |
| IMAPS | :993 | Secure IMAP failure |
| Health sidecar | http://:9090/health | Process down, service stopped |
| Heartbeat | Vigilmon heartbeat URL | Unexpected crash without restart |
| SSL certificate | :465, :993 | TLS certificate expiry |
Maddy's composable, single-binary design makes deployment simple — Vigilmon's external monitoring makes sure that simplicity doesn't come at the cost of observability.
Get started free at vigilmon.online — no credit card, monitors start running in under a minute.