commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernd Eckenfels" <e...@zusammenkunft.net>
Subject Re: [email] Problem reading filename from inline email
Date Sat, 21 Sep 2013 16:42:27 GMT
Hello Olaf,

I havent been able to reproduce your situation as Outlook does not write  
.eml Files and I dont think anybody uses Outlook Express anymore. Anyway,  
can you please post the Mime headers of the mail in question?

I strongly suspect there is no disposition name in there, and therefore  
[email] cannot extract it. Falling back to the Subject might be an option  
for your application if you want to mimic the display of OE. (You dont  
need to patch the library for that, you can just do it in the app).

Bernd

Am 20.09.2013, 19:13 Uhr, schrieb Olaf Kaus <olaf.kaus@gmail.com>:

> Hi,
> how can I extract the filename from an included email.
> If I use mimeMessageParser.getAttachmentList() and then
> dataSource.getName() but I received null for attched emails.
>
> The incoming email was created with outlook (html-email) and via
> drag-n-drop I include an other email as an attachment.
>
> To resolve this behavior I patched the Methode "getDataSourceName" in
> "MimeMessageParser" as follows.
>
> ...
> if ("message/rfc822".equalsIgnoreCase(contentType)) {
> result = ((Message) part.getContent()).getSubject();
> if (StringUtils.isNotBlank(result)) {
> result += ".eml";
> } else {
> result = "unknown.eml";
> }
>
> ...
> (I stripped some null-checks)
>
> Do you have an other solution?
>
> Thx in advance
> Olaf


-- 
http://www.zusammenkunft.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message