Insights

No /var/log/mail.log on Debian 12? Trace the Growing Postfix Queue With journalctl

November 9, 2026
0:00
You notice the Postfix queue on a freshly built or upgraded Debian 12 server climbing, so you reach for tail -f /var/log/mail.log and get "No such file or directory". It looks like logging is broken, or like Postfix has stopped writing logs entirely. Neither is true. Debian 12 no longer installs rsyslog by default, so nothing turns syslog messages into text files under /var/log. Postfix is still logging. The lines are in the systemd journal, and you read them with journalctl. This article walks through that situation as a post-mortem: what the impact looks like, where the investigation usually stalls, how the journal shows the cause, how to contain it, and what to change so the next incident doesn't start with a missing file.
A growing outbound queue is a symptom, not a diagnosis. Common causes include a remote server deferring your mail, a DNS problem, or your IP landing on a blocklist. The cause this article focuses on is a compromised mailbox. Someone has the password for one account, authenticates over SMTP, and pushes spam through your server as a legitimate user. The early signs are usually indirect. Customers say their mail is slow or bouncing. Remote servers start deferring with reputation-related errors. mailq gets longer every time you run it. Because the spam goes through authenticated submission, the server isn't acting as an open relay. It's doing what it was configured to do, for the wrong person. To answer the support question "why is my mail stuck?" honestly, you need the delivery and authentication lines. Those normally lived in mail.log.
On older Debian and Ubuntu systems the path was familiar. Postfix sends its messages to the local syslog socket, rsyslog picks them up, and the default rsyslog rules write anything from the mail facility to /var/log/mail.log. Muscle memory, runbooks, and a lot of monitoring scripts assume that file exists. On Debian 12 the first half of that chain is unchanged. Postfix still calls syslog, and systemd-journald listens on the same socket. The second half is gone unless someone installed rsyslog. journald stores the messages in its own binary format, persistently under /var/log/journal on a default install, and no plain-text mail.log appears. The investigation tends to stall at this point. People assume the logs were lost, restart Postfix, or start editing logging config before checking whether the messages are already sitting in the journal. They usually are, along with structured fields such as the program name and syslog facility. Those fields make the lines easier to filter than a flat text file.
You can pull Postfix lines in three ways. Filter by the systemd unit, by the syslog identifier each Postfix daemon uses (such as postfix/smtpd or postfix/qmgr), or by the mail facility. The facility filter is the closest equivalent to the old mail.log.
BASH
# Everything from the Postfix service in the last hour
# (Debian runs the default instance as postfix@-)
journalctl -u postfix@- --since '1 hour ago'

# Filter by syslog identifier, independent of the unit name
journalctl -t postfix/smtpd -t postfix/qmgr -t postfix/smtp --since '1 hour ago'

# All mail-facility messages (facility 2), like the old mail.log
journalctl SYSLOG_FACILITY=2 --since today

# Follow live, like tail -f /var/log/mail.log
journalctl -f SYSLOG_FACILITY=2
If -u postfix@- returns nothing, run systemctl list-units | grep postfix to see what the unit is called on your system. The identifier and facility filters don't depend on the unit name. With the logs in hand, the key detail for a compromised mailbox is the sasl_username= field. When a client authenticates over SMTP, the smtpd line that accepts the message records the client address, the SASL method, and the username it logged in as. A single account suddenly submitting far more mail than anyone else, often from several unfamiliar IPs, points straight at the cause.
BASH
# Queue size summary (the last line of the queue listing)
postqueue -p | tail -n 1

# Which authenticated accounts submitted mail in the last 2 hours, busiest first
journalctl -t postfix/smtpd --since '2 hours ago' \
  | grep -o 'sasl_username=[^, ]*' | sort | uniq -c | sort -rn | head
If one name is far ahead of the rest, take a queue ID from one of its lines and follow it through the journal. journalctl SYSLOG_FACILITY=2 --since today | grep QUEUEID, with QUEUEID replaced by the real ID, shows the cleanup, qmgr, and smtp lines for that message. Those lines include the sender, the recipients, and the remote server's response. Deferral reasons there often explain why the queue is backing up rather than draining. If the queue is full but no SASL username stands out, check postfix/pickup instead. Mail submitted locally, for example by a PHP script calling sendmail, enters through pickup and is logged with a uid= rather than a login. A web server user's uid showing up in large volumes usually means a compromised site, not a stolen mailbox password. The fix for that is very different.
Containment has two goals: stop new spam from entering, and stop the spam already queued from going out and damaging your reputation further. Order matters. First, cut off the attacker's access. Change the mailbox password, or disable the account, in whatever backend handles SMTP authentication. That's often Dovecot, but it depends on the stack. Re-run the counting command after a few minutes. If the username still shows up, the attacker may have a second credential, or an app password, or the change hasn't reached the auth backend. Second, deal with the queued messages. Holding is safer than deleting, because held mail stays on disk and you can inspect or release it later. postsuper -h takes a queue ID, and postsuper -h ALL holds everything. Holding everything also stops legitimate mail, so only use it if you plan to release the good messages quickly. Deletion with postsuper -d is permanent. Before deleting anything, confirm the queue IDs belong to the compromised sender, for example by matching them against the from= lines in the journal or the postqueue -p listing. Don't delete by broad patterns you haven't checked. Third, keep the evidence. The journal has size and retention limits, and a spam flood fills it faster than normal traffic. Before anyone vacuums logs to free space, export the relevant window to a file with something like journalctl SYSLOG_FACILITY=2 --since today > /root/mail-incident.log. That file is what you'll need to work out when the compromise started and which IPs were involved. If you haven't decided how big the journal should be, this piece on journald limits versus logrotate covers the trade-offs. Once the account is locked and the queue is under control, check whether your IP was listed during the flood. Then tell the mailbox owner how the password most likely leaked so it doesn't happen again the following week.
The architectural question is whether you need mail.log back at all. For most single-server setups, the journal already provides everything the file did, plus filtering by field, time ranges without grep gymnastics, and one place for every service's logs. Before relying on it, confirm the journal survives reboots and has enough room.
BASH
# Is the journal persistent? A populated /var/log/journal means yes
ls /var/log/journal
journalctl --disk-usage

# If you need the classic text file back (captures new logs only)
apt install rsyslog
Reinstalling rsyslog still makes sense in a few cases. Some tools only read files, such as older report scripts or monitoring agents that tail a path. Some teams forward logs to a central syslog server. And some runbooks or staff habits depend on the file, where it's more practical to keep it. Once installed, Debian's default rsyslog config usually writes the mail facility to /var/log/mail.log again. It only captures messages from that point on, though. Anything from before the install stays in the journal. There's also a middle option. Newer Postfix versions can write their own log file through the maillog_file setting and the postlog service, without rsyslog. It's worth a look if mail.log is the only file you miss. Check your Postfix version and master.cf before switching. Whichever path you pick, update the tools that assumed the old file. Report scripts like pflogsumm can often read journalctl output on stdin. fail2ban jails that watched a log path may need the systemd backend. Monitoring checks that alert on log patterns need to point at the new source. These gaps are easy to miss until the next incident, when the alert you were counting on never fires. The practical takeaway: on Debian 12, a missing mail.log means rsyslog isn't installed, not that the logs are gone. Learn the three journalctl filters (unit, identifier, facility) and the sasl_username counting pipeline before you need them. Make sure the journal is persistent and large enough. Install rsyslog only if something specific still needs a text file.

Join My Newsletter & Get Updates!

Get notified whenever a new technical guide, server infrastructure breakdown, or personal reflection goes live, plus a curated weekly digest.