Discussion:
[Pkg-exim4-users] Two Message-ID headers - filter out to only one?
Bruce A. Bergman
2014-09-15 16:31:02 UTC
Permalink
Hello esteemed colleagues! :)

I have a slight issue I thought I would ask about. My exim4 server is
running great, and has been for some time. On that same server, I have a
WordPress website plugin that occasionally sends out an email
notification to users. When it does so, it seems to insert its own
Message-ID header, and that results in two Message-ID headers in the
outgoing message. Some remote mailers will allow that, but many do not.
I typically get:

SMTP error from remote mail server after end of data:
host eforwardxxx.registrar-servers.com [...]:
550 Messages should have one or no Message-ID headers, not 2.

Looking at the outgoing message, I see:

Message-ID: <***@www.example.com> <--
presumably generated by exim4
[...]
Message-Id: <***@www.example.com> <-- WordPress
plugin generated

Is there any rule I can insert that would take one of the Message-ID
headers out of a message before it is sent on? I don't think it really
matters which one is kept... This isn't a big deal; it's really more of
an annoyance than anything, but if I could nix it, I'd be happy. :)

Thanks!
bruce
Andreas Metzler
2014-09-20 16:50:56 UTC
Permalink
On 2014-09-15 "Bruce A. Bergman" <***@fatcity.com> wrote:
[...]
to users. When it does so, it seems to insert its own Message-ID header, and
that results in two Message-ID headers in the outgoing message. Some remote
[...]
presumably generated by exim4
[...]
plugin generated
Is there any rule I can insert that would take one of the Message-ID headers
out of a message before it is sent on? I don't think it really matters which
one is kept... This isn't a big deal; it's really more of an annoyance than
anything, but if I could nix it, I'd be happy. :)
Hello,

Neither of your M-ID headers is generated by exim, the format is not
the one exim would use.
<http://www.exim.org/exim-html-current/doc/html/spec_html/ch-message_processing.html#SECID226>

Also exim should not add a Message-ID if it is missing:
---------------------------------------------------
(SID)***@argenau:/tmp/AUTOGEN/autogen-5.18.4$ cat /tmp/message-with-id
Date: Sat, 20 Sep 2014 18:35:05 +0200
To: ***@localhost
From: ***@bebt.de
Subject: test with ID
Message-ID: <***@midonly.argenau.bebt.
de>

This is a test mailing
(SID)***@argenau:/tmp/AUTOGEN/autogen-5.18.4$ cat /tmp/message-no-id
Date: Sat, 20 Sep 2014 18:35:05 +0200
To: ***@localhost
From: ***@bebt.de
Subject: test without ID - added by exim

This is a test mailing
***@argenau:~/GIT/writing/autogen$ swaks -s localhost -f ***@bebt.de -
t ***@localhost --data /tmp/message-with-id
[...]
***@argenau:~/GIT/writing/autogen$ swaks -s localhost -f ***@bebt.de -
t ***@localhost --data /tmp/message-no-id
[...]
---------------------------------------------------
Which results in these delivered messages:
Subject: test with ID
Message-ID: <***@midonly.argenau.bebt.de>
[...]
Subject: test without ID - added by exim
Message-Id: <E1XVNh8-0001c0-***@midonly.argenau.bebt.de>
---------------------------------------------------

I am sorry that this is not helpful beyond "you need to search
somewhere else".

cu Andreas
--
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'
Bruce A. Bergman
2014-09-22 16:13:42 UTC
Permalink
Thanks Andreas. Actually, WHO put the headers in there is less important
to me than knowing how to get them out. :) I didn't honestly think about
whether exim4 was adding the header or not, or else I would have come to
the same conclusion as you, so thanks for setting that part straight.

However, my main question was (and still is): how I can I get rid of the
excess header? Is there a rule I can create in exim4 that will remove an
extra header of a particular type? If there is, I think that'll be an
excellent way to clean this issue up.

Thanks!
bruce
Post by Andreas Metzler
[...]
to users. When it does so, it seems to insert its own Message-ID
header, and that results in two Message-ID headers in the outgoing
message. Some remote
[...]
generated
Is there any rule I can insert that would take one of the Message-ID
headers out of a message before it is sent on? I don't think it really
matters which one is kept... This isn't a big deal; it's really more
of an annoyance than anything, but if I could nix it, I'd be happy. :)
Hello,
Neither of your M-ID headers is generated by exim, the format is not
the one exim would use.
<http://www.exim.org/exim-html-current/doc/html/spec_html/ch-message_processing.html#SECID226
[1]>
---------------------------------------------------
/tmp/message-with-id
Date: Sat, 20 Sep 2014 18:35:05 +0200
Subject: test with ID
de>
This is a test mailing
/tmp/message-no-id
Date: Sat, 20 Sep 2014 18:35:05 +0200
Subject: test without ID - added by exim
This is a test mailing
[...]
[...]
---------------------------------------------------
Subject: test with ID
[...]
Subject: test without ID - added by exim
---------------------------------------------------
I am sorry that this is not helpful beyond "you need to search
somewhere else".
cu Andreas
--
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'
Links:
------
[1]
http://www.exim.org/exim-html-current/doc/html/spec_html/ch-message_processing.html#SECID226
Andreas Metzler
2014-09-22 17:25:58 UTC
Permalink
Post by Bruce A. Bergman
Thanks Andreas. Actually, WHO put the headers in there is less important
to me than knowing how to get them out. :) I didn't honestly think about
whether exim4 was adding the header or not, or else I would have come to
the same conclusion as you, so thanks for setting that part straight.
[...]

Transports and routers have a "remove_header" seeting [1] [2], and you
can also remove header in ACLs[3].

Please note however that removing Message-ID headers indiscriminately
will break threading for clients.

cu Andreas

[1]
http://www.exim.org/exim-html-current/doc/html/spec_html/ch-generic_options_for_transports.html
[2]
http://www.exim.org/exim-html-current/doc/html/spec_html/ch-generic_options_for_routers.html
[3]
http://www.exim.org/exim-html-current/doc/html/spec_html/ch-access_control_lists.html#SECTremoveheadacl
--
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'
Loading...