2

I want to change the Message-ID header or better yet, discard it. I know everyone is going to ask "Why would you want to do that?" because I know it sounds weird to even write it.

Well I am developing a system that saves an incoming e-mail in EML format, changes it and sends it to the user, at some point the user can request to have the original EML sent to him/her. The issue is that when I re-send the EML it has the same Message-ID header which causes exchange servers to drop the re-send.

Of course I am hoping there is some option through postfix to do this, otherwise I will need to parse and change the EML but I rather not do that.

I tried to do this with "header_checks" and it works BUT I need to be able to do this conditionally, meaning only on a specific occasion, which I can identify by looking at the other headers, I want to remove the Message-ID.

masegaloeh
  • 18,498

1 Answers1

2

I need to be able to do this conditionally, meaning only on a specific occasion, which I can identify by looking at the other headers, I want to remove the Message-ID.

No you can't do it with header_checks. Postfix examines the rules on one header line at a time. In other words, the you can't modify one header line based on another header line. See man 5 header_checks in BUG section and this thread on postfix mailing list.

Many people overlook the main limitations of header and body_checks rules.

  • These rules operate on one logical message header or one body line at a time. A decision made for one line is not carried over to the next line.
masegaloeh
  • 18,498