You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Norman Maurer <nm...@byteaction.de> on 2007/02/18 18:49:41 UTC

[mime4j] Get all Attachment names of InputStream

Hi all,

i just looked at the mime4j javadoc and wonder what whould be the best
solution to get all attachment names of a given inputstream.. I thought
this will maybe give me a better performance then using javamail for
this... Im wrong ?

The other thing i noticed is that mime4j has no "altering" support.
Anything planned here ?

bye
Norman


-- 
Mit freundlichen Grüßen 

i.A. Norman Maurer 
Systemadministrator

ByteAction GmbH
Auf der Beune 83-85
64839 Münster

Phone:   +49 (0) 60 71 92 16 - 21
Fax:       +49 (0) 60 71 92 16 - 20
E-mail:    nm@byteaction.de
Internet: www.byteaction.de
AG Darmstadt, HRB 33271
Ust-Id: DE206997247
GF: Thomas Volkert
------------------------------------------------------ 
Diese E-Mail enthält vertrauliche Informationen und ist nur für den in der E-Mail genannten Adressaten bestimmt. Für den Fall, dass der Empfänger dieser E-Mail nicht der in der E-Mail benannte Adressat ist, weisen wir darauf hin, dass das Lesen, Kopieren, die Wiedergabe, Verbreitung, Vervielfältigung, Bekanntmachung, Veränderung, Verteilung und/oder Veröffentlichung der E-Mail strengstens untersagt ist. Bitte verständigen Sie den Absender dieser E-Mail unter folgender Rufnummer +49 (0) 6071 / 9216-0, falls Sie irrtümlich diese E-Mail erhalten haben und löschen Sie diese E-Mail. Der Inhalt dieser E-Mail ist nur rechtsverbindlich, wenn er von unserer Seite schriftlich durch Brief oder Telefax bestätigt wird. Die Versendung von E-Mails an uns hat keine fristwahrende Wirkung. 

This e-mail contains information which is privileged and is intended only for the Addressee named in the e-mail. In case that the recipient of this e-mail is not the named addressee, we would like to inform you that it is strictly prohibited to read, to reproduce, to disseminate, to copy, to disclose, to modify, to distribute and/or to publish this e-mail. If you have received this e-mail in error, please call the sender under following telephone number +49 (0) 6071 / 9216-0 and delete this e-mail. The content of this e-mail is not legally binding unless confirmed by letter or telefax. E-mails which are sent to us do not constitute compliance with any time limits or deadlines.
------------------------------------------------------ 



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


Re: [mime4j] Get all Attachment names of InputStream

Posted by Niklas Therning <ni...@trillian.se>.
Andrew C. Oliver wrote:
> Mime4j has general demonstrable performance problems:
> http://buni.org/bugzilla/show_bug.cgi?id=137
> http://blog.buni.org/blog/mbarker/Meldware/2007/01/27/Look-out-Its-behind-you
>
>
> I'd suggest a general code review for the "byte at a time + buffered
> input stream" anti-pattern
> and general refactoring to do things in blocks where possible.
>
> -Andy
Thanks for letting us know about the performance issues. According to
the blog entry you're referring to the problems increase with the size
of the message. I'm mainly using it to parse small spam mail which might
be why I haven't had the same kind of performance problems. I'll
certainly look into it.

-- 
Niklas Therning
www.spamdrain.net


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


Re: [mime4j] Get all Attachment names of InputStream

Posted by "Andrew C. Oliver" <ac...@buni.org>.
Mime4j has general demonstrable performance problems:
http://buni.org/bugzilla/show_bug.cgi?id=137
http://blog.buni.org/blog/mbarker/Meldware/2007/01/27/Look-out-Its-behind-you

I'd suggest a general code review for the "byte at a time + buffered 
input stream" anti-pattern
and general refactoring to do things in blocks where possible.

-Andy

