4

I get asked day by day to verify if a mail was successfully sent out by our server (because client complains that he sent it to xy and his recipient never got it). Most likely this isn't our fault but the recipients mail server dropped/flagged the mail as spam. So my question is how to verify (if it's possible) that a mail was SENT OUT by postfix from our end?

If I grepping through the mail.log.* files I get entries like:

Sep 14 06:27:10 mailhost postfix/qmgr[21603]: 14B40C65A1: from=<user@domain.com>, size=1372, nrcpt=1 (queue active)
Sep 14 06:27:10 mailhost postfix/qmgr[21603]: 11673C5FDA: from=<user@domain.com>, size=1469, nrcpt=1 (queue active)

This information is completely invaluable. By this all I see is that user@domain.com sent an email at 6:27 to somebody and it was queued by the mail system (not that it was sent out and what happend after).

Is it possible to log these events with postfix? Even if it takes increasing the error log I need this information.

Thanks

6

By default, Postfix creates at least two log lines for a piece of outgoing mail it handles: For the receiving and the sending part.

Sep 15 10:30:51 mail postfix/qmgr[1499]: F1FBEC0666: from=<localuser@local.domain>, size=251, nrcpt=1 (queue active)
Sep 15 10:30:51 mail postfix/smtp[25011]: F1FBEC0666: to=<remoteuser@remotedomain>, relay=xxxxxx[yyyyyyy]:25, delay=0.83, delays=0.15/0.01/0.27/0.39, dsn=2.0.0, status=sent (250 Requested mail action okay, completed: id=xxxxxxxxxxx) 
Sep 15 10:30:51 mail postfix/qmgr[1499]: F1FBEC0666: removed

My guess is that you grepped for the local user, not the remote user, and therefore didn't see the second line. Please don't use grep if you don't really know what you are looking for, more or less is more useful there.

  • This solution given to this thread was using grep to inspect the maillog. For example grep 'to=<emailaddress' /var/log/maillog | cut -d ' ' -f 6 | grep -f - /var/log/maillog or grep 'from=<emailaddress' /var/log/maillog | cut -d ' ' -f 6 | grep -f - /var/log/maillog – masegaloeh Sep 17 '14 at 1:20
1

Your mail user can also request a so-called Delivery Status Notification in his MUA. It's a kind of a Bounce-message, except that the included message includes a success message, like this example:

Your message was successfully delivered to the destination(s)
listed below. If the message was delivered to mailbox you will
receive no further notifications. Otherwise you may still receive
notifications of mail delivery errors from other systems.

                   The mail system

<receiver@example.com>: delivery via mx.example.org[199.4.28.26]:25: 250
    Requested mail action okay, completed: id=2LMKVd-1Y2eA52oJa-70aFI9

The report also includes detailed information of when did the message arrive at which server.

In Thunderbird a DSN-request can be activated in the compose-window as follows: Options > Delivery Status Notification.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.