tutorial

Monitoring Postal Mail Server with Vigilmon

Postal is the open-source alternative to SendGrid and Mailgun for SaaS teams who want to run their own transactional email infrastructure. Here's how to monitor Postal's web UI, REST API, RabbitMQ queue, SSL certificates, and delivery worker health with Vigilmon.

Postal lets you run your own transactional email infrastructure — SMTP, HTTP API, bounce processing, click tracking — all on your own servers, with no SendGrid or Mailgun dependency. But when you own the email stack, you also own the uptime. A down RabbitMQ queue means emails pile up undelivered. A stalled worker means bounces aren't processed. A certificate expiry on the dashboard breaks your team's access to delivery logs. Vigilmon monitors Postal's dashboard, REST API, message queue, SSL certificate, and scheduled delivery workers so email infrastructure failures are caught before your users notice their transactional emails stopped arriving.

What You'll Set Up

  • HTTPS uptime monitor for the Postal web dashboard (port 443)
  • REST API availability check for the server list endpoint
  • TCP port monitor for RabbitMQ AMQP (port 5672)
  • SSL certificate alerts for HTTPS Postal deployments
  • Cron heartbeat for Postal's delivery worker and bounce processing scheduler

Prerequisites

  • Postal installed and running (Ruby on Rails, RabbitMQ, MySQL)
  • Postal web UI accessible at https://postal.yourdomain.com
  • A Postal API key from the web UI (Settings → API Credentials)
  • A free Vigilmon account

Step 1: Monitor the Postal Web Dashboard

The Postal web dashboard is where your team views delivery queues, inspects email logs, manages mail servers, and investigates bounce rates. If it goes down, you lose visibility into every active email stream.

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter the URL: https://postal.yourdomain.com
  4. Set Check interval to 1 minute.
  5. Set Expected HTTP status to 200.
  6. Click Save.

Postal's web UI is a Rails application served via Puma. A 200 on the root URL confirms the Rails app is alive and serving requests. A 502 typically means Puma crashed or the reverse proxy (usually Nginx) lost its upstream connection.


Step 2: Monitor the REST API Server List Endpoint

Postal's HTTP API lets applications send email, check delivery status, and retrieve message details without using SMTP. The /api/v1/servers/list endpoint returns the list of mail servers configured in the current organization — monitoring it with your API key confirms both the API layer and authentication are working.

  1. Click Add MonitorHTTP / HTTPS.
  2. Enter the URL: https://postal.yourdomain.com/api/v1/servers/list
  3. Set Method to GET.
  4. Add the header: X-Server-API-Key: your-postal-api-key
  5. Set Expected HTTP status to 200.
  6. Set Response body contains to "status":"success" to validate the response structure.
  7. Click Save.

A healthy response looks like:

{
  "status": "success",
  "time": 0.003,
  "flags": {},
  "data": [
    { "uuid": "abc123", "name": "production", "permalink": "production" }
  ]
}

If the API returns 401, your API key has been rotated or deleted — update the monitor header. If it returns 503, the Rails API layer is overloaded or the database connection is failing.


Step 3: Monitor RabbitMQ AMQP Port (5672)

RabbitMQ is Postal's message broker: every email sent through Postal is queued in RabbitMQ before being picked up by the delivery workers. If RabbitMQ goes down, outbound delivery stops entirely — emails appear accepted by the SMTP server but never leave the queue. TCP monitoring on port 5672 catches RabbitMQ failures at the network level.

  1. Click Add MonitorTCP Port.
  2. Enter the host: postal.yourdomain.com (or the internal hostname if RabbitMQ is on a separate server).
  3. Enter the port: 5672
  4. Set Check interval to 1 minute.
  5. Click Save.

If RabbitMQ is running on a separate host from the Postal web process, use its internal IP or hostname. Verify RabbitMQ is listening:

ss -tlnp | grep 5672
# LISTEN 0 128 0.0.0.0:5672 ...

# Or check the service
systemctl status rabbitmq-server

For environments where port 5672 is firewalled to internal networks only, use the RabbitMQ management API on port 15672 as an alternative:

http://rabbitmq-host:15672/api/overview

Set the expected status to 200 and add Basic Auth credentials for the RabbitMQ management user.


Step 4: SSL Certificate Alerts for the Postal Dashboard

Postal's web dashboard is HTTPS-only — an expired certificate immediately blocks your team from accessing delivery logs, bounce data, and queue management. Postal deployments typically use Let's Encrypt via Certbot or a wildcard certificate provisioned separately.

