DirectAdmin

Manage the Exim mail queue and fix email delivery in DirectAdmin

Use DirectAdmin's Mail Queue Administration and Exim commands to view, retry and delete queued mail, find spam senders and fix common delivery errors.

AdvancedDirectAdmin admin2 min read

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

  1. At Admin Level go to Server Manager → Mail Queue Administration.
  2. The list shows each queued message's ID, age, size, sender and recipient.
  3. Click a message ID to see its headers and the last delivery error.
  4. Tick messages and choose Retry, Delete or Freeze/Thaw.

Useful Exim commands

TaskCommand
Count queued messagesexim -bpc
List the queueexim -bp
Summary by domainexim -bp | exiqsumm
Show headers of a messageexim -Mvh MESSAGE-ID
Force delivery of one messageexim -M MESSAGE-ID
Retry the whole queueexim -qff
Delete one messageexim -Mrm MESSAGE-ID
Delete frozen messagesexiqgrep -z -i | xargs exim -Mrm

Find a spam sender

  1. Look for a large queue (exim -bpc in the thousands) or many messages from one sender.
  2. List senders: exim -bp | awk '/^ *[0-9]+[mhd]/{print $4}' | sort | uniq -c | sort -n
  3. Check the main log for the authenticated user: grep 'A=login' /var/log/exim/mainlog | tail. A compromised mailbox shows A=login:user@domain; a hacked script shows mail sent from a website path.
  4. 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.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.