james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Lee (Created) (JIRA)" <mime4j-...@james.apache.org>
Subject [jira] [Created] (MIME4J-205) Missing MIME-Version Header
Date Sat, 01 Oct 2011 22:44:33 GMT
Missing MIME-Version Header

                 Key: MIME4J-205
                 URL: https://issues.apache.org/jira/browse/MIME4J-205
             Project: JAMES Mime4j
          Issue Type: Bug
          Components: dom
    Affects Versions: 0.7
         Environment: Java 1.5, Windows 7, 64-bit
            Reporter: Robert Lee
            Priority: Minor

When creating a "multipart/mixed" message using the DOM API, no "MIME-Version" header is added
to the message, as is required by RFC 2045 (MIME 1.0) Section 4 for all MIME messages. This
bug even manifests itself with the "MultipartMessage" sample class that Mime4j 0.7 ships with.
Run the example exactly as it exists in the source release and observe that the generated
message does not comply with RFC-2045 (MIME 1.0). The missing header is causing multipart
messages generated by mime4j to be parsed incorrectly by several strict email clients including
the "c-client" PHP extension (used by earlier versions of Horde Groupware, etc...).

The example can be fixed by adding the line (after the setSubject call):

message.getHeader().addField(DefaultFieldParser.parse("MIME-Version: 1.0"));

...but I would recommend that this header be added automatically by MessageImpl's constructor
for all messages since all messages generated by Mime4j are indeed MIME 1.0 messages. This
solution would also address the minor annoyance of MessageImpl's getHeader() method returning
null in certain circumstances.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message