How do I get EFA to stop altering the message body

Questions and answers about how to do stuff
Post Reply
kris240376
Posts: 10
Joined: 17 Sep 2018 18:56

How do I get EFA to stop altering the message body

Post by kris240376 »

I'm currently trying to get DKIM and S/MIME working at my site and I've managed to isolate an issue with EFA. It seems that EFA is altering the message body of messages passing through it. I've followed the instructions here viewtopic.php?f=14&t=2985 in order to turn off outbound message signing. While the messages aren't signed, the messages still fail DKIM and S/MIME.

I've managed to localize the issue to EFA by doing the following. I sent an S/MIME signed test message to two recipients, one inside the organization and one external to the organization. When comparing the two messages, there are differences.

The following is the (sanitized) message that passed through EFA (MUA -> MTA -> EFA -> Internet). Notice that after the initial address block (the first =C2=A0) there were two newlines inserted into the message. Also, the text/html block seems to have been 'reflowed' and the message lines are longer than the original message. While this doesn't change the message contents or its rendering, it does mess with the S/MIME (and DKIM) signature of the message, causing the recipient MUA to report that the message was tampered with:

Code: Select all

To: xxxxxxxxxx@gmail.com, Xxx Xxxxxx <xxx.xxxxxx@xxxxxxx-xxxxxx.com>
User-Agent: SOGoMail 4.0.4
MIME-Version: 1.0
Date: Tue, 20 Nov 2018 12:39:22 -0600
Subject: Test subject
Message-ID: <2b1e-5bf45500-f-f51ded0@206628022>
X-Forward: 10.3.24.8
From: Xxxxx Xxxxxx <xxxxx.xxxxxx@xxxxxxx-xxxxxx.com>

------=_=-_OpenGroupware_org_NGMime-11038-1542739162.591911-1------
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Content-Length: 216


Test message, test message, test message, test message

--
Xxxxx Xxxxxx
Xxxxxx Xxxxxx & Xxxxxxxxxx
999 X Xxxx Xx, Xxxxxxx, XX 99999
Phone=C2=A0999.999.9999
Fax=C2=A0999.999.9999
Website www.xxxxxxx-xxxxxx.com
=C2=A0



------=_=-_OpenGroupware_org_NGMime-11038-1542739162.591911-1------
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Content-Length: 616

<html>Test message, test message, test message, test message<br /><br />--<=
br /><span style=3D"font-size:14px;"><strong>Xxxxx Xxxxxx</strong></span><b=
r /><span style=3D"font-size:12px;"><span style=3D"color:#990000;"><strong>=
Xxxxxx Xxxxxx &amp; Xxxxxxxxxx</strong></span><br />999 X Xxxx Xx, Xxxxxxx,=
 XX 99999<br /><span style=3D"color:#990000;"><strong>Phone</strong></span>=
&nbsp;999.999.9999<br /><span style=3D"color:#990000;"><strong>Fax</strong>=
</span>&nbsp;999.999.9999<br /><span style=3D"color:#990000;"><strong>Websi=
te</strong></span> www.xxxxxxx-xxxxxx.com</span><br />&nbsp;</html>

------=_=-_OpenGroupware_org_NGMime-11038-1542739162.591911-1--------
The following is the exact same message, but not passed through EFA (MUA -> MTA -> MUA). The recipient MUA reports that the S/MIME signature of the message is correct:

Code: Select all

To: xxxxxxxxxx@gmail.com, "Xxx Xxxxxx" <xxx.xxxxxx@xxxxxxx-xxxxxx.com>
User-Agent: SOGoMail 4.0.4
MIME-Version: 1.0
Date: Tue, 20 Nov 2018 12:39:22 -0600
Subject: Test subject
Message-ID: <2b1e-5bf45500-f-f51ded0@206628022>
X-Forward: 10.3.24.8
From: "Xxxxx Xxxxxx" <xxxxx.xxxxxx@xxxxxxx-xxxxxx.com>

------=_=-_OpenGroupware_org_NGMime-11038-1542739162.591911-1------
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Content-Length: 216


Test message, test message, test message, test message

--
Xxxxx Xxxxxx
Xxxxxx Xxxxxx & Xxxxxxxxxx
999 X Xxxx Xx, Xxxxxxx, XX 99999
Phone=C2=A0999.999.9999
Fax=C2=A0999.999.9999
Website www.xxxxxxx-xxxxxx.com
=C2=A0

------=_=-_OpenGroupware_org_NGMime-11038-1542739162.591911-1------
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Content-Length: 616

<html>Test message, test message, test message, test message<br /><br /=
>--<br /><span style=3D"font-size:14px;"><strong>Xxxxx Xxxxxx</strong><=
/span><br /><span style=3D"font-size:12px;"><span style=3D"color:#99000=
0;"><strong>Xxxxxx Xxxxxx &amp; Xxxxxxxxxx</strong></span><br />999 X X=
xxx Xx, Xxxxxxx, XX 99999<br /><span style=3D"color:#990000;"><strong>P=
hone</strong></span>&nbsp;999.999.9999<br /><span style=3D"color:#99000=
0;"><strong>Fax</strong></span>&nbsp;999.999.9999<br /><span style=3D"c=
olor:#990000;"><strong>Website</strong></span> www.xxxxxxx-xxxxxx.com</=
span><br />&nbsp;</html>

------=_=-_OpenGroupware_org_NGMime-11038-1542739162.591911-1--------
I'm not even sure what is altering the message body at this point. I was wondering if anyone else has had this issue and how they solved it. Thanks.
User avatar
shawniverson
Posts: 3649
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: How do I get EFA to stop altering the message body

Post by shawniverson »

The good news is that I ran this sample through my development environment and the problem did not appear.

I had to add Content-Type: multipart/alternative; boundary="----=_=-_OpenGroupware_org_NGMime-11038-1542739162.591911-1------" to complete the sample, just to be sure.

The bad news that the environment is eFa4, so I need to get eFa4 out the door soon.

It is probably a MailScanner bug, but not sure where along the way it may have been fixed...
kris240376
Posts: 10
Joined: 17 Sep 2018 18:56

Re: How do I get EFA to stop altering the message body

Post by kris240376 »

Thanks for the reply. Sorry about that, completely forgot to capture the multipart/alternative; boundary line in my original message.

I'll hold off on the DKIM and S/MIME until eFa4.

Thanks for your work on the project.
Post Reply