You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Suvega Srinivasan (NCS)" <su...@ncs.com.sg> on 2015/11/23 05:46:43 UTC

James Mail Server: unable to process message with attachment Content-Disposition issue (creation-date)

Hi James Mail Server Team,

I wanted to submit an issue specific to James mail Server message processing. I'm very sorry, If I have posted to the wrong group or email. Please reply if this is the relevant group else, please let me know correct email/web link to post my query. Your help on my issue is highly appreciated.

Issue Description:
Our James mail server (2.3.2) was unable to process a mime message that had attachment with Content-Disposition issue. The creation-date of mime message from an external mail server doesn't have the quoted string and was not adhering to RFC 2183<http://www.ietf.org/rfc/rfc2183.txt>. The message/attachment header dates are not encapsulated in quotes. Is there a fix for James to resolve the issue at James Server side to process or add the quoted string to Content-Disposition parameter values.

Other Findings:
This message sent from an external email server was well received and processed by other email servers including MS Outlook exchange server. Since email is failing in James alone, we wanted to know if there is a workaround/fix available for James mail server to overcome this issue and process the message.

Mail Server environment Information:
OS Name:            Microsoft Windows Server 2012 R2 Standard
System Type:     x64-based PC
JRE:                        1.7.0_75
James Version: james-2.3.2

Error message in James Mailet log:
04/11/15 15:34:32 INFO  James.Mailet: recepientFlag are: false
04/11/15 15:34:32 INFO  James.Mailet: AttachmentFileNameIs: Malformed message
javax.mail.internet.ParseException: Expected ';', got ","
                at javax.mail.internet.ParameterList.<init>(ParameterList.java:281)
                at javax.mail.internet.ContentDisposition.<init>(ContentDisposition.java:100)
                at javax.mail.internet.MimeBodyPart.getFileName(MimeBodyPart.java:1145)
                at javax.mail.internet.MimeBodyPart.getFileName(MimeBodyPart.java:528)
                at org.apache.james.transport.matchers.AttachmentFileNameIs.matchFound(AttachmentFileNameIs.java:183)


Mime Message with issue, attachment content disposition:
Content-Disposition: attachment;
                filename="8_pdfsam_2015.10.27 NCSU Blue Certificates 1-41.pdf";
                size=1195923;
                creation-date=Mon, 02 Nov 2015 02:29:07 GMT;
                modification-date=Mon, 02 Nov 2015 02:29:07 GMT
Content-ID: <D9...@fpg.local>>
Content-Transfer-Encoding: base64

For your understanding of my issue, the correct format of attachment content-disposition:
Content-Disposition: attachment; filename=&quot;repDwnload.txt&quot;; size=794;
                creation-date=&quot;Wed, 28 Oct 2015 05:27:20 GMT&quot;;
                modification-date=&quot;Wed, 28 Oct 2015 05:27:20 GMT&quot;
Content-Transfer-Encoding: base64

Thanks and Regards,
Suvega S
Mob# +65-9181-8874


RE: James Mail Server: unable to process message with attachment Content-Disposition issue (creation-date)

Posted by "Suvega Srinivasan (NCS)" <su...@ncs.com.sg>.
Hi Bernd,

Thanks for your response and the information. I would check your post and detail, would update you on the progress.

Regards,
Suvega S
Mob# +65-9181-8874

-----Original Message-----
From: Bernd Waibel [mailto:BWaibel@intarsys.de] 
Sent: Monday, 23 November, 2015 3:57 PM
To: James Developers List
Subject: AW: James Mail Server: unable to process message with attachment Content-Disposition issue (creation-date)

Hello Suvega,

as I understand, your problems are the missing " in creation-date and modification-date.
We do have this problem with wrong attachments headers in our James 2.3.2 on our production site, too, but till now only in Spam mails, so ignored till now.

This is an issue inside the mail.jar from Sun/Oracle. The parsing of the MimeBodyPart fails here. 
But there are some options to configure the parsing of mail.jar. See my post here:
http://mail-archives.apache.org/mod_mbox/james-server-user/201501.mbox/%3C81599922b50b465e9b3415210e747b42@exchange.is.intarsys.de%3E
For additional information about the options see here: https://docs.oracle.com/javaee/6/api/javax/mail/internet/package-summary.html

