On 7 Jun 2016, at 11:48, Luca Fornasari wrote:
On Tue, Jun 7, 2016 at 5:18 PM, Wietse Venema <wie...@porcupine.org>
wrote:
[...]
You could use an SMTP-based filter that adds a blank after a boundary
line. Google for smtpprox, and configure it as a Postfix
smtpd_proxy_filter
Better, give it to the folks up-streeam who produce the malformed
email, and ask that they send their mail through it.
Thanks Wietse for your precious help.
I'm hesitant to disagree with Wietse, but as I read the MIME
specification it seems to me that the missing blank line is *before* the
boundary line. If you add a blank line *after* the boundary you are
making the MIME headers that follow just regular body data. As RFC1521
S.7.2.1 says:
[...] the initial CRLF is considered to be attached to the
encapsulation boundary
rather than part of the preceding part. The boundary must be followed
immediately
either by another CRLF and the header fields for the next part, or by
two CRLFs,
in which case there are no header fields for the next part (and it is
therefore
assumed to be of Content-Type text/plain).
NOTE: The CRLF preceding the encapsulation line is conceptually
attached to the boundary so that it is possible to have a part
that does not end with a CRLF (line break). Body parts that must
be considered to end with line breaks, therefore, must have two
CRLFs preceding the encapsulation line, the first of which is
part
of the preceding body part, and the second of which is part of
the
encapsulation boundary.
So if you had an idiosyncratic boundary string from whatever your
problem source is (so that you could write a regular expression sure to
match nothing else) AND if you can figure out a way to get body_checks
to PREPEND a blank line, that could be a solution. However, I have tried
everything obvious and even some unobvious things and cannot get PREPEND
to just insert a line break as needed for it to be a solution.