I'm using postfix SMTP server and I'm rewriting sender and recipient addresses. From the postfix logs, I can see the recipient address rewriting logs,

Sep 12 17:23:32 rewritehost postfix/smtp[1223]: 28A6701362: to=<email@domain.com>, orig_to=<email@domain2.com>, relay=relay.host[xxx.xxx.xxx.xxx]:25, delay=56, delays=51/0/4.5/0, dsn=2.0.0, status=sent (250 Message accepted for delivery)

Here, I sent an email to email@domain2.com, but then it is getting a rewrite by postfix and then email is sent to email@domain.com ( basically I understand recipient rewrite happened)

Similarly, I need to enable the logs for sender rewrite. I made the following change in /etc/postfix/master.cf file

cleanup   unix  n       -       -       -       0       cleanup -v

and it showed long verbose logs how cleanup daemon does the sender recipient rewrite.But I do not want to enable verbose mode.

  • Please move this question to serverfault if this is not the right place to ask. – FELDAP Dec 7 '16 at 17:18

As quoted by victor from postfix mailing list:

You can cause the envelope sender to be logged via the INFO action
of access(5):

        smtpd_end_of_data_restrictions =
                check_sender_access static:INFO

This will record the original envelope sender before rewriting happens
downstream in cleanup(8). 


| improve this answer | |
  • Note: INFO was added to access in postfix 3.0. In earlier versions, you can use WARN instead. – Gnarfoz Jun 20 '18 at 13:37
  • You can find the INFO output in /var/log/mail.info in the following format: ... info: END-OF-MESSAGE from localhost[]: ; from=<...> to=<...> proto=ESMTP helo=<...> – Florian Sager Jan 16 at 11:26

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.