Module 11 · Lesson 23 of 25

Login logging and audit trails

Part of Dovecot: IMAP/POP3 at Production Scale — Security Hardening & Audit Logging.

10-logging.conf controls verbosity:

log_path = /var/log/dovecot.log
info_log_path = /var/log/dovecot-info.log
debug_log_path =

login_log_format = "%u: %m"
login_log_format_elements = "user=<%u> method=%m rip=%r lip=%l mpid=%e %c"

mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename
plugin {
  mail_log_fields = uid box msgid size
}

The mail_log plugin (load via mail_plugins = mail_log notify) writes audit lines for destructive events. Critical for compliance (HIPAA, financial services).

Forward to SIEM: use rsyslog or vector to push /var/log/dovecot.log into Loki, Elastic, Splunk. Tag by mpid (mail process ID) to thread events per session.

Track logins from new IPs: combine mail_log with a fail2ban filter or a custom script that emails users when a login arrives from an unrecognized ASN.

Sign in to keep track of what you have read.

Pulse · self-hosted sending

Own the infrastructure your pipeline depends on.

One install script on your own server. Pulse sets up the MTA, mailboxes, certificates and dashboard; you add domains and start sending.

# on a fresh Ubuntu server
$ cd pulse && sudo ./install.sh
→ docker compose up · kumomta · stalwart · caddy
→ dashboard ready on https://pulse.yourdomain.com
$

Also from us:Beat — monitoring that tells you the fixConsulting — $65/hr, no retainer