You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Thomas Neidhart (JIRA)" <ji...@apache.org> on 2013/10/24 22:10:06 UTC

[jira] [Closed] (EMAIL-131) MimeMessageParser not able to read the inline attachments.

     [ https://issues.apache.org/jira/browse/EMAIL-131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Neidhart closed EMAIL-131.
---------------------------------


> 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
>             Fix For: 1.3.2
>
>
> 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 was sent by Atlassian JIRA
(v6.1#6144)