Lars Preben S?rsdahl: > What I'm trying to achieve is for Postfix to deliver a copy to a > local IMAP account, and then remove our internal/private headers > before passing the mail on to the relay host. The idea is for some > custom software to read the copy from the IMAP account, using the > interal/private headers for integration with other systems.
Wietse: > Use smtp_header_checks=pcre:/path/to/file to remove the headers > from outbound mail. If you also use LMTP or SMTP to deliver local > IMAP accounts, one extra step is needed. I'm not going to complicate > the solution if this step is not needed. Lars Preben S?rsdahl: > Yes, I'm using LMTP for delivering the bcc copy to an IMAP account, so > please tell me about the extra step. :) > > >From main.cf: > > always_bcc=myaccount > mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp > relayhost=[smtp.sendgrid.net]:587 In that case, it should be safe to have the option in main.cf, because LMTP mail delivery uses lmtp_header_checks instead of smtp_header_checks. /etc/postfix/main.cf: smtp_header_checks = pcre:/path/to/file Wietse