[email] Problem reading filename from inline email

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[email] Problem reading filename from inline email

Olaf Kaus
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
Reply | Threaded
Open this post in threaded view
|

Re: [email] Problem reading filename from inline email

Bernd Eckenfels
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 <[hidden email]>:

> 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [email] Problem reading filename from inline email

Siegfried Goeschl
In reply to this post by Olaf Kaus
Hi Olaf,

can you create a JIRA with the attached file?

Cheers,

Siegfried Goeschl

On 20.09.13 19:13, Olaf Kaus wrote:

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]