Skip to content

Plesk mail flow troubleshooting — Postfix, Dovecot, SpamAssassin failure modes

When Plesk mail stops flowing, the culprit is usually one of six well-known failure modes. Here is how to identify the right one fast, and the recovery commands.

A customer calls — mail to their domain has been silently disappearing for ninety minutes. The Plesk mail panel says everything is “running”. You SSH in, tail /usr/local/psa/var/log/maillog, and the picture clears up in thirty seconds: Postfix is accepting connections but Dovecot’s auth socket is gone because Plesk ran a mailmng-server reconfigure in the middle of a SpamAssassin update and never restarted Dovecot. Six failure modes account for most Plesk mail outages. This is how to triage them and recover.

What’s happening

Plesk’s mail stack on Linux is Postfix + Dovecot + SpamAssassin (Qmail is deprecated on current Plesk Obsidian and you should not be running it on a new build). The Plesk panel orchestrates the configs through mailmng-server, which rewrites main.cf, master.cf, Dovecot’s *.conf, and the SpamAssassin user prefs on every panel change. The orchestration is normally fine. It breaks when one of these happens:

  1. Postfix accepts SMTP but mail is queued indefinitely. Outbound delivery is failing because the IP is on a blocklist, or because reverse DNS doesn’t match the HELO name, or because the upstream provider blocks port 25 outbound.
  2. Dovecot won’t accept IMAP/POP logins. The auth socket has crashed, or dovecot-auth has gone runaway and is being killed by oom-killer.
  3. SpamAssassin grades everything 999.0. A rule update broke the bayes database, or sa-update filled the disk that holds /var/lib/spamassassin.
  4. Mail is being silently dropped at the milter. Plesk’s psa-pc-remote filter is rejecting based on a stale per-user rule.
  5. DMARC alignment is failing because DKIM is signing with the wrong selector. Plesk regenerated DKIM keys and the DNS TXT record wasn’t updated.
  6. Local mailboxes are full and Dovecot is refusing delivery. Quota enforcement returns 552, the sender’s MTA bounces.

The triage walks each failure mode in order of frequency.

How to verify

Start with the maillog — the single most informative file on a Plesk mail host:

tail -200 /usr/local/psa/var/log/maillog

# Or in real-time during an active outage:
tail -f /usr/local/psa/var/log/maillog | grep -Ei 'reject|defer|warning|error|fatal'

Service health:

systemctl status postfix dovecot spamassassin
# All three should be "active (running)"
plesk repair mail --check
# This runs Plesk's own mail consistency check

For Postfix-specific queue inspection:

postqueue -p | tail -50
# Or just the count:
mailq | tail -1

# Detailed view of a stuck message
postcat -q $(mailq | awk '/^[A-F0-9]{10,}/ {print $1; exit}')

For Dovecot:

# Auth socket exists?
ls -la /var/run/dovecot/auth-userdb
ls -la /var/run/dovecot/auth-master

# Process count (should be O(1) per CPU, not hundreds)
ps aux | grep dovecot | wc -l

# Failed-login pattern
grep 'authentication failed' /usr/local/psa/var/log/maillog | tail -20

For SpamAssassin:

# Process running + listening on the right socket
systemctl status spamassassin
ss -lntp | grep 783

# Test a known-good message
spamassassin -t < /usr/share/doc/spamassassin/sample-nonspam.txt 2>&1 | head -20

# Bayes database status
sudo -u popuser sa-learn --dump magic 2>/dev/null

For DKIM/DMARC alignment:

# What DKIM key is Plesk currently using for the domain
plesk bin dkim --info example.com

# What the DNS says
dig +short TXT default._domainkey.example.com @8.8.8.8

# Run an outbound test
echo "Subject: test" | sendmail -f noreply@example.com test@example.com
# Then check the maillog for the actual DKIM signature being applied

The fix

Match the symptom to one of the six modes and apply the targeted fix.

Mode 1 — Queue building, no delivery

If postqueue -p shows hundreds of deferred messages and the deferral reason mentions Connection refused, Connection timed out, or relay access denied, the issue is outbound:

# Is port 25 outbound actually open from this host?
telnet aspmx.l.google.com 25
# If "connection refused", the upstream provider is blocking outbound 25.
# Plesk lets you relay through an authenticated smarthost:
plesk bin server_pref --update -smarthost smtp.relay.example.com -smarthost-port 587 \
  -smarthost-user relay-user -smarthost-password 'relay-pw' -smarthost-tls true

# Restart and flush the queue
systemctl restart postfix
postqueue -f

If the deferral reason mentions Spamhaus, Barracuda, SORBS, or a similar RBL, the IP is on a blocklist. Check:

