#38 Attach message/rfc822 .eml file base64 encoded

open
nobody
None
5
2012-11-19
2012-11-19
Marco Ceca
No

I use Blat 3.07 to send a .eml file as attachment (-attach option) from Windows XP.
Resulting email has an attachment like this:
Content-Type: message/rfc822;
name="my_email.eml"
Content-Transfer-Encoding: BASE64
Content-Disposition: ATTACHMENT;
filename="my_email.eml"
[...]

trying to open that attachment from ThunderBird 16.0.2 gives me an error (attach looks empty).
I found that editing the content type to application/octet-stream solves the problem.
rfc2046 states (page 28, par 5.2.1)
No encoding other than "7bit", "8bit", or "binary" is permitted for the body of a "message/rfc822" entity

.eml files should be marked as message/rfc822 (as far as i know).
maybe Blat should send it using the 7bit encoding option instead of base64 if the content type is rfc822.
Outlook can open both emails with no problems, but it looks like Blat is composing the email in a non-standard way

Discussion

  • Chip

    Chip - 2012-11-19

    Blat's headers are RFC 2045 compliant. Unfortunately, Thunderbird has a one line error in their source that is expecting "BASE64" to be lowercase, while the RFC says the text is allowed to be any case (upper, lower, mixed) equally. This bug in Thunderbird has already been reported to their Bugzilla.
    https://bugzilla.mozilla.org/show_bug.cgi?id=805620

     
  • Marco Ceca

    Marco Ceca - 2012-11-19

    You are right (I was the one reporting that bug here).
    But this time it's different.
    Even using the lower case base64 the message/rfc822 can't be opened with TB.
    Is there a way to specify a differnt content type or encoding before sending the email?
    I'm attaching 2 eml files to this support request:
    - test_eml_application (works well in TB)
    - test_eml_message (gives the error attachment is empty)

     
  • Chip

    Chip - 2012-11-19

    Have posted to mozillazine with your concerns?

     
  • Marco Ceca

    Marco Ceca - 2012-11-19

    No I didn't.
    I thought it was blat related because reading the rfc2046 I understand that there should not be a message/rfc822 attachment encoded using base64. If this is right TB does nothing wrong.
    I know a very little about all of these, I'm just trying to understand this damn MIME.
    If I'm wrong please tell me and I'll post to them too

     
  • Chip

    Chip - 2012-11-20

    If you want to sent text files, which .eml files ought to be, then you can use the -attachT option instead of -attach. The -attachT option says that the attachment file is text, while -attach says the attachment file is binary.

    What does your command line look like?

     
  • Chip

    Chip - 2012-11-20
     
  • Chip

    Chip - 2012-11-20

    Check the attached test_output.rar with your copy of Thunderbird. Does TB render it properly?

    Chip

     
  • Marco Ceca

    Marco Ceca - 2012-11-20

    I am using -html and -attach options.
    I have to use -html because i need to use html in the body of the message.
    Your file works good, what options have you used to get this?
    If I use -attachT option I can open the attached .eml file, but it doesn't contain the original message, it looks like it gets corrupted
    -attachi brings to similar results

     
  • Chip

    Chip - 2012-11-27

    I made changes in Blat to look for "Content-Type" of "message/rfc822" when querying the Windows registry for a filename's extension type. If this type is found, then the attachment will be sent as a text attachment instead of binary, and will use "Content-Type: message/rfc822" in Blat's headers. This change is going into version 3.1.0.

    Chip

     
  • Marco Ceca

    Marco Ceca - 2012-11-28

    Great, thank you!

     

Log in to post a comment.