When email stops leaving a Plesk server – or a hacked mailbox floods the internet with spam – the mail queue fills up. Plesk uses Postfix and gives administrators a Mail Queue view plus outgoing mail controls. This guide shows how to clear the queue, find the source of spam and prevent it.
Before you start
- Plesk administrator access and root SSH access.
- Plesk's default mail server Postfix (with Dovecot for IMAP/POP3).
View the queue in Plesk
- Go to Tools & Settings → Mail Server Settings.
- Open the Mail Queue tab.
- The list shows queued messages with sender, recipient, size and the reason for delay.
- Tick messages and click Remove, or Clear Queue to remove everything (only when you are sure it is all spam).
Useful Postfix commands
| Task | Command |
|---|---|
| Show the queue | postqueue -p |
| Count messages | postqueue -p | tail -1 |
| Flush (retry now) | postqueue -f |
| Read a message | postcat -vq QUEUE-ID |
| Delete one message | postsuper -d QUEUE-ID |
| Delete all deferred | postsuper -d ALL deferred |
Find the source of spam
- Read a few spam messages with
postcat -vqand look at the headers. - If you see
X-PPP-Message-IDand anX-PPP-Vhostheader, the mail came from a website script on that domain. Check its files for malware. - If the log shows
sasl_username=user@domain, a mailbox password was stolen:grep sasl_username /var/log/maillog | awk '{print $NF}' | sort | uniq -c | sort -n. - Change the password or disable the mailbox, then remove the spam from the queue.
Limit outgoing mail
Plesk can cap how much each mailbox, domain and subscription sends per hour. Go to Tools & Settings → Mail Server Settings, enable Limit outgoing email messages and set defaults, for example 100 per mailbox and 500 per subscription per hour. Override limits per service plan or subscription where needed. Plesk notifies you when an account hits its limit – a strong sign of compromise.
Common delivery errors
- 554 / 550 blocked using Spamhaus or other RBL: your IP is listed. Remove the cause, then request delisting.
- SPF fail or DMARC reject: fix the domain's records; see SPF, DKIM and DMARC in Plesk.
- Connection timed out to port 25: the network blocks outgoing SMTP. Ask your provider or use a smart host (relay) under Mail Server Settings → Outgoing mail mode.
- Host name does not match PTR: set reverse DNS for the IP; on a VPS see set rDNS.
Read the mail log
Plesk logs mail in /var/log/maillog (RHEL-based) or /var/log/mail.log (Debian/Ubuntu). Follow a message by its queue ID: grep QUEUE-ID /var/log/maillog. Administrators can also open Tools & Settings → Log Browser and select the mail log.
Troubleshooting
- Queue fills again after clearing: the source is still active.
- Legitimate mail deferred for hours: receiver greylisting or rate limits; Postfix retries automatically.
- Mail Queue tab empty but users complain: mail may be rejected before queuing; check the log.
