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.

3
  • 1
    You may be able to use the header_checks parameter. See Remove headers for an example that may work.
    – Paul
    Dec 22, 2014 at 16:48
  • 1
    There are plenty of questions going in the same direction. What have you tried so far?
    – sebix
    Dec 22, 2014 at 17:02
  • thanks guys, I'll try the "headers_checks" I think this is the best lead so far. Dec 23, 2014 at 7:11

1 Answer 1

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.
2
  • Do you have another recommendation about how this can be done via postfix? Or do I have to create another script to do this prior to sending the mail? Dec 24, 2014 at 8:22
  • I'm afraid I can't help you for this. My postfix experience with header modifications was little. This link in postfix docs wasn't help either. Well, I suggest you to write the your header modification before sending it to postfix :)
    – masegaloeh
    Dec 24, 2014 at 8:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .