Viewing the Exim4 Mail Queue

written on Thursday, August 07, 2014 by

Sometimes you wish to debug outgoing emails in the exim4 mail server. You can easily list the current mail queue using the mailq or exim -bp commands:

# exim -bp
46h  4.2K 1XEd7G-0005Wg-TD <> *** frozen ***

17h  2.0K 1XF4UP-000322-SP <> *** frozen ***

5m  3.7K 1XFKUl-0005YO-3Z <> *** frozen ***

To see the reason for common problems, take a look at the /var/spool/exim4/msglog/<msgid> file:

# cat /var/spool/exim4/msglog/1XEd7G-0005Wg-TD
2014-08-05 13:41:18 Received from <> R=1XEd7E-0005Wb-IN U=Debian-exim P=local S=4302
2014-08-05 13:41:18 routing failed for <root@localhost>: Unrouteable address
*** Frozen (delivery error message)

You can also view the contents of a message with exim -Mvb <msgid>:

# exim -Mvb 1XF4UP-000322-SP
This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:
    SMTP error from remote mail server after RCPT TO:<>:
    host []: 550 5.1.1 <>... User unknown

------ This is a copy of the message, including all the headers.  ------


For more options, see man exim.

This entry was tagged exim4, linux and mailserver