james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Kussmaul <kussmaul.l...@nix.ch>
Subject Re: Attachment-Names with Umlaute?
Date Thu, 09 Feb 2012 13:52:06 GMT
Thanks for the info, I now parse the filename field manually (actually using the java-mail
MimeUtility.parseText method) and it now works.

You are also right about the second part: In 0.7 I get a MaximalBodyDescriptor (actually the
callback still returns an almost empty BodyDescriptor which is just an interface declaration,
but it's actually a MaximalBodyDescriptor ) and it has a similar method to get the filename.

kind regards
Michael

On 09.02.2012, at 14:41, Oleg Kalnichevski wrote:

> On Wed, 2012-02-08 at 11:21 +0100, Michael Kussmaul wrote:
>> Hi
>> 
>> I still use mime4j 0.6 because it had the attachment-name in the BodyDescriptor (as
part of the callback: public void body(BodyDescriptor desc, InputStream stream) throws MimeException,
IOException) which seems to be removed in 0.7? 
> 
> I am pretty sure it is still there.
> 
>> But using the old 0.6 version I encountered, that if the filename has Umlaute or
other special characters in it, it does not fully decode the file-name, e.g. an original filename:
>> 
>> "Optimized Dällikon-Bern.gpx"
>> is being reported as:
>> =?iso-8859-1?Q?Optimized_D=E4llikon-Bern=2Egpx?=
>> 
>> I was wondering what the "best practices" are to access and decode the filename e.g.
in version 0.7.2 of mime4j? Looking at your examples "org.apache.james.mime4j.samples.tree.MessageTree"
I only found how to use the DOM API, but is this also possible using your event API?
>> 
> 
> One can certainly parse header fields inside #field(Field rawField)
> method either using field parsers from DOM module or using a custom
> parser of some sort. Personally that is how I use mime4j. 
> 
> Hope this helps
> 
> Oleg
> 
>> In any case many thanks for mime4j, it's a great library!
>> Michael
> 
> 


Mime
View raw message