Hello,

For a mail archiving solution I need to write all BCC'ed recipients to a X-header. I am looking for a better way to hide this X-header from users than ignoring it at delivery and only keep it for recipient "[email protected]".

So far I am doing this:

/etc/postfix/main.cf
        always_bcc = [email protected]
        smtpd_recipient_restrictions = ...,
          check_recipient_access pcre:/etc/postfix/x-add-envelope-to,
          ...
        transport_maps = hash:/etc/postfix/transport

/etc/postfix/transport:
        archive.domain.tld   smtp_keep_envelope_to:[IP.OF.ARCH.IVE]:25

/etc/postfix/x-add-envelope-to:
        /(.*)/   prepend X-Envelope-To: $1

Next I added a header_check to smtp, which is the default_transport, same for lmtp, which is my local delivery agent. Furthermore I created a new smtp transport "smtp_keep_envelope_to", which does not remove any headers.

/etc/postfix/master.cf
smtp_keep_envelope_to unix - - - - - smtp
        smtp      unix  -       -       -       -       -       smtp
          -o smtp_header_checks=pcre:/etc/postfix/x-remove-envelope-to
        lmtp      unix  -       -       -       -       -       lmtp
          -o lmtp_header_checks=pcre:/etc/postfix/x-remove-envelope-to

Yes, I add it and then I remove it...

There is another way, isn't it?

Thank you for reading and regards,
André

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to