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

Olaf K. commented on EMAIL-133:
-------------------------------

Java DebugOutput
{code}
A7 FETCH 1 (BODYSTRUCTURE)
* 1 FETCH (BODYSTRUCTURE (("TEXT" "PLAIN" ("charset" "us-ascii") NIL NIL "7BIT" 
60 3 NIL NIL NIL NIL)("MESSAGE" "RFC822" NIL NIL NIL "7BIT" 666 ("Mon, 23 Sep 
2013 16:11:32 +0200" "Inner RawText EMail" ((NIL NIL "olaf" "mydomain.tld")) 
((NIL NIL "olaf" "mydomain.tld")) ((NIL NIL "olaf" "mydomain.tld")) ((NIL NIL 
"olaf" "mydomain.tld")) NIL NIL NIL "<000001ceb866$ce77dd60$6b679820$@tld>") 
("TEXT" "PLAIN" ("charset" "us-ascii") NIL NIL "7BIT" 27 2 NIL NIL ("de") NIL) 
20 NIL ("attachment" NIL) NIL NIL) "MIXED" ("boundary" 
"----=_NextPart_000_0004_01CEB877.BA865D70") NIL ("de") NIL))
A7 OK FETCH completed.
A8 FETCH 1 (BODY[1]<0.60>)
* 1 FETCH (BODY[1]<0> {60}
This is the parent email. Attached is the inner email.


)
A8 OK FETCH completed.
A9 FETCH 1 (FLAGS)
* 1 FETCH (FLAGS (\Deleted \Seen))
A9 OK FETCH completed.
A10 FETCH 1 (BODY[2])
* 1 FETCH (BODY[2] {666}
Received: from localhost (EHLO e11001446428) ([127.0.0.1])
          by e11001446428 (JAMES SMTP Server ) with ESMTP ID 22152612
          for <[email protected]>;
          Mon, 23 Sep 2013 02:11:33 +0000 (GMT)
Return-Path: <[email protected]>
From: <[email protected]>
To: <[email protected]>
Subject: Inner RawText EMail
Date: Mon, 23 Sep 2013 16:11:32 +0200
Message-ID: <000001ceb866$ce77dd60$6b679820$@tld>
MIME-Version: 1.0
Content-Type: text/plain;
        charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: Ac64ZpVXpiAx+1xlQma3/pdxy4hpqwAACC0w
Content-Language: de

This is the inner EMail

)
A10 OK FETCH completed.
{code}
                
> Problem reading datasource name of inner email-message
> ------------------------------------------------------
>
>                 Key: EMAIL-133
>                 URL: https://issues.apache.org/jira/browse/EMAIL-133
>             Project: Commons Email
>          Issue Type: Bug
>    Affects Versions: 1.3.1
>         Environment: Outlook 2007, James 3.0 beta4
>            Reporter: Olaf K.
>
> Situation:
> - Create EMail in Outlook and attach an other EMail (via Drag&Drop)
>   e.g parent email subject: "Parent EMail", inner email subject: "Inner 
> Email" 
> - after parsing this email I try to acces the attachmentname, but the result 
> is a null-value. I acpected "Inner Email" as the attachmentname.
> {code}
> mimeMessageParser.parse();
> List<DataSource> attachAsDataSource = mimeMessageParser.getAttachmentList();
> for (DataSource dataSource : attachAsDataSource) {
>   String filename = dataSource.getName();
>   // filename == null
> {code}
> To resolve this behavior I patched the Methode "getDataSourceName" in 
> "MimeMessageParser" as follows.
> {code}
> ..
> if ("message/rfc822".equalsIgnoreCase(contentType)) {
>   result = ((Message) part.getContent()).getSubject();
>   // START: Optional
>   if (StringUtils.isNotBlank(result)) {
>       // Add eml-prefix, because binary data is in eml-format and I can use 
> OUTLOOK.EXE /eml "filename"
>       result += ".eml";
>   } else {
>       result = "unknown.eml";
>   }
>   // END: Optional
> }
> ...
> {code}
> Now the inner email is recognized as an email-message and the subject is used 
> for the name.
> Is there an other way to receive the subject as the attachment-name (without 
> patching)?

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

Reply via email to