commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raju Y (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (EMAIL-131) MimeMessageParser not able to read the inline attachments.
Date Tue, 13 Aug 2013 05:51:01 GMT

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

Raju Y updated EMAIL-131:
-------------------------

    Description: 
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

  was:
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, 
======
170    protected void parse(Multipart parent, MimePart part)
171        throws MessagingException, IOException
172    {
173        if (part.isMimeType("text/plain") && (plainContent == null))
174        {
175            plainContent = (String) part.getContent();
176        }
177        else
178        {
179            if (part.isMimeType("text/html") && (htmlContent == null))
180            {
181                htmlContent = (String) part.getContent();
182            }
183            else
184            {
185                if (part.isMimeType("multipart/*"))
186                {
187                    this.isMultiPart = true;
188                    Multipart mp = (Multipart) part.getContent();
189                    int count = mp.getCount();
190
191                    // iterate over all MimeBodyPart
192
193                    for (int i = 0; i < count; i++)
194                    {
195                        parse(mp, (MimeBodyPart) mp.getBodyPart(i));
196                    }
197                }
198                else
199                {
200                    this.attachmentList.add(createDataSource(parent, part));
201                }
202            }
203        }
204    }
====

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

    
> 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