DirectAdmin uses Exim to send and receive mail. When delivery fails or a compromised account sends spam, messages pile up in the mail queue. Knowing how to read and clean the queue is essential for keeping your server's IP off blacklists.
Before you start
- Admin-level access to DirectAdmin and root SSH access.
- Basic understanding of email bounces and SMTP error codes.
View the queue in DirectAdmin
- At Admin Level go to Server Manager → Mail Queue Administration.
- The list shows each queued message's ID, age, size, sender and recipient.
- Click a message ID to see its headers and the last delivery error.
- Tick messages and choose Retry, Delete or Freeze/Thaw.
Useful Exim commands
| Task | Command |
|---|---|
| Count queued messages | exim -bpc |
| List the queue | exim -bp |
| Summary by domain | exim -bp | exiqsumm |
| Show headers of a message | exim -Mvh MESSAGE-ID |
| Force delivery of one message | exim -M MESSAGE-ID |
| Retry the whole queue | exim -qff |
| Delete one message | exim -Mrm MESSAGE-ID |
| Delete frozen messages | exiqgrep -z -i | xargs exim -Mrm |
Find a spam sender
- Look for a large queue (
exim -bpcin the thousands) or many messages from one sender. - List senders:
exim -bp | awk '/^ *[0-9]+[mhd]/{print $4}' | sort | uniq -c | sort -n - Check the main log for the authenticated user:
grep 'A=login' /var/log/exim/mainlog | tail. A compromised mailbox showsA=login:user@domain; a hacked script shows mail sent from a website path. - Change the mailbox password or suspend the user, then delete the spam:
exiqgrep -i -f spammer@example.com | xargs exim -Mrm
DirectAdmin can also cap outgoing mail per user per day under Server Manager → Administrator Settings (email send limits), which limits the damage of a compromised account.
Read delivery errors
- 550 rejected / blocked using Spamhaus: your IP is listed. Clean the source, then request delisting.
- 421 / 451 temporarily deferred: the receiver is greylisting or rate-limiting; Exim retries automatically.
- SPF or DMARC fail: fix the domain's DNS; see DNS management.
- Connection timed out on port 25: outbound port 25 is blocked by the network provider.
Follow one message through the log with exigrep MESSAGE-ID /var/log/exim/mainlog.
Prevent problems
- Make sure reverse DNS matches the server hostname; on a VPS see set rDNS.
- Enable DKIM for domains and keep SpamAssassin and RBL checks on for incoming mail.
- Keep Exim and its configuration updated with CustomBuild:
./build exim_conf.
Troubleshooting
- Queue grows again after cleaning: the source is still active – a script or mailbox keeps sending.
- Mail Queue page is slow: use the command line for very large queues.
- Local delivery fails: check disk quota of the recipient mailbox.
