Thank you. But when I use
smtpd_end_of_data_restrictions =
check_sender_access static:INFO
I get,
postfix/smtpd[13668]: warning: unknown smtpd restriction: "INFO
postfix/smtpd[13668]: 12E9F6420F: reject: END-OF-MESSAGE from
host[x.x.x.x]: 451 4.3.5 Server configuration error; from=<root@host>
to=<root@host> proto=SMTP
On Tue, Dec 20, 2016 at 7:35 PM, Viktor Dukhovni <[email protected]
> wrote:
>
> > On Dec 20, 2016, at 12:53 AM, Burn Zero <[email protected]> wrote:
> >
> > As you can see the orig_to parameter shows the original id to which
> the email was sent and the to= parameter explains the rewritten email id. I
> can clearly see the email rewriting happened. Similarly, I want to get the
> log entries for sender rewrite.
>
> You can cause the envelope sender to be logged via the INFO action
> of access(5):
>
> main.cf:
> smtpd_end_of_data_restrictions =
> check_sender_access static:INFO
>
> This will record the original envelope sender before rewriting happens
> downstream in cleanup(8). You can also prepend the original envelope
> sender as a message header.
>
> main.cf:
> pcre = pcre:${config_directory}/
> smtpd_end_of_data_restrictions =
> check_sender_access static:INFO,
> check_sender_access ${pcre}:prepend-sender.pcre
>
> prepend-sender.pcre:
> /^(<.*>)$/ PREPEND X-Envelope-From: $1
> /(.*)/ PREPEND X-Envelope-From: <$1>
>
> --
> Viktor.
>
>