How to Troubleshoot Email Delivery Using exim ‘-Mvh’ Command

August 8, 2025 / Command Line

If you are using Exim as your mail transfer agent (MTA), the first step in resolving email delivery issues is often to examine the message headers. The exim -Mvh command, which displays the headers of a specific message in the Exim mail queue, is a helpful tool for this.
This guide will demonstrate how to use the exim ‘-Mvh’ command to correctly address email delivery problems.

What Does exim -Mvh Do?
The exim -Mvh command displays the headers of a message stored in the Exim queue. It’s useful for identifying:

  • Sender and recipient addresses
  • Message subject
  • Received path
  • Spam or authentication headers
  • Any changes made by Exim or filters

Basic Syntax:

exim -Mvh <message-id>

Replace <message-id> with the actual message ID of the email you want to inspect.

Step-by-Step: Troubleshooting with exim -Mvh

  1. List the Mail Queue
    To identify messages stuck in the queue, run:

    exim -bp

    This shows a list of message IDs, sender, recipient, size, and age.
    Example output:

    12h  1.3K 1gZB5C-0001Kk-Jx <> ***@example.com
  2. Check the Message Headers
    Copy the message ID and run:

    exim -Mvh 1gZB5C-0001Kk-Jx
  3. Review Key Header Fields
    Here’s what to look for:

    • From: – Check if the sender’s address is correct.
    • To: – Confirm the intended recipient.
    • Subject: – Verify the subject line (optional).
    • Received: – Displays the servers the email passed through.
    • Authentication-Results: – Look for SPF, DKIM, or DMARC failures.
    • X-Spam-Status: – Indicates if the email was flagged as spam.
  4. Sample Output of exim -Mvh
    From: [email protected]
    To: [email protected]
    Subject: Test email
    Received: from [192.168.1.100] by server.example.com ...
    Authentication-Results: spf=pass dkim=fail dmarc=pass ...
    X-Spam-Status: Yes, score=5.0 required=4.0 ...

The exim -Mvh command is an essential diagnostic tool for reviewing the headers of queued emails. By analysing the output, you can quickly pinpoint delivery issues such as spam flagging, misrouting, or authentication failures.

For advanced debugging, combine -Mvh with other Exim flags like -Mvl and -Mvb.

Need better email control? Learn How to Filter or Block Emails Based on Subject in SpamAssassin

Spread the love