# Get the Plesk server's outbound IP
curl -s https://api.ipify.org
# Then check it against a multi-RBL tool
for RBL in zen.spamhaus.org bl.spamcop.net dnsbl.sorbs.net; do
  echo -n "$RBL: "
  dig +short $(curl -s https://api.ipify.org | awk -F. '{print $4"."$3"."$2"."$1}').$RBL
done

If listed, request removal through the RBL’s portal and identify what got you listed (typically a compromised mailbox sending spam — check /usr/local/psa/var/log/maillog for unusual outbound volume per sender).

Mode 2 — Dovecot auth broken

If users can’t log in to IMAP/POP and /usr/local/psa/var/log/maillog shows dovecot-auth: Disconnected or auth: WORKER, the auth process is unhealthy:

# Restart Dovecot cleanly
systemctl restart dovecot

# If the auth socket is gone, Plesk's reconfigure rebuilds it:
plesk repair mail --service-restart

# If Dovecot keeps dying with OOM kills:
dmesg | tail -50 | grep -i 'killed process'
# Bump the dovecot-auth memory cgroup or add swap. Long-term, audit mailbox count.

If a specific user can’t authenticate but others can, the user’s password may be desynchronized between Plesk’s database and Dovecot’s auth backend:

# Reset the user's password through Plesk CLI — this regenerates the auth entry
plesk bin mail --update user@example.com -passwd 'NewStrongPassword'

Mode 3 — SpamAssassin scoring everything as spam

If every inbound message is getting X-Spam-Score: 999.0 and rejected, the bayes database may be corrupt or sa-update is failing:

# Test SpamAssassin against a known-clean message
spamassassin -t -D < /usr/share/doc/spamassassin/sample-nonspam.txt 2>&1 | head -30

# Re-run sa-update
sa-update --no-gpg
systemctl restart spamassassin

# If the bayes db is corrupt, rebuild
sudo -u popuser sa-learn --clear
sudo -u popuser sa-learn --ham /var/qmail/mailnames/*/*/Maildir/cur/* 2>/dev/null | head
systemctl restart spamassassin

Mode 4 — Milter is dropping mail

If maillog shows milter-reject or policyd-spf reject, a Plesk milter is the gatekeeper:

# Check what milters Postfix is configured to call
grep 'smtpd_milters\|non_smtpd_milters' /etc/postfix/main.cf

# Common culprit: psa-pc-remote
systemctl status psa-pc-remote
# Or:
systemctl restart psa-pc-remote

For per-user “outgoing mail limits” that block legitimate outbound, raise via Plesk:

plesk bin mail --update user@example.com -outgoing_messages_mbox_limit 500

Mode 5 — DKIM selector mismatch

If senders are failing DMARC at the recipient’s end, compare what Plesk is signing with what DNS says:

# Plesk's view
plesk bin dkim --info example.com

# DNS view
dig +short TXT default._domainkey.example.com

# If they differ, regenerate and publish the new key:
plesk bin dkim --update example.com -dkim_protection true
plesk bin dkim --info example.com | grep -A2 'Public key'
# Then update the DNS provider's TXT record with the new public key

Repeat until dig returns the same key Plesk is signing with. Verify by sending a test through Gmail and reading the Authentication-Results header.

Mode 6 — Mailbox full

If a specific recipient is bouncing back with 552 Mailbox is full, the quota is exceeded:

# Inspect quota
plesk bin mail --info user@example.com | grep -i quota

# Raise it
plesk bin mail --update user@example.com -mailbox_quota 5G

# Or, if the customer is responsible for their own cleanup,
# notify them and leave the quota in place.

For domain-wide quotas approaching capacity, surface a report:

plesk db -Ne "SELECT d.name, SUM(mn.quota), SUM(mn.mbox_size) \
  FROM mail m \
  JOIN mail_names mn ON mn.mail_id=m.id \
  JOIN domains d ON d.id=m.dom_id \
  GROUP BY d.name \
  HAVING SUM(mn.mbox_size) > 0.9 * SUM(mn.quota)"

Post-recovery validation

After any of the above fixes, walk the same path the bounced message would take:

# Send a test through the local MTA
echo "Subject: post-fix test
This is a test from $(hostname)." | sendmail -f support@example.com you@external-provider.example

# Watch the log
tail -f /usr/local/psa/var/log/maillog | grep -m5 'status='

# Confirm the recipient sees it within 60 seconds

If everything’s quiet for 15 minutes after the fix, the recovery is complete.


Stack Harbor runs Plesk mail stacks under monitoring and support with alerts on queue depth, Dovecot auth failure rate, and DKIM-DNS divergence so the customer call doesn’t have to be the first signal. Pair it with environment management for ongoing patching and configuration drift control — or start a scoping call if mail flow keeps surprising you.