Niklas Therning wrote:
> Norman Maurer wrote:
>   
>> Hi all,
>>
>> i just looked at the mime4j javadoc and wonder what whould be the best
>> solution to get all attachment names of a given inputstream.. I thought
>> this will maybe give me a better performance then using javamail for
>> this... Im wrong ?
>>   
>>     
> Mime4j should be faster for this kind of things. See the attachment for
> an example of how to get the filename parameter from the
> Content-Disposition fields using Mime4j. I think you are looking for
> something like this, right?
>   
>> The other thing i noticed is that mime4j has no "altering" support.
>> Anything planned here ?
>>   
>>     
> Nope, nothing planned at the moment. But if you have any ideas of how
> Mime4j could be improved, please share them.
>
>   
> ------------------------------------------------------------------------
>
> import java.io.FileInputStream;
> import java.io.IOException;
> import java.util.regex.Matcher;
> import java.util.regex.Pattern;
>
> import org.mime4j.AbstractContentHandler;
> import org.mime4j.EOLConvertingInputStream;
> import org.mime4j.MimeStreamParser;
> import org.mime4j.field.Field;
> import org.mime4j.field.UnstructuredField;
>
>
> public class Main {
>     private static final Pattern P = Pattern.compile(".*filename=(\".*?\"|[^\\s]*).*");
>
>     public static void main(String[] args) throws IOException {
>         MyHandler handler = new MyHandler();
>         MimeStreamParser parser = new MimeStreamParser();
>         parser.setContentHandler(handler);
>         parser.parse(new EOLConvertingInputStream(new FileInputStream(args[0])));
>     }
>
>     public static class MyHandler extends AbstractContentHandler {
>         @Override
>         public void field(String fieldData) {
>             if (fieldData.toLowerCase().startsWith("content-disposition:")) {
>                 UnstructuredField field = (UnstructuredField) Field.parse(fieldData);
>                 Matcher m = P.matcher(field.getValue());
>                 if (m.matches()) {
>                     String filename = m.group(1);
>                     System.out.println(filename);
>                 }
>             }
>         }
>     }
> }
>
>   
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org


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


Re: [mime4j] Get all Attachment names of InputStream

Posted by "Andrew C. Oliver" <ac...@buni.org>.
FYI, my comment was not restricted to mime4j.

Norman Maurer wrote:
> Hi Andy,
>
> thx for the information. It whould be cool if you can open a jira issue
> next time, to help us to find such problems.
>
> I will do it now for the stuff you posted.
>
> Thx
> Norman
>
>
> Andrew C. Oliver schrieb:
>   
>> Mime4j has general demonstrable performance problems:
>> http://buni.org/bugzilla/show_bug.cgi?id=137
>> http://blog.buni.org/blog/mbarker/Meldware/2007/01/27/Look-out-Its-behind-you
>>
>>
>> I'd suggest a general code review for the "byte at a time + buffered
>> input stream" anti-pattern
>> and general refactoring to do things in blocks where possible.
>>
>> -Andy
>>
>> Niklas Therning wrote:
>>     
>>> Norman Maurer wrote:
>>>  
>>>       
>>>> Hi all,
>>>>
>>>> i just looked at the mime4j javadoc and wonder what whould be the best
>>>> solution to get all attachment names of a given inputstream.. I thought
>>>> this will maybe give me a better performance then using javamail for
>>>> this... Im wrong ?
>>>>       
>>>>         
>>> Mime4j should be faster for this kind of things. See the attachment for
>>> an example of how to get the filename parameter from the
>>> Content-Disposition fields using Mime4j. I think you are looking for
>>> something like this, right?
>>>  
>>>       
>>>> The other thing i noticed is that mime4j has no "altering" support.
>>>> Anything planned here ?
>>>>       
>>>>         
>>> Nope, nothing planned at the moment. But if you have any ideas of how
>>> Mime4j could be improved, please share them.
>>>
>>>  
>>> ------------------------------------------------------------------------
>>>
>>> import java.io.FileInputStream;
>>> import java.io.IOException;
>>> import java.util.regex.Matcher;
>>> import java.util.regex.Pattern;
>>>
>>> import org.mime4j.AbstractContentHandler;
>>> import org.mime4j.EOLConvertingInputStream;
>>> import org.mime4j.MimeStreamParser;
>>> import org.mime4j.field.Field;
>>> import org.mime4j.field.UnstructuredField;
>>>
>>>
>>> public class Main {
>>>     private static final Pattern P =
>>> Pattern.compile(".*filename=(\".*?\"|[^\\s]*).*");
>>>
>>>     public static void main(String[] args) throws IOException {
>>>         MyHandler handler = new MyHandler();
>>>         MimeStreamParser parser = new MimeStreamParser();
>>>         parser.setContentHandler(handler);
>>>         parser.parse(new EOLConvertingInputStream(new
>>> FileInputStream(args[0])));
>>>     }
>>>
>>>     public static class MyHandler extends AbstractContentHandler {
>>>         @Override
>>>         public void field(String fieldData) {
>>>             if
>>> (fieldData.toLowerCase().startsWith("content-disposition:")) {
>>>                 UnstructuredField field = (UnstructuredField)
>>> Field.parse(fieldData);
>>>                 Matcher m = P.matcher(field.getValue());
>>>                 if (m.matches()) {
>>>                     String filename = m.group(1);
>>>                     System.out.println(filename);
>>>                 }
>>>             }
>>>         }
>>>     }
>>> }
>>>
>>>  
>>> ------------------------------------------------------------------------
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>>> For additional commands, e-mail: server-dev-help@james.apache.org
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-dev-help@james.apache.org
>>
>> !EXCUBATOR:1,45d8cb7539413506015501!
>>     
>
>
>   


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


