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-131) MimeMessageParser not able to read the inline attachments.
Date Mon, 19 Aug 2013 19:41:48 GMT

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

Thomas Neidhart commented on EMAIL-131:
---------------------------------------

The Content-Disposition header is not yet taken into account. If there is no text body, your
(plain text) attachment would be treated as the body content.

It looks like that most of the email clients/libs will at least include an empty mime part
as body, but it would make sense to treat your case correctly too.
                
> MimeMessageParser not able to read the inline attachments.
> ----------------------------------------------------------
>
>                 Key: EMAIL-131
>                 URL: https://issues.apache.org/jira/browse/EMAIL-131
>             Project: Commons Email
>          Issue Type: Bug
>    Affects Versions: 1.3.1
>            Reporter: Raju Y
>            Priority: Critical
>
> Hi All,
> I am trying to extract attachments using MimeMessageParser. But unable to extract the
attachment when i have mime part as below 
> Content-Type: text/plain; charset=us-ascii;
>         name="abc.txt"
> Content-Transfer-Encoding: 7bit
> Content-Disposition: attachment;
>         filename="abc.txt"
> After looking into parse method, 
> ======
>     protected void parse(Multipart parent, MimePart part)
>         throws MessagingException, IOException
>     {
>         if (part.isMimeType("text/plain") && (plainContent == null))
>         {
>             plainContent = (String) part.getContent();
>         }
>         else
>         {
>             if (part.isMimeType("text/html") && (htmlContent == null))
>             {
>                 htmlContent = (String) part.getContent();
>             }
>             else
>             {
>                 if (part.isMimeType("multipart/*"))
>                 {
>                     this.isMultiPart = true;
>                     Multipart mp = (Multipart) part.getContent();
>                     int count = mp.getCount();
>                     // iterate over all MimeBodyPart
>                     for (int i = 0; i < count; i++)
>                     {
>                         parse(mp, (MimeBodyPart) mp.getBodyPart(i));
>                     }
>                 }
>                 else
>                 {
>                     this.attachmentList.add(createDataSource(parent, part));
>                 }
>             }
>         }
>     }
> ====
> so attachment is going to plainContent
> Can anybody please let me know. how can this going to work
> Do we need to consider Content-Disposition ? According to java mail documentation
> Thanks,
> Raju

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message