On one of my systems I run a secondary mail server which gets all mail from a primary server. However the primary server has an annoying tendency of attaching text to the end of the mails when forwarding (similar to the "confidentiality notices" you see sometimes).

Since this secondary server is mostly for archival purposes I'd like to get rid of this text. The text is fairly identifiable because it always starts with five dashes at the end of the message.

Is such a thing possible with Postfix or should I do this further downstream (e.g., sieve)?

A few notes about the setup:

  • Postfix
  • Dovecot (1.x) with virtual mailboxes
  • Amavisd + Spamassassin for spam / virus checking
  • openDKIM for DKIM checking
  • Sieve enabled

It's my own server so I can modify whatever configuration as needed.


Personally I would do it by modifying my custom "before_send" hook in Amavis config (just because I am using it already). Another (easier?) option would be to replace dovecot-lda in Postfix config with your own simple script which would take the message text from stdin, filter out the lines you don't want and send the result to the real dovecot-lda.

| improve this answer | |

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.