Re: [mime4j] Get all Attachment names of InputStream

Posted by Norman Maurer <nm...@byteaction.de>.
Hi Andy,

thx for the information. It whould be cool if you can open a jira issue
next time, to help us to find such problems.

I will do it now for the stuff you posted.

Thx
Norman


Andrew C. Oliver schrieb:
> Mime4j has general demonstrable performance problems:
> http://buni.org/bugzilla/show_bug.cgi?id=137
> http://blog.buni.org/blog/mbarker/Meldware/2007/01/27/Look-out-Its-behind-you
>
>
> I'd suggest a general code review for the "byte at a time + buffered
> input stream" anti-pattern
> and general refactoring to do things in blocks where possible.
>
> -Andy
>
> Niklas Therning wrote:
>> Norman Maurer wrote:
>>  
>>> Hi all,
>>>
>>> i just looked at the mime4j javadoc and wonder what whould be the best
>>> solution to get all attachment names of a given inputstream.. I thought
>>> this will maybe give me a better performance then using javamail for
>>> this... Im wrong ?
>>>       
>> Mime4j should be faster for this kind of things. See the attachment for
>> an example of how to get the filename parameter from the
>> Content-Disposition fields using Mime4j. I think you are looking for
>> something like this, right?
>>  
>>> The other thing i noticed is that mime4j has no "altering" support.
>>> Anything planned here ?
>>>       
>> Nope, nothing planned at the moment. But if you have any ideas of how
>> Mime4j could be improved, please share them.
>>
>>  
>> ------------------------------------------------------------------------
>>
>> import java.io.FileInputStream;
>> import java.io.IOException;
>> import java.util.regex.Matcher;
>> import java.util.regex.Pattern;
>>
>> import org.mime4j.AbstractContentHandler;
>> import org.mime4j.EOLConvertingInputStream;
>> import org.mime4j.MimeStreamParser;
>> import org.mime4j.field.Field;
>> import org.mime4j.field.UnstructuredField;
>>
>>
>> public class Main {
>>     private static final Pattern P =
>> Pattern.compile(".*filename=(\".*?\"|[^\\s]*).*");
>>
>>     public static void main(String[] args) throws IOException {
>>         MyHandler handler = new MyHandler();
>>         MimeStreamParser parser = new MimeStreamParser();
>>         parser.setContentHandler(handler);
>>         parser.parse(new EOLConvertingInputStream(new
>> FileInputStream(args[0])));
>>     }
>>
>>     public static class MyHandler extends AbstractContentHandler {
>>         @Override
>>         public void field(String fieldData) {
>>             if
>> (fieldData.toLowerCase().startsWith("content-disposition:")) {
>>                 UnstructuredField field = (UnstructuredField)
>> Field.parse(fieldData);
>>                 Matcher m = P.matcher(field.getValue());
>>                 if (m.matches()) {
>>                     String filename = m.group(1);
>>                     System.out.println(filename);
>>                 }
>>             }
>>         }
>>     }
>> }
>>
>>  
>> ------------------------------------------------------------------------
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-dev-help@james.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
> !EXCUBATOR:1,45d8cb7539413506015501!


-- 
Mit freundlichen Grüßen 

i.A. Norman Maurer 
Systemadministrator

ByteAction GmbH
Auf der Beune 83-85
64839 Münster