Add a certificate expiry monitor:

  1. Open the HTTPS monitor created in Step 1.
  2. Enable Monitor SSL certificate in the SSL section.
  3. Set Alert when certificate expires in less than 21 days.
  4. Click Save.

Check the current certificate from the command line:

echo | openssl s_client -connect postal.yourdomain.com:443 2>/dev/null \
  | openssl x509 -noout -dates
# notAfter=Dec 20 12:00:00 2025 GMT

Postal's SMTP port (25/587) also uses TLS — if you've configured a certificate for SMTP, add a separate TCP monitor with SSL checking for those ports. Delivery clients validate the SMTP certificate when STARTTLS is negotiated.

If you're using Certbot:

# Test renewal
certbot renew --dry-run

# Force renewal if needed
certbot renew --force-renewal
systemctl reload nginx

Step 5: Heartbeat Monitoring for Postal Workers

Postal runs several background workers that handle the actual delivery pipeline:

  • SMTP workers — pick up queued messages and attempt delivery to external mail servers
  • Bounce processor — handles bounce notifications returned from recipient mail servers
  • Click/open tracker — aggregates click and open tracking events
  • Hold queue — periodically retries messages in the hold queue

These workers run as systemd services (or Docker containers) and can crash silently. If the SMTP worker stops, messages queue up indefinitely. If the bounce processor stops, your sending reputation can degrade because bounces accumulate unprocessed.

Use Vigilmon's cron heartbeat to confirm the worker processes are healthy.

In Vigilmon:

  1. Click Add MonitorCron Heartbeat.
  2. Set the expected ping interval to 10 minutes.
  3. Copy the heartbeat URL (e.g. https://vigilmon.online/heartbeat/abc123).

Worker health check script:

#!/bin/bash
# Check that all Postal workers are running
WORKERS=("postal-smtp-server" "postal-worker" "postal-cron")
ALL_UP=true

for worker in "${WORKERS[@]}"; do
  if ! systemctl is-active --quiet "$worker"; then
    echo "ALERT: $worker is not running"
    ALL_UP=false
  fi
done

if [ "$ALL_UP" = true ]; then
  curl -s https://vigilmon.online/heartbeat/abc123
else
  exit 1
fi

Schedule the check:

*/10 * * * * /usr/local/bin/check-postal-workers.sh >> /var/log/postal-health.log 2>&1

For Docker-based Postal deployments:

#!/bin/bash
# Check Postal containers
for container in postal-smtp postal-worker postal-cron; do
  if [ "$(docker inspect -f '{{.State.Running}}' $container 2>/dev/null)" != "true" ]; then
    echo "ALERT: $container container is not running"
    exit 1
  fi
done
curl -s https://vigilmon.online/heartbeat/abc123

Step 6: Configure Alert Channels

  1. Go to Alert Channels in Vigilmon and add Slack, PagerDuty, or an email address for email infrastructure alerts. Email delivery failures have immediate revenue and user-experience impact.
  2. Set Consecutive failures before alert to 1 for the RabbitMQ TCP monitor — a down message queue means all outbound email is queued and not delivered.
  3. Set Consecutive failures to 2 for the web dashboard — brief Rails restarts during deployments can cause a single probe to fail.
  4. Add a Maintenance window when upgrading Postal:
# Suppress alerts during a Postal version upgrade
curl -X POST https://vigilmon.online/api/maintenance \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"monitor_id": "abc123", "duration_minutes": 20}'

# Run upgrade
cd /opt/postal
postal upgrade
postal restart

Summary

| Monitor | Target | What It Catches | |---|---|---| | Web dashboard | https://postal.domain.com | Rails crash, dashboard inaccessible | | REST API | /api/v1/servers/list | API layer failure, auth errors | | RabbitMQ TCP | Port 5672 | Message queue down, delivery halted | | SSL certificate | Port 443 HTTPS | Certificate expiry, TLS failure | | Cron heartbeat | Heartbeat URL | SMTP worker crash, bounce processor down |

Running your own email infrastructure gives you full control over deliverability, bounce handling, and cost — but it also means you're on the hook when something breaks. With Vigilmon watching Postal's dashboard, API, RabbitMQ queue, SSL certificate, and worker health, you get the observability that managed email services provide as a black box, but on infrastructure you own and can debug directly.

Monitor your app with Vigilmon

Free plan — 5 monitors, no credit card required. Up and running in 60 seconds.

Start free →