tutorial

Monitoring Mailu with Vigilmon

Mailu is a Docker-based full-featured mail server. Here's how to monitor Mailu's web UI, admin interface, SMTP/IMAP ports, and the Rainloop/Snappymail webmail with Vigilmon.

Mailu is a batteries-included, Docker Compose-based mail server that bundles Postfix, Dovecot, Rspamd, a web admin panel, and webmail in a single stack. That convenience comes with a monitoring challenge: you have multiple containers and multiple protocols to watch. Vigilmon lets you monitor each Mailu component from the outside — catching container crashes, port failures, and TLS issues before they affect your users.

What You'll Set Up

  • HTTP monitor for the Mailu admin web interface
  • HTTP monitor for webmail (Snappymail / Roundcube)
  • TCP port checks for SMTP, IMAP, POP3
  • Mailu health endpoint monitoring
  • SSL certificate alerts for your mail domain
  • Alert channels for your team

Prerequisites

  • Mailu running via Docker Compose
  • Mail domain configured (e.g. mail.yourdomain.com)
  • Admin UI accessible at https://mail.yourdomain.com/admin
  • Webmail accessible at https://mail.yourdomain.com/webmail
  • A free Vigilmon account

Step 1: Monitor the Mailu Admin Interface

The Mailu admin panel manages domains, users, and mail configuration. Monitoring it confirms the front-end nginx container and the Mailu Flask admin app are both running.

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter the URL: https://mail.yourdomain.com/admin.
  4. Set Check interval to 2 minutes.
  5. Set Expected HTTP status to 200.
  6. Enable Monitor SSL certificate and set the expiry warning to 14 days.
  7. Click Save.

A non-200 response typically means the admin container has crashed, or the front (nginx) container that routes traffic to it is down.


Step 2: Monitor Webmail

If your users access mail through Snappymail or Roundcube, monitor the webmail login page directly:

  1. Add MonitorHTTP / HTTPS.
  2. URL: https://mail.yourdomain.com/webmail.
  3. Set Expected HTTP status to 200.
  4. Set Check interval to 2 minutes.
  5. Click Save.

The webmail container is separate from the admin container in Mailu's Docker Compose stack — a crash in one doesn't necessarily take down the other.


Step 3: Mailu Health Check Endpoint

Mailu's front nginx container serves a health check at /health:

  1. Add MonitorHTTP / HTTPS.
  2. URL: https://mail.yourdomain.com/health.
  3. Set Expected HTTP status to 200.
  4. Set Check interval to 1 minute.
  5. Click Save.

This endpoint confirms the front container is alive and routing requests. If it returns anything other than 200, the entire Mailu stack's ingress point is broken.


Step 4: TCP Port Checks for Mail Protocols

Mailu exposes standard mail ports via its front container. Check each port with a TCP monitor:

SMTP (port 25) — inbound delivery:

  1. Add MonitorTCP Port.
  2. Host: mail.yourdomain.com, Port: 25.
  3. Set Check interval to 2 minutes.
  4. Click Save.

Submission (port 587) — authenticated outbound:

  1. Add MonitorTCP Port.
  2. Host: mail.yourdomain.com, Port: 587.
  3. Click Save.

SMTPS (port 465) — secure submission:

  1. Add MonitorTCP Port.
  2. Host: mail.yourdomain.com, Port: 465.
  3. Click Save.

IMAP (port 143):

  1. Add MonitorTCP Port.
  2. Host: mail.yourdomain.com, Port: 143.
  3. Click Save.

IMAPS (port 993):

  1. Add MonitorTCP Port.
  2. Host: mail.yourdomain.com, Port: 993.
  3. Click Save.

POP3S (port 995) — optional, if enabled:

  1. Add MonitorTCP Port.
  2. Host: mail.yourdomain.com, Port: 995.
  3. Click Save.

Step 5: Monitor Individual Mailu Containers

For a more granular view, expose a health endpoint from each critical container and monitor it directly. Add to your docker-compose.override.yml:

services:
  imap:
    healthcheck:
      test: ["CMD", "dovecot", "exec", "doveadm", "log", "find"]
      interval: 30s
      timeout: 10s
      retries: 3

  smtp:
    healthcheck:
      test: ["CMD", "postfix", "status"]
      interval: 30s
      timeout: 10s
      retries: 3

These Docker health checks won't alert you externally, but pairing them with Vigilmon's TCP checks gives you both internal container state and external reachability in a single dashboard.


Step 6: Rspamd Web UI Monitoring (Optional)

Mailu includes Rspamd for spam filtering. If Rspamd's web UI is exposed (usually behind an authenticated proxy), you can monitor it:

  1. Add MonitorHTTP / HTTPS.
  2. URL: https://mail.yourdomain.com/rspamd.
  3. Set Expected HTTP status to 200 (or 401 if you haven't passed credentials — a 401 still confirms the container is running).
  4. Click Save.

Step 7: Configure Alert Channels

  1. In Vigilmon, go to Alert ChannelsAdd Channel.
  2. Choose Email, Slack, or Webhook.
  3. For Slack: paste your incoming webhook URL.
  4. Assign all Mailu monitors to this channel.
  5. Set Consecutive failures before alert to 2 on SMTP/IMAP monitors to suppress brief Docker restart noise.

Step 8: Status Page for Your Mail Domain

  1. In Vigilmon, go to Status PagesNew Status Page.
  2. Name it "Mail Services".
  3. Add your critical monitors: admin UI, SMTP, IMAP, webmail.
  4. Publish and bookmark the URL for your support team.

Summary

| Monitor | Target | What It Catches | |---|---|---| | Admin UI | https://mail.yourdomain.com/admin | admin container crash | | Webmail | https://mail.yourdomain.com/webmail | Webmail container crash | | Health check | https://mail.yourdomain.com/health | front nginx container down | | SMTP | :25 | Inbound delivery broken | | Submission | :587 | Outbound email broken | | SMTPS | :465 | Secure submission broken | | IMAP | :143 | Mail retrieval broken | | IMAPS | :993 | Secure IMAP broken | | POP3S | :995 | POP3 retrieval broken | | Rspamd UI | /rspamd | Spam filter container crash | | SSL certificate | All HTTPS monitors | Let's Encrypt renewal failure |

Mailu's multi-container architecture means failures can be isolated to a single component — or cascade across the whole stack. With Vigilmon monitoring every layer, you'll know exactly which container failed and how it's affecting your users.

Get started free at vigilmon.online — no credit card, monitors start running in under a minute.

Monitor your app with Vigilmon

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

Start free →