Phone:   +49 (0) 60 71 92 16 - 21
Fax:       +49 (0) 60 71 92 16 - 20
E-mail:    nm@byteaction.de
Internet: www.byteaction.de
AG Darmstadt, HRB 33271
Ust-Id: DE206997247
GF: Thomas Volkert
------------------------------------------------------ 
Diese E-Mail enthält vertrauliche Informationen und ist nur für den in der E-Mail genannten Adressaten bestimmt. Für den Fall, dass der Empfänger dieser E-Mail nicht der in der E-Mail benannte Adressat ist, weisen wir darauf hin, dass das Lesen, Kopieren, die Wiedergabe, Verbreitung, Vervielfältigung, Bekanntmachung, Veränderung, Verteilung und/oder Veröffentlichung der E-Mail strengstens untersagt ist. Bitte verständigen Sie den Absender dieser E-Mail unter folgender Rufnummer +49 (0) 6071 / 9216-0, falls Sie irrtümlich diese E-Mail erhalten haben und löschen Sie diese E-Mail. Der Inhalt dieser E-Mail ist nur rechtsverbindlich, wenn er von unserer Seite schriftlich durch Brief oder Telefax bestätigt wird. Die Versendung von E-Mails an uns hat keine fristwahrende Wirkung. 

This e-mail contains information which is privileged and is intended only for the Addressee named in the e-mail. In case that the recipient of this e-mail is not the named addressee, we would like to inform you that it is strictly prohibited to read, to reproduce, to disseminate, to copy, to disclose, to modify, to distribute and/or to publish this e-mail. If you have received this e-mail in error, please call the sender under following telephone number +49 (0) 6071 / 9216-0 and delete this e-mail. The content of this e-mail is not legally binding unless confirmed by letter or telefax. E-mails which are sent to us do not constitute compliance with any time limits or deadlines.
------------------------------------------------------ 



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


Re: [mime4j] Get all Attachment names of InputStream

Posted by Norman Maurer <nm...@byteaction.de>.
I openeed the jira issue:

https://issues.apache.org/jira/browse/MIME4J-5

Just to inform you ;-)


bye
Norman

Norman Maurer schrieb:
> Hi Andy,
>
> thx for the information. It whould be cool if you can open a jira issue
> next time, to help us to find such problems.
>
> I will do it now for the stuff you posted.
>
> Thx
> Norman
>
>
> Andrew C. Oliver schrieb:
>   
>> Mime4j has general demonstrable performance problems:
>> http://buni.org/bugzilla/show_bug.cgi?id=137
>> http://blog.buni.org/blog/mbarker/Meldware/2007/01/27/Look-out-Its-behind-you
>>
>>
>> I'd suggest a general code review for the "byte at a time + buffered
>> input stream" anti-pattern
>> and general refactoring to do things in blocks where possible.
>>
>> -Andy
>>
>> Niklas Therning wrote:
>>     
>>> Norman Maurer wrote:
>>>  
>>>       
>>>> Hi all,
>>>>
>>>> i just looked at the mime4j javadoc and wonder what whould be the best
>>>> solution to get all attachment names of a given inputstream.. I thought
>>>> this will maybe give me a better performance then using javamail for
>>>> this... Im wrong ?
>>>>       
>>>>         
>>> Mime4j should be faster for this kind of things. See the attachment for
>>> an example of how to get the filename parameter from the
>>> Content-Disposition fields using Mime4j. I think you are looking for
>>> something like this, right?
>>>  
>>>       
>>>> The other thing i noticed is that mime4j has no "altering" support.
>>>> Anything planned here ?
>>>>       
>>>>         
>>> Nope, nothing planned at the moment. But if you have any ideas of how
>>> Mime4j could be improved, please share them.
>>>
>>>  
>>> ------------------------------------------------------------------------
>>>
>>> import java.io.FileInputStream;
>>> import java.io.IOException;
>>> import java.util.regex.Matcher;
>>> import java.util.regex.Pattern;
>>>
>>> import org.mime4j.AbstractContentHandler;
>>> import org.mime4j.EOLConvertingInputStream;
>>> import org.mime4j.MimeStreamParser;
>>> import org.mime4j.field.Field;
>>> import org.mime4j.field.UnstructuredField;
>>>
>>>
>>> public class Main {
>>>     private static final Pattern P =
>>> Pattern.compile(".*filename=(\".*?\"|[^\\s]*).*");
>>>
>>>     public static void main(String[] args) throws IOException {
>>>         MyHandler handler = new MyHandler();
>>>         MimeStreamParser parser = new MimeStreamParser();
>>>         parser.setContentHandler(handler);
>>>         parser.parse(new EOLConvertingInputStream(new
>>> FileInputStream(args[0])));
>>>     }
>>>
>>>     public static class MyHandler extends AbstractContentHandler {
>>>         @Override
>>>         public void field(String fieldData) {
>>>             if
>>> (fieldData.toLowerCase().startsWith("content-disposition:")) {
>>>                 UnstructuredField field = (UnstructuredField)
>>> Field.parse(fieldData);
>>>                 Matcher m = P.matcher(field.getValue());
>>>                 if (m.matches()) {
>>>                     String filename = m.group(1);
>>>                     System.out.println(filename);
>>>                 }
>>>             }
>>>         }
>>>     }
>>> }
>>>
>>>  
>>> ------------------------------------------------------------------------
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>>> For additional commands, e-mail: server-dev-help@james.apache.org
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-dev-help@james.apache.org
>>
>> !EXCUBATOR:1,45d8cb7539413506015501!
>>     
>
>
>   


