I don't think such a message is legal, and we might be better off
rejecting it. IIRC, a MESSAGE/RFC822 part MUST contain at least one of
From, Subject, or Date...
Yes, Section 5.2.1 of RFC2046 states exactly this, so the message that
we are trying to accommodate is not MIME compliant. Your fix might be
correct (I haven't thought too hard about it yet), but I wonder if its
the best solution.
Bron Gondwana wrote:
Hi Ken,
Can you please check over this...
Basically, we had an issue where messages with dodgy RFC822 parts
caused the index "size" field to be smaller than the actual bytes
on disk. I tracked it down to the code in message_parse_body
overwriting the boundary_size calcluated by message_parse_headers
if it saw the boundary.
I believe the attached patch solves it (it certainly fixed the
index records on reconstruct with the two cases I had available
to me) - but I want a second opinion to make sure it's the right
thing before I push it to CVS!
Basically, I move all the size calculations inside the path where
sawboundary is false - strictly the others could be outside, but
the content_size and header_size of the empty subpart will always
be zero anyway, so I figure it's neater this way.
Patch attached - block of example message inline:
Content-Type: multipart/mixed;
boundary="=_e0a547e213a58487e1d8e0e78e379ebc"
X-Truedomain-SPF: Pass
X-Truedomain-DKIM: Pass
X-Truedomain-Domain: rediffmail.com
X-Truedomain: Neutral
--=_e0a547e213a58487e1d8e0e78e379ebc
Content-Type: multipart/alternative;
boundary="=_438996329c0786397ec784a558fa9bcc"
--=_438996329c0786397ec784a558fa9bcc
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="UTF-8"
Note: Forwarded message attached
-- Original Message --
Subject:
--=_438996329c0786397ec784a558fa9bcc
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="UTF-8"
Note: Forwarded message attached<br />
<br />
-- Original Message --<br />
<br />
Subject: <br><Table border=3D0 Width=3D644 Height=3D57 cellspacing=3D0 cell=
padding=3D0 style=3D"font-family:Verdana;font-size:11px;line-height:15px;">=
<TR><td><A HREF=3D"http://sigads.rediff.com/RealMedia/ads/click_nx.ads/www.=
rediffmail.com/signatureline....@middle?" target=3D"_blank"><IMG SRC=3D"htt=
p://sigads.rediff.com/RealMedia/ads/adstream_nx.ads/www.rediffmail.com/sign=
atureline....@middle"></A></td></TR></Table>
--=_438996329c0786397ec784a558fa9bcc--
--=_e0a547e213a58487e1d8e0e78e379ebc
Content-Transfer-Encoding:
Content-Type: message/rfc822;
name="ForwardedMessage";
Content-Disposition: inline;
filename="ForwardedMessage";
--=_e0a547e213a58487e1d8e0e78e379ebc--
--
Kenneth Murchison
Systems Programmer
Project Cyrus Developer/Maintainer
Carnegie Mellon University