<div dir="ltr">Removed FixSubstringBoundaries for next release.  The problem has long since been resolved and this workaround is no longer necessary.  I left the code commented for future reference.</div><br><div class="gmail_quote"><div dir="ltr">On Wed, Dec 5, 2018 at 11:53 AM Shawn Iverson <<a href="mailto:iversons@rushville.k12.in.us">iversons@rushville.k12.in.us</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I'll take a deep dive hopefully tonight or tomorrow.  I'm not sure that function is even relevant any more...</div><br><div class="gmail_quote"><div dir="ltr">On Wed, Dec 5, 2018 at 11:33 AM Radoslav Bodó <<a href="mailto:bodik@cesnet.cz" target="_blank">bodik@cesnet.cz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
after the latest upgrade of our server from MailScanner 4 to 5.1.2 we<br>
have identified that FixSubstringBoundaries is not working properly.<br>
<br>
<br>
<br>
Currently:<br>
<br>
* the function FixSubstringBoundaries(...) updates the body and headers<br>
in the processed $message structure, but final delivered message<br>
contains original non-updated Conten-Type boundary header<br>
<br>
* that renders updated messages unusable on the server/client side. In<br>
some cases the messages are just not properly displayed (roundcube), in<br>
some other cases might be deleted silently on the background by the<br>
client (thunderbird).<br>
<br>
* possibly corrupted messages can be identified from the logs by<br>
'Content Checks: Fixed awkward MIME boundary for Cyrus IMAP server'<br>
<br>
<br>
<br>
System affected:<br>
<br>
        debian 9.5 stretch<br>
        postfix 3.1.8-0+deb9u1<br>
        mailscanner 5.1.2-2<br>
        perl 5.24.1-3+deb9u4<br>
        libmime-tools-perl 5.508-1<br>
<br>
<br>
<br>
The attachments of this message contains data for reproducing the issue:<br>
<br>
* mailboundary1.txt            .. test message to reproduce<br>
* mailboundary1-corrupted.txt  .. resulting message documenting the fail<br>
* sendmail.py                  .. testing helper<br>
<br>
cat /tmp/mailboundary1.txt | /tmp/sendmail.py --sender<br>
s@webmail-test.redacted --to s@webmail-test.redacted --raw<br>
<br>
<br>
<br>
<br>
<br>
The only workaround I've been able to come up is to disable the feature<br>
in the code by commenting out<br>
<br>
<a href="https://github.com/MailScanner/v5/blob/master/common/usr/share/MailScanner/perl/MailScanner/SweepContent.pm#L215" rel="noreferrer" target="_blank">https://github.com/MailScanner/v5/blob/master/common/usr/share/MailScanner/perl/MailScanner/SweepContent.pm#L215</a><br>
<br>
for the time being.<br>
<br>
<br>
<br>
<br>
I've tried to track down message processing down to<br>
<br>
<a href="https://github.com/MailScanner/v5/blob/master/common/usr/share/MailScanner/perl/MailScanner/Message.pm#L5348" rel="noreferrer" target="_blank">https://github.com/MailScanner/v5/blob/master/common/usr/share/MailScanner/perl/MailScanner/Message.pm#L5348</a><br>
<br>
but since my knowledge of mailscanner and postfix internals are poor<br>
I've got lost in DeliverModifiedBody(...)<br>
<br>
<br>
<br>
Any help or idea would be highly appreciated.<br>
<br>
Thank you<br>
bodik<br>
<br>
<br>
-- <br>
MailScanner mailing list<br>
<a href="mailto:mailscanner@lists.mailscanner.info" target="_blank">mailscanner@lists.mailscanner.info</a><br>
<a href="http://lists.mailscanner.info/mailman/listinfo/mailscanner" rel="noreferrer" target="_blank">http://lists.mailscanner.info/mailman/listinfo/mailscanner</a><br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_-113052088085471541gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr">Shawn Iverson, CETL<div>Director of Technology</div><div>Rush County Schools</div><div>765-932-3901 option 7</div><div><a href="mailto:iversons@rushville.k12.in.us" target="_blank">iversons@rushville.k12.in.us</a></div><div><br></div><div><img src="https://docs.google.com/uc?export=download&id=0Bw5iD0ToYvs_cy1OZFNIZ0drYVU&revid=0Bw5iD0ToYvs_UitIcHVIWkJVVTl2VGpxVUE0d0FQcHBIRXk4PQ" width="96" height="96" style="font-size: 12.8px;"><img src="https://docs.google.com/uc?export=download&id=0Bw5iD0ToYvs_Zkh4eEs3R01yWXc&revid=0Bw5iD0ToYvs_QWpBK2Y2ajJtYjhOMDRFekZwK2xOamk5Q3Y0PQ" width="89" height="96"></div><div><img src="https://docs.google.com/uc?export=download&id=1aBrlQou4gjB04FY-twHN_0Dn3GHVNxqa&revid=0Bw5iD0ToYvs_RnQ0eDhHcm95WHBFdkNRbXhQRXpoYkR6SEEwPQ" style="font-size: 12.8px;"><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr">Shawn Iverson, CETL<div>Director of Technology</div><div>Rush County Schools</div><div>765-932-3901 option 7</div><div><a href="mailto:iversons@rushville.k12.in.us" target="_blank">iversons@rushville.k12.in.us</a></div><div><br></div><div><img src="https://docs.google.com/uc?export=download&id=0Bw5iD0ToYvs_cy1OZFNIZ0drYVU&revid=0Bw5iD0ToYvs_UitIcHVIWkJVVTl2VGpxVUE0d0FQcHBIRXk4PQ" width="96" height="96" style="font-size: 12.8px;"><img src="https://docs.google.com/uc?export=download&id=0Bw5iD0ToYvs_Zkh4eEs3R01yWXc&revid=0Bw5iD0ToYvs_QWpBK2Y2ajJtYjhOMDRFekZwK2xOamk5Q3Y0PQ" width="89" height="96"></div><div><img src="https://docs.google.com/uc?export=download&id=1aBrlQou4gjB04FY-twHN_0Dn3GHVNxqa&revid=0Bw5iD0ToYvs_RnQ0eDhHcm95WHBFdkNRbXhQRXpoYkR6SEEwPQ" style="font-size: 12.8px;"><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>