rjbs / Email-MIME

perl library for parsing MIME messages
20 stars 30 forks source link

Superflours headers added (Date, MIME-Version) to MIME part when created with Email::MIME->create() #16

Open otuschhoff opened 10 years ago

otuschhoff commented 10 years ago

Superflours headers added (Date, MIME-Version) to MIME part when created with Email::MIME->create().

Effects

  $CREATOR->_add_to_header(\$header, Date => $CREATOR->_date_header)
    unless exists $headers{Date};
  $CREATOR->_add_to_header(\$header, 'MIME-Version' => '1.0',);

Example - Broken MIME

From: ...
To: ...
Subject: ...
Date: Fri, 22 Aug 2014 14:01:01 +0000
...
Content-Type: multipart/alternative; boundary="14087160611.664C9Fcf.28775";
 charset="UTF-8"
MIME-Version: 1.0

--14087160611.664C9Fcf.28775
Date: Fri, 22 Aug 2014 16:01:01 +0200

MIME-Version: 1.0

Content-Type: text/plain

...
--14087160611.664C9Fcf.28775
Date: Fri, 22 Aug 2014 16:01:01 +0200

MIME-Version: 1.0

Content-Type: text/html

Workaround

Comment out Lines 199-201 in Email/MIME.pm:

From: ...
To: ...
Subject: ...
Date: Fri, 22 Aug 2014 14:01:01 +0000
...
Content-Type: multipart/alternative; boundary="14087160611.664C9Fcf.28775";
 charset="UTF-8"
MIME-Version: 1.0

--14087178291.E665BBdEa.28858
Content-Type: text/plain

...
--14087178291.E665BBdEa.28858
Content-Type: text/html
sogerc1 commented 9 years ago

I noticed this issue too. What I did was to unset them immediately after creation. Also a a "Content-Transfer-Encoding" is added to multipart MIMEs which is also unnecessary. But other times they are necessary so maybe there should be options to set them or not.

theochino commented 1 year ago

I take this has not been fixed by the maintainer? Same problem.