-- 
Mit freundlichen Grüßen 

i.A. Norman Maurer 
Systemadministrator

ByteAction GmbH
Auf der Beune 83-85
64839 Münster

Phone:   +49 (0) 60 71 92 16 - 21
Fax:       +49 (0) 60 71 92 16 - 20
E-mail:    nm@byteaction.de
Internet: www.byteaction.de
AG Darmstadt, HRB 33271
Ust-Id: DE206997247
GF: Thomas Volkert
------------------------------------------------------ 
Diese E-Mail enthält vertrauliche Informationen und ist nur für den in der E-Mail genannten Adressaten bestimmt. Für den Fall, dass der Empfänger dieser E-Mail nicht der in der E-Mail benannte Adressat ist, weisen wir darauf hin, dass das Lesen, Kopieren, die Wiedergabe, Verbreitung, Vervielfältigung, Bekanntmachung, Veränderung, Verteilung und/oder Veröffentlichung der E-Mail strengstens untersagt ist. Bitte verständigen Sie den Absender dieser E-Mail unter folgender Rufnummer +49 (0) 6071 / 9216-0, falls Sie irrtümlich diese E-Mail erhalten haben und löschen Sie diese E-Mail. Der Inhalt dieser E-Mail ist nur rechtsverbindlich, wenn er von unserer Seite schriftlich durch Brief oder Telefax bestätigt wird. Die Versendung von E-Mails an uns hat keine fristwahrende Wirkung. 

This e-mail contains information which is privileged and is intended only for the Addressee named in the e-mail. In case that the recipient of this e-mail is not the named addressee, we would like to inform you that it is strictly prohibited to read, to reproduce, to disseminate, to copy, to disclose, to modify, to distribute and/or to publish this e-mail. If you have received this e-mail in error, please call the sender under following telephone number +49 (0) 6071 / 9216-0 and delete this e-mail. The content of this e-mail is not legally binding unless confirmed by letter or telefax. E-mails which are sent to us do not constitute compliance with any time limits or deadlines.
------------------------------------------------------ 



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


Re: [mime4j] Get all Attachment names of InputStream

Posted by Niklas Therning <ni...@trillian.se>.
Norman Maurer wrote:
> Hi all,
>
> i just looked at the mime4j javadoc and wonder what whould be the best
> solution to get all attachment names of a given inputstream.. I thought
> this will maybe give me a better performance then using javamail for
> this... Im wrong ?
>   
Mime4j should be faster for this kind of things. See the attachment for
an example of how to get the filename parameter from the
Content-Disposition fields using Mime4j. I think you are looking for
something like this, right?
> The other thing i noticed is that mime4j has no "altering" support.
> Anything planned here ?
>   
Nope, nothing planned at the moment. But if you have any ideas of how
Mime4j could be improved, please share them.

-- 
Niklas Therning
www.spamdrain.net


Re: [mime4j] Get all Attachment names of InputStream

