commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olaf K. (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (EMAIL-134) TXT-Attachment disappeared
Date Wed, 09 Oct 2013 14:58:42 GMT

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

Olaf K. closed EMAIL-134.
-------------------------

       Resolution: Duplicate
    Fix Version/s: 1.3.2

Already fixed! As reported. See EMAIL-131.

> TXT-Attachment disappeared
> --------------------------
>
>                 Key: EMAIL-134
>                 URL: https://issues.apache.org/jira/browse/EMAIL-134
>             Project: Commons Email
>          Issue Type: Bug
>    Affects Versions: 1.3.1
>         Environment: Thunderbird, James 3.0 beta4
>            Reporter: Olaf K.
>             Fix For: 1.3.2
>
>         Attachments: javamaildebug.ouput
>
>
> After parsing an HTML-EMail with an txt-Attachment, I receive for 
> parser.getHtmlContent(); -> the html-body -> ok
> parser.getPlainContent() -> the content of the txt-attchment -> nok
> parser.getAttachmentList(); -> empty list -> nok
> I identified the cause of the problem in the class MimiMessageParser.
> {code}
> protected void parse(Multipart parent, MimePart part){
> 		if (part.isMimeType("text/plain") && (plainContent == null) && filename
== null) {
> 			plainContent = (String) part.getContent();
> 		} else {
> 			if (part.isMimeType("text/html") && (htmlContent == null)) {
> 				htmlContent = (String) part.getContent();
> 			} else {
> ...
> {code}
> If the plainContent is not set, then every "text/plain"-type is used for the content.
> My solution looks like this:
> {code}
> 	protected void parse(Multipart parent, MimePart part) throws MessagingException, IOException
{
> 		String filename = part.getFileName();
> 		if (part.isMimeType("text/plain") && (plainContent == null) && filename
== null) {
> 			plainContent = (String) part.getContent();
> 		} else {
> 			if (part.isMimeType("text/html") && (htmlContent == null)) {
> 				htmlContent = (String) part.getContent();
> 			} else {
> ...
> {code}
> Please check this issue.
> Thx in advance.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message