commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (EMAIL-159) Parse exception when parsing the email content
Date Thu, 15 Oct 2015 19:43:05 GMT

    [ https://issues.apache.org/jira/browse/EMAIL-159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14959491#comment-14959491
] 

Thomas Neidhart commented on EMAIL-159:
---------------------------------------

I do not know which mail client created this message, but the content-disposition header is
not correctly contructed (according to the relevant rfc's).

A correct header would look like this:

{noformat}
Content-Disposition: attachment;
      filename*0="=?utf-8?Q?El-d=C3=A9p=C3=B4t_XXX_41=5F2015_-YYYYY";
      filename*1="N.XLS?="
{noformat}

which encodes the following filename: El-dépôt XXX 41_2015 -YYYYYN.XLS

As the content-disposition is ill-formed, java-mail throws an exception, and we can not do
much about (apart from catching the exception when accessing the filename and trying to continue).
I would suggest that you first look into the application/client that produced this email and
try to fix this.

> Parse exception when parsing the email content
> ----------------------------------------------
>
>                 Key: EMAIL-159
>                 URL: https://issues.apache.org/jira/browse/EMAIL-159
>             Project: Commons Email
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: Kushal J
>            Priority: Critical
>
> Hi Team,
> We have an application that reads the email and extracts the attachment from the email.
For certain emails we are seeing below issue, can you please check if anything  missed out
from our side or is it the bug.
> javax.mail-api Version : 1.5.3
> commons-email Version : 1.4
> Email Header information for failure
> Subject: =?utf-8?q?YYYY?=
> =?utf-8?Q?=C3=A9p=C3=B4t_ZZZ_ZZZ_41/2015_-_PPP_XXX?=
> Message-Id: <20151012_101748_C1_00cb45e6_C2_00003011_Name_00013321697@htm-group.com>
> X-Priority: 3
> Importance: Normal
> MIME-Version: 1.0
> Content-Type: multipart/mixed; boundary="=_NextPart_03254=_=63839"
> Content-Transfer-Encoding: 7bit
> Email Header information for Success
> Subject: PPP : Stocks XXX 41/2015 -ZZZZ
> Message-Id: <20151012_104902_C1_00cb854d_C2_00001ddf_Name_00013337928@htm-group.com>
> X-Priority: 3
> Importance: Normal
> MIME-Version: 1.0
> Content-Type: multipart/mixed; boundary="=_NextPart_09373=_=37676"
> Content-Transfer-Encoding: 7bit
> These 2 emails are sent from the same email ID, but we are getting ParseException when
we are trying to parse the above 1st header.
> Exception trace
> javax.mail.internet.ParseException: Expected parameter value, got "="
>         at javax.mail.internet.ParameterList.<init>(ParameterList.java:256)
>         at javax.mail.internet.ContentDisposition.<init>(ContentDisposition.java:100)
>         at javax.mail.internet.MimeBodyPart.getDisposition(MimeBodyPart.java:1085)
>         at javax.mail.internet.MimeBodyPart.getDisposition(MimeBodyPart.java:318)
> Content Disposition Header Info for error email
> --=_NextPart_03254=_=63839
> Content-Type: text/plain;
>  charset=UTF-8
> Content-Transfer-Encoding: QUOTED-PRINTABLE
> Content-Disposition: inline
> Extraction VENTES du 05.10.2015 au 11.10.2015 (semaine 201541 =C3=A0 201541 ).
>                                                                                     
                                                              =
>                                 =20
> --=_NextPart_03254=_=63839
> Content-Type: APPLICATION/OCTET-STREAM;
>  name=
>  =?utf-8?Q?El-d=C3=A9p=C3=B4t_XXX_41=5F2015_-YYYYY?=
>  =?utf-8?Q?N.XLS?=
> Content-Transfer-Encoding: BASE64
> Content-Description: =?utf-8?q?El-d?=
>  =?utf-8?Q?=C3=A9p=C3=B4t_XXX_41=5F2015_-YYYYYN.XLS?=
> Content-Disposition: attachment;
>  filename=
>  =?utf-8?Q?El-d=C3=A9p=C3=B4t_XXX_41=5F2015_-YYYYY?=
>  =?utf-8?Q?N.XLS?=
> Please help us in fixing this issue.
> Regards,
> Kushal J



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message