Posted by Niklas Therning <ni...@trillian.se>.
Norman Maurer wrote:
> Hi Niklas,
>
> Niklas Therning schrieb:
>   
>> Norman Maurer wrote:
>>   
>>     
>>> Hi all,
>>>
>>> i just looked at the mime4j javadoc and wonder what whould be the best
>>> solution to get all attachment names of a given inputstream.. I thought
>>> this will maybe give me a better performance then using javamail for
>>> this... Im wrong ?
>>>   
>>>     
>>>       
>> Mime4j should be faster for this kind of things. See the attachment for
>> an example of how to get the filename parameter from the
>> Content-Disposition fields using Mime4j. I think you are looking for
>> something like this, right?
>>   
>>     
>
> Thx Niklas for this sample code. Its exactly what i was looking for :-)
>
>   
>>> The other thing i noticed is that mime4j has no "altering" support.
>>> Anything planned here ?
>>>   
>>>     
>>>       
>> Nope, nothing planned at the moment. But if you have any ideas of how
>> Mime4j could be improved, please share them.
>>   
>>     
>
> Well, I had not much time to look at the code but i think actions like
> adding,removing headers, altering the Subject etc should be really easy
> to implement. We could do something like parsing the inputstream alter
> the Message in memory and write it back with the writeTo(OutputStream)
> method.
>   
Sonds like a great plan. Implementing this for the Header class could be
a first step, just like you are suggesting.
> WDYT ?
>
> Maybe i can find some time (if you intressted) to help you workin on this...
>   
I would be more than interested! I don't have that much time myself to
work on mime4j at the moment. If you find the time I'd be very happy! :)


-- 
Niklas Therning
www.spamdrain.net


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


Re: [mime4j] Get all Attachment names of InputStream

Posted by Norman Maurer <nm...@byteaction.de>.
Hi Niklas,

Niklas Therning schrieb:
> Norman Maurer wrote:
>   
>> Hi all,
>>
>> i just looked at the mime4j javadoc and wonder what whould be the best
>> solution to get all attachment names of a given inputstream.. I thought
>> this will maybe give me a better performance then using javamail for
>> this... Im wrong ?
>>   
>>     
> Mime4j should be faster for this kind of things. See the attachment for
> an example of how to get the filename parameter from the
> Content-Disposition fields using Mime4j. I think you are looking for
> something like this, right?
>   

Thx Niklas for this sample code. Its exactly what i was looking for :-)

>> The other thing i noticed is that mime4j has no "altering" support.
>> Anything planned here ?
>>   
>>     
> Nope, nothing planned at the moment. But if you have any ideas of how
> Mime4j could be improved, please share them.
>   

Well, I had not much time to look at the code but i think actions like
adding,removing headers, altering the Subject etc should be really easy
to implement. We could do something like parsing the inputstream alter
the Message in memory and write it back with the writeTo(OutputStream)
method.

WDYT ?

Maybe i can find some time (if you intressted) to help you workin on this...

-- 
Mit freundlichen Grüßen 

i.A. Norman Maurer 
Systemadministrator

ByteAction GmbH
Auf der Beune 83-85
64839 Münster

Phone:   +49 (0) 60 71 92 16 - 21
Fax:       +49 (0) 60 71 92 16 - 20
E-mail:    nm@byteaction.de
Internet: www.byteaction.de
AG Darmstadt, HRB 33271
Ust-Id: DE206997247
GF: Thomas Volkert
------------------------------------------------------ 
Diese E-Mail enthält vertrauliche Informationen und ist nur für den in der E-Mail genannten Adressaten bestimmt. Für den Fall, dass der Empfänger dieser E-Mail nicht der in der E-Mail benannte Adressat ist, weisen wir darauf hin, dass das Lesen, Kopieren, die Wiedergabe, Verbreitung, Vervielfältigung, Bekanntmachung, Veränderung, Verteilung und/oder Veröffentlichung der E-Mail strengstens untersagt ist. Bitte verständigen Sie den Absender dieser E-Mail unter folgender Rufnummer +49 (0) 6071 / 9216-0, falls Sie irrtümlich diese E-Mail erhalten haben und löschen Sie diese E-Mail. Der Inhalt dieser E-Mail ist nur rechtsverbindlich, wenn er von unserer Seite schriftlich durch Brief oder Telefax bestätigt wird. Die Versendung von E-Mails an uns hat keine fristwahrende Wirkung. 

This e-mail contains information which is privileged and is intended only for the Addressee named in the e-mail. In case that the recipient of this e-mail is not the named addressee, we would like to inform you that it is strictly prohibited to read, to reproduce, to disseminate, to copy, to disclose, to modify, to distribute and/or to publish this e-mail. If you have received this e-mail in error, please call the sender under following telephone number +49 (0) 6071 / 9216-0 and delete this e-mail. The content of this e-mail is not legally binding unless confirmed by letter or telefax. E-mails which are sent to us do not constitute compliance with any time limits or deadlines.
------------------------------------------------------ 



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