I'm having a serious issue with certain mails. And this is manifesting itself in versions from cca. 5.0.18 until 6.0.6. The problem is that when a users sends an email, the attachment is received either stripped or incomplete, or the mail is quarantined without any notification. In the log files I found the following error messages related to this behavior:
Jun 9 08:22:15 mail amavis: (29212-07) Checking: WpwkNKa1zI0Z [18.104.22.168] <firstname.lastname@example.org> -> <email@example.com>,<firstname.lastname@example.org>,<ghi@
Jun 9 08:22:15 mail amavis: (29212-07) WARN: MIME::Parser error: part did not end with expected boundary
Jun 9 08:22:15 mail amavis: (29212-07) local delivery: <> -> bad-header-quarantine, mbx=/opt/zimbra/data/amavisd/quarantine/badh-WpwkNKa1zI0Z
After some investigation I found out that the problem is with email messages that have lines which end with a dot, e.g.
This is a line that has 74 characters and ends in a dot.
Email client is encoding those lines in the following way:
This is a line that has 74 characters and ends in a dot=
But for some reason, one dot is then lost and the line translates into end of the message in the SMTP dialog (single dot in a line)!
For a record, I'm using altermime, but I doubt it's altermime's bug. I did the following experiments, all of which produced the error:
1. Using Webmail and sending mail to a local account
2. Using fat client and sending mail to a local account
3. Sending using foreign mail account to a local mail account. In this case altermime is not invoked.
So, it seems bug is somewhere in postfix. The file I'm using for tests is not for public and I tried to modify it so that I can publish it. But it seems that this particular error occurs only in a specific situations.
Note also that this error is dangerous because neither recipient nor sender receive any error message when the mail is discarded due to this bug.