The mail.jar released with James 2.3.2 is Version 1.4.1. So you need options which work with 1.4.1.
Not all configuration options (I mentioned in my post) are available in this version, so you may think about replacing the mail.jar with the newest Version 1.4.7.
I am not sure if this would have side effects, we did it, but we did some changes in james 2.3.2 too (internally needed by our code).
If you do a replacement of the mail.jar, have a look if the mails are stored in the mail boxes, not sure if this will race problems.
There is also a 1.5.4 Version, but I never had a look at it.
See: http://www.oracle.com/technetwork/java/index-138643.html

I would recommend: start james with all options mentioned in my post (/var/james-2.3.2/bin/phoenix.sh).
If this will not work, try the options AND replace the mail.jar with mail.jar Version 1.4.7.

In our own code, we have a workaround for managing this:
Every time we try to read the ContentType, we do not use "part.getContentType()", we just use "part.getHeader("Content-Type").
By doing this, the ParameterList will not been parsed, and we do not need the ParameterList (in our code).
So if this happens in your own code (if you have own code, a mailet you have written or so), you may think about handling this on your own.


Regards
Bernd Waibel

-----Ursprüngliche Nachricht-----
Von: Suvega Srinivasan (NCS) [mailto:suvegas@ncs.com.sg] 
Gesendet: Montag, 23. November 2015 05:47
An: server-dev@james.apache.org
Betreff: James Mail Server: unable to process message with attachment Content-Disposition issue (creation-date)

Hi James Mail Server Team,

I wanted to submit an issue specific to James mail Server message processing. I'm very sorry, If I have posted to the wrong group or email. Please reply if this is the relevant group else, please let me know correct email/web link to post my query. Your help on my issue is highly appreciated.

Issue Description:
Our James mail server (2.3.2) was unable to process a mime message that had attachment with Content-Disposition issue. The creation-date of mime message from an external mail server doesn't have the quoted string and was not adhering to RFC 2183<http://www.ietf.org/rfc/rfc2183.txt>. The message/attachment header dates are not encapsulated in quotes. Is there a fix for James to resolve the issue at James Server side to process or add the quoted string to Content-Disposition parameter values.

Other Findings:
This message sent from an external email server was well received and processed by other email servers including MS Outlook exchange server. Since email is failing in James alone, we wanted to know if there is a workaround/fix available for James mail server to overcome this issue and process the message.

Mail Server environment Information:
OS Name:            Microsoft Windows Server 2012 R2 Standard
System Type:     x64-based PC
JRE:                        1.7.0_75
James Version: james-2.3.2

Error message in James Mailet log:
04/11/15 15:34:32 INFO  James.Mailet: recepientFlag are: false
04/11/15 15:34:32 INFO  James.Mailet: AttachmentFileNameIs: Malformed message
javax.mail.internet.ParseException: Expected ';', got ","
                at javax.mail.internet.ParameterList.<init>(ParameterList.java:281)
                at javax.mail.internet.ContentDisposition.<init>(ContentDisposition.java:100)
                at javax.mail.internet.MimeBodyPart.getFileName(MimeBodyPart.java:1145)
                at javax.mail.internet.MimeBodyPart.getFileName(MimeBodyPart.java:528)
                at org.apache.james.transport.matchers.AttachmentFileNameIs.matchFound(AttachmentFileNameIs.java:183)


Mime Message with issue, attachment content disposition:
Content-Disposition: attachment;
                filename="8_pdfsam_2015.10.27 NCSU Blue Certificates 1-41.pdf";
                size=1195923;
                creation-date=Mon, 02 Nov 2015 02:29:07 GMT;
                modification-date=Mon, 02 Nov 2015 02:29:07 GMT
Content-ID: <D9...@fpg.local>>
Content-Transfer-Encoding: base64

For your understanding of my issue, the correct format of attachment content-disposition:
Content-Disposition: attachment; filename=&quot;repDwnload.txt&quot;; size=794;
                creation-date=&quot;Wed, 28 Oct 2015 05:27:20 GMT&quot;;
                modification-date=&quot;Wed, 28 Oct 2015 05:27:20 GMT&quot;
Content-Transfer-Encoding: base64

Thanks and Regards,
Suvega S
Mob# +65-9181-8874


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


AW: James Mail Server: unable to process message with attachment Content-Disposition issue (creation-date)

Posted by Bernd Waibel <BW...@intarsys.de>.
Hello Suvega,

as I understand, your problems are the missing " in creation-date and modification-date.
We do have this problem with wrong attachments headers in our James 2.3.2 on our production site, too, but till now only in Spam mails, so ignored till now.

