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-134) TXT-Attachment disappeared
Date Wed, 09 Oct 2013 14:28:42 GMT

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

Thomas Neidhart commented on EMAIL-134:
---------------------------------------

This looks like a duplicate of EMAIL-131, which has already fixed in trunk.

Could you please try it with the latest trunk and report if it also fixes your problem?

Otherwise, please attach the eml file of the mail to be parsed.

> 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.
>         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