[imp] malformed MIME

Aleksandar Milivojevic alex at milivojevic.org
Tue May 16 08:34:16 PDT 2006


I've just got a call from one of our users.  In short, our AV scanner  
rejected email generated by IMP 4.1.1 with "malformed MIME".  I took a  
look into the email source (from user's sent mail folder), and indeed  
it was malformed.  I can't attach complete sample since it contained  
sensitive information, however bellow is how the MIME structure that  
IMP generated looked like.  Also, this was one-time thing.  I wasn't  
able to reproduce it, even when following exact steps user did (and  
having user repeat exactly same steps too).  Basically, user simply  
forwarded an existing email.  The email that was being forwarded was  
generated in Thunderbird, and as far as I can tell was properly MIME  
formatted (breakdown of MIME parts for that email also included below).

The MIME stuff in rejected email looked like this.

MIME-Version: 1.0
Content-Type: multipart/mixed;
         boundary="=_osqrpbesn74"
Content-Transfer-Encoding: 7bit

This message is in MIME format.

--=_osqrpbesn74
Content-Type: text/plain;
         charset=ISO-8859-1;
         DelSp="Yes";
         format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

--=_osqrpbesn74
Content-Type: multipart/alternative;
         boundary="------------040408050803060307020705";
         name=""
Content-Transfer-Encoding: 7bit

This message is in MIME format.

--------------040408050803060307020705
Content-Type: text/plain;
         charset=ISO-8859-1;
         format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

--------------040408050803060307020705
Content-Type: text/html;
         charset=ISO-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

--------------040408050803060307020705--

--------------040408050803060307020705
Content-Type: text/plain;
         charset=ISO-8859-1;
         format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

--------------040408050803060307020705
Content-Type: text/html;
         charset=ISO-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

--------------040408050803060307020705--

As can be seen, IMP included two parts under "multipart/alternative"  
two times, generating two ending boundaries for it (one after each set  
of two parts).  When both me and user attempted to reproduce, IMP did  
correct job, including two parts under multipart/alternative only once  
followed by single ending boundary, as it was supposed to do.

The original email (that was being forwarded) had  
multipart/alternative stuff correct (two parts, followed by single  
ending boundary):

MIME-Version: 1.0
Content-Type: multipart/alternative;
  boundary="------------040408050803060307020705"

This is a multi-part message in MIME format.
--------------040408050803060307020705
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

--------------040408050803060307020705
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

--------------040408050803060307020705--

-- 
See Ya' later, alligator!
http://www.8-P.ca/



More information about the imp mailing list