This is an issue inside the mail.jar from Sun/Oracle. The parsing of the MimeBodyPart fails here. 
But there are some options to configure the parsing of mail.jar. See my post here:
http://mail-archives.apache.org/mod_mbox/james-server-user/201501.mbox/%3C81599922b50b465e9b3415210e747b42@exchange.is.intarsys.de%3E
For additional information about the options see here: https://docs.oracle.com/javaee/6/api/javax/mail/internet/package-summary.html

The mail.jar released with James 2.3.2 is Version 1.4.1. So you need options which work with 1.4.1.
Not all configuration options (I mentioned in my post) are available in this version, so you may think about replacing the mail.jar with the newest Version 1.4.7.
I am not sure if this would have side effects, we did it, but we did some changes in james 2.3.2 too (internally needed by our code).
If you do a replacement of the mail.jar, have a look if the mails are stored in the mail boxes, not sure if this will race problems.
There is also a 1.5.4 Version, but I never had a look at it.
See: http://www.oracle.com/technetwork/java/index-138643.html

I would recommend: start james with all options mentioned in my post (/var/james-2.3.2/bin/phoenix.sh).
If this will not work, try the options AND replace the mail.jar with mail.jar Version 1.4.7.

In our own code, we have a workaround for managing this:
Every time we try to read the ContentType, we do not use "part.getContentType()", we just use "part.getHeader("Content-Type").
By doing this, the ParameterList will not been parsed, and we do not need the ParameterList (in our code).
So if this happens in your own code (if you have own code, a mailet you have written or so), you may think about handling this on your own.


Regards
Bernd Waibel

-----Ursprüngliche Nachricht-----
Von: Suvega Srinivasan (NCS) [mailto:suvegas@ncs.com.sg] 
Gesendet: Montag, 23. November 2015 05:47
An: server-dev@james.apache.org
Betreff: James Mail Server: unable to process message with attachment Content-Disposition issue (creation-date)

Hi James Mail Server Team,

I wanted to submit an issue specific to James mail Server message processing. I'm very sorry, If I have posted to the wrong group or email. Please reply if this is the relevant group else, please let me know correct email/web link to post my query. Your help on my issue is highly appreciated.

Issue Description:
Our James mail server (2.3.2) was unable to process a mime message that had attachment with Content-Disposition issue. The creation-date of mime message from an external mail server doesn't have the quoted string and was not adhering to RFC 2183<http://www.ietf.org/rfc/rfc2183.txt>. The message/attachment header dates are not encapsulated in quotes. Is there a fix for James to resolve the issue at James Server side to process or add the quoted string to Content-Disposition parameter values.

Other Findings:
This message sent from an external email server was well received and processed by other email servers including MS Outlook exchange server. Since email is failing in James alone, we wanted to know if there is a workaround/fix available for James mail server to overcome this issue and process the message.

Mail Server environment Information:
OS Name:            Microsoft Windows Server 2012 R2 Standard
System Type:     x64-based PC
JRE:                        1.7.0_75
James Version: james-2.3.2

Error message in James Mailet log:
04/11/15 15:34:32 INFO  James.Mailet: recepientFlag are: false
04/11/15 15:34:32 INFO  James.Mailet: AttachmentFileNameIs: Malformed message
javax.mail.internet.ParseException: Expected ';', got ","
                at javax.mail.internet.ParameterList.<init>(ParameterList.java:281)
                at javax.mail.internet.ContentDisposition.<init>(ContentDisposition.java:100)
                at javax.mail.internet.MimeBodyPart.getFileName(MimeBodyPart.java:1145)
                at javax.mail.internet.MimeBodyPart.getFileName(MimeBodyPart.java:528)
                at org.apache.james.transport.matchers.AttachmentFileNameIs.matchFound(AttachmentFileNameIs.java:183)


Mime Message with issue, attachment content disposition:
Content-Disposition: attachment;
                filename="8_pdfsam_2015.10.27 NCSU Blue Certificates 1-41.pdf";
                size=1195923;
                creation-date=Mon, 02 Nov 2015 02:29:07 GMT;
                modification-date=Mon, 02 Nov 2015 02:29:07 GMT
Content-ID: <D9...@fpg.local>>
Content-Transfer-Encoding: base64

For your understanding of my issue, the correct format of attachment content-disposition:
Content-Disposition: attachment; filename=&quot;repDwnload.txt&quot;; size=794;
                creation-date=&quot;Wed, 28 Oct 2015 05:27:20 GMT&quot;;
                modification-date=&quot;Wed, 28 Oct 2015 05:27:20 GMT&quot;
Content-Transfer-Encoding: base64

Thanks and Regards,
Suvega S
Mob# +65-9181-8874


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org