<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>mime4j-dev@james.apache.org Archives</title>
<link rel="self" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/?format=atom"/>
<link href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/"/>
<id>http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/</id>
<updated>2009-12-08T13:28:46Z</updated>
<entry>
<title>Re: Bug in decoderutil</title>
<author><name>Markus Wiederkehr &lt;markus.wiederkehr@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200912.mbox/%3ca92573960912040349y7b68cbf9m439c23f06824f072@mail.gmail.com%3e"/>
<id>urn:uuid:%3ca92573960912040349y7b68cbf9m439c23f06824f072@mail-gmail-com%3e</id>
<updated>2009-12-04T11:49:32Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I believe this bug has already been resolved in the current SVN trunk.
Probably in the course of
http://issues.apache.org/jira/browse/MIME4J-138..

Please create a new JIRA issue if I am wrong.

Best regards,
Markus

On Thu, Dec 3, 2009 at 11:31 PM, Wim Jongman &lt;wim.jongman@gmail.com&gt; wrote:
&gt; Hi,
&gt;
&gt; Decoderutil crashes on this subject line:
&gt;
&gt; =?utf-8?Q?variable=20${target.nl}?=
&gt;
&gt; Illegal group reference
&gt; at java.util.regex.Matcher.appendReplacement(Unknown Source)
&gt; at
&gt; org.apache.james.mime4j.codec.DecoderUtil.decodeEncodedWords(DecoderUtil.java:160)
&gt;
&gt;
&gt; Best regards,
&gt;
&gt; Wim


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Bug in decoderutil</title>
<author><name>Norman Maurer &lt;norman.maurer@googlemail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200912.mbox/%3c75bda7a00912032314m4c0492a7m6e88421a551d91@mail.gmail.com%3e"/>
<id>urn:uuid:%3c75bda7a00912032314m4c0492a7m6e88421a551d91@mail-gmail-com%3e</id>
<updated>2009-12-04T07:14:51Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Wim,

would you mind open a jira bug report ?

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

We will take the needed steps then to fix the bug.

Thx for using MIME4J

Bye,
Norman


2009/12/3 Wim Jongman &lt;wim.jongman@gmail.com&gt;:
&gt; Hi,
&gt;
&gt; Decoderutil crashes on this subject line:
&gt;
&gt; =?utf-8?Q?variable=20${target.nl}?=
&gt;
&gt; Illegal group reference
&gt; at java.util.regex.Matcher.appendReplacement(Unknown Source)
&gt; at
&gt; org.apache.james.mime4j.codec.DecoderUtil.decodeEncodedWords(DecoderUtil.java:160)
&gt;
&gt;
&gt; Best regards,
&gt;
&gt; Wim
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Bug in decoderutil</title>
<author><name>Wim Jongman &lt;wim.jongman@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200912.mbox/%3c9ceb1e7a0912031431t36df3ccgb6823bda6ab960d6@mail.gmail.com%3e"/>
<id>urn:uuid:%3c9ceb1e7a0912031431t36df3ccgb6823bda6ab960d6@mail-gmail-com%3e</id>
<updated>2009-12-03T22:31:51Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

Decoderutil crashes on this subject line:

=?utf-8?Q?variable=20${target.nl}?=

Illegal group reference
at java.util.regex.Matcher.appendReplacement(Unknown Source)
at
org.apache.james.mime4j.codec.DecoderUtil.decodeEncodedWords(DecoderUtil.java:160)


Best regards,

Wim


</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Resolved: (MIME4J-133) File ECCN 5D002 notice for Mime4j</title>
<author><name>&quot;Norman Maurer (JIRA)&quot; &lt;mime4j-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200912.mbox/%3c1187749611.1259785580630.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1187749611-1259785580630-JavaMail-jira@brutus%3e</id>
<updated>2009-12-02T20:26:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/MIME4J-133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Norman Maurer resolved MIME4J-133.
----------------------------------

    Resolution: Fixed

http://www.apache.org/licenses/exports/ &lt;- updated and email sent

&gt; File ECCN 5D002 notice for Mime4j
&gt; ---------------------------------
&gt;
&gt;                 Key: MIME4J-133
&gt;                 URL: https://issues.apache.org/jira/browse/MIME4J-133
&gt;             Project: JAMES Mime4j
&gt;          Issue Type: Sub-task
&gt;    Affects Versions: 0.7
&gt;            Reporter: Robert Burrell Donkin
&gt;            Assignee: Norman Maurer
&gt;            Priority: Blocker
&gt;             Fix For: 0.7
&gt;
&gt;
&gt; Hey Danny!
&gt; Looks like we need to notify the US government about Mime4j. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Commented: (MIME4J-141) DefaultFieldParser / DelegatingFieldParser incorrectly reject folded headers as invalid</title>
<author><name>&quot;Oleg Kalnichevski (JIRA)&quot; &lt;mime4j-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200912.mbox/%3c1567630049.1259781320928.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1567630049-1259781320928-JavaMail-jira@brutus%3e</id>
<updated>2009-12-02T19:15:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/MIME4J-141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12784965#action_12784965
] 

Oleg Kalnichevski commented on MIME4J-141:
------------------------------------------

Makes sense. Removed. Please review.

Oleg

&gt; DefaultFieldParser / DelegatingFieldParser incorrectly reject folded headers as invalid
&gt; ---------------------------------------------------------------------------------------
&gt;
&gt;                 Key: MIME4J-141
&gt;                 URL: https://issues.apache.org/jira/browse/MIME4J-141
&gt;             Project: JAMES Mime4j
&gt;          Issue Type: Bug
&gt;            Reporter: Oleg Kalnichevski
&gt;             Fix For: 0.7
&gt;
&gt;
&gt; DefaultFieldParser / DelegatingFieldParser incorrectly reject folded headers as invalid.
Value of the header field must be unfolded prior to parsing.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r886266 - /james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/field/AbstractField.java</title>
<author><name>olegk@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200912.mbox/%3c20091202191247.28378238888E@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091202191247-28378238888E@eris-apache-org%3e</id>
<updated>2009-12-02T19:12:46Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: olegk
Date: Wed Dec  2 19:12:45 2009
New Revision: 886266

URL: http://svn.apache.org/viewvc?rev=886266&amp;view=rev
Log:
MIME4J-141: removed unnecessary MimeUtil.unfold() call in AbstractField

Modified:
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/field/AbstractField.java

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/field/AbstractField.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/field/AbstractField.java?rev=886266&amp;r1=886265&amp;r2=886266&amp;view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/field/AbstractField.java
(original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/field/AbstractField.java
Wed Dec  2 19:12:45 2009
@@ -149,21 +149,13 @@
 
     private static ParsedField parse(final ByteSequence raw, final String rawStr)
             throws MimeException {
-        /*
-         * Unfold the field.
-         */
-        final String unfolded = MimeUtil.unfold(rawStr);
-
-        /*
-         * Split into name and value.
-         */
-        final Matcher fieldMatcher = FIELD_NAME_PATTERN.matcher(unfolded);
+        final Matcher fieldMatcher = FIELD_NAME_PATTERN.matcher(rawStr);
         if (!fieldMatcher.find()) {
             throw new MimeException("Invalid field in string");
         }
         final String name = fieldMatcher.group(1);
 
-        String body = unfolded.substring(fieldMatcher.end());
+        String body = rawStr.substring(fieldMatcher.end());
         if (body.length() &gt; 0 &amp;&amp; body.charAt(0) == ' ') {
             body = body.substring(1);
         }




</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Commented: (MIME4J-133) File ECCN 5D002 notice for Mime4j</title>
<author><name>&quot;Norman Maurer (JIRA)&quot; &lt;mime4j-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200912.mbox/%3c1556870414.1259779521014.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1556870414-1259779521014-JavaMail-jira@brutus%3e</id>
<updated>2009-12-02T18:45:21Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/MIME4J-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12784953#action_12784953
] 

Norman Maurer commented on MIME4J-133:
--------------------------------------

Hi Markus,

I just committed the changes to the export site. Let us wait till it will show up, then I
will send the email. So no need to remove the code..

&gt; File ECCN 5D002 notice for Mime4j
&gt; ---------------------------------
&gt;
&gt;                 Key: MIME4J-133
&gt;                 URL: https://issues.apache.org/jira/browse/MIME4J-133
&gt;             Project: JAMES Mime4j
&gt;          Issue Type: Sub-task
&gt;    Affects Versions: 0.7
&gt;            Reporter: Robert Burrell Donkin
&gt;            Assignee: Norman Maurer
&gt;            Priority: Blocker
&gt;             Fix For: 0.7
&gt;
&gt;
&gt; Hey Danny!
&gt; Looks like we need to notify the US government about Mime4j. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Commented: (MIME4J-133) File ECCN 5D002 notice for Mime4j</title>
<author><name>&quot;Markus Wiederkehr (JIRA)&quot; &lt;mime4j-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200912.mbox/%3c896196715.1259762660814.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c896196715-1259762660814-JavaMail-jira@brutus%3e</id>
<updated>2009-12-02T14:04:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/MIME4J-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12784827#action_12784827
] 

Markus Wiederkehr commented on MIME4J-133:
------------------------------------------

Mime4j has a storage module where messages or parts of messages can be stored and later retrieved.
See interface org.apache.james.mime4j.storage.StorageProvider.

One of the implementations of StorageProvider transparently scrambles and unscrambles the
data as it is written and read back. See class CipherStorageProvider in the same package.

I added that class more for demonstration purposes and wasn't aware that it would cause such
a fuss since it does not do any crypto by itself but merely calls existing JRE code.

Anyway, I wouldn't have a problem if we removed this class instead, as I have stated earlier.

&gt; File ECCN 5D002 notice for Mime4j
&gt; ---------------------------------
&gt;
&gt;                 Key: MIME4J-133
&gt;                 URL: https://issues.apache.org/jira/browse/MIME4J-133
&gt;             Project: JAMES Mime4j
&gt;          Issue Type: Sub-task
&gt;    Affects Versions: 0.7
&gt;            Reporter: Robert Burrell Donkin
&gt;            Assignee: Norman Maurer
&gt;            Priority: Blocker
&gt;             Fix For: 0.7
&gt;
&gt;
&gt; Hey Danny!
&gt; Looks like we need to notify the US government about Mime4j. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Commented: (MIME4J-133) File ECCN 5D002 notice for Mime4j</title>
<author><name>&quot;Norman Maurer (JIRA)&quot; &lt;mime4j-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200912.mbox/%3c388607289.1259762181893.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c388607289-1259762181893-JavaMail-jira@brutus%3e</id>
<updated>2009-12-02T13:56:21Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/MIME4J-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12784826#action_12784826
] 

Norman Maurer commented on MIME4J-133:
--------------------------------------

@Robert:

Could you explain why it need crypto stuff and for what ?

Thx,
Norman

&gt; File ECCN 5D002 notice for Mime4j
&gt; ---------------------------------
&gt;
&gt;                 Key: MIME4J-133
&gt;                 URL: https://issues.apache.org/jira/browse/MIME4J-133
&gt;             Project: JAMES Mime4j
&gt;          Issue Type: Sub-task
&gt;    Affects Versions: 0.7
&gt;            Reporter: Robert Burrell Donkin
&gt;            Assignee: Norman Maurer
&gt;            Priority: Blocker
&gt;             Fix For: 0.7
&gt;
&gt;
&gt; Hey Danny!
&gt; Looks like we need to notify the US government about Mime4j. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (MIME4J-130) Add parse method for e-mail addresses that contain special characters in the display name</title>
<author><name>&quot;Markus Wiederkehr (JIRA)&quot; &lt;mime4j-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200912.mbox/%3c1901620771.1259704400778.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1901620771-1259704400778-JavaMail-jira@brutus%3e</id>
<updated>2009-12-01T21:53:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/MIME4J-130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Markus Wiederkehr updated MIME4J-130:
-------------------------------------

    Fix Version/s:     (was: 0.7)
                   0.8
         Assignee:     (was: Markus Wiederkehr)

&gt; Add parse method for e-mail addresses that contain special characters in the display
name
&gt; -----------------------------------------------------------------------------------------
&gt;
&gt;                 Key: MIME4J-130
&gt;                 URL: https://issues.apache.org/jira/browse/MIME4J-130
&gt;             Project: JAMES Mime4j
&gt;          Issue Type: New Feature
&gt;    Affects Versions: 0.6
&gt;            Reporter: Markus Wiederkehr
&gt;             Fix For: 0.8
&gt;
&gt;
&gt; Address.parse(), Group.parse() and Mailbox.parse() can only parse addresses in their
raw (encoded) form. They are capable of decoding encoded words (RFC 2047) but they do not
accept already decoded special characters.
&gt; In other words, they can parse the result of Address.getEncodedString() but not Address.getDisplayString().
&gt; Mime4j should have a means to parse an address such as "Hans Müller &lt;hans.mueller@acme.com&gt;"
for generating new messages or manipulating existing ones.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Commented: (MIME4J-141) DefaultFieldParser / DelegatingFieldParser incorrectly reject folded headers as invalid</title>
<author><name>&quot;Markus Wiederkehr (JIRA)&quot; &lt;mime4j-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200912.mbox/%3c796625179.1259704280638.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c796625179-1259704280638-JavaMail-jira@brutus%3e</id>
<updated>2009-12-01T21:51:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/MIME4J-141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12784453#action_12784453
] 

Markus Wiederkehr commented on MIME4J-141:
------------------------------------------

Look okay to me.

I guess the MimeUtil.unfold() call in AbstractField line 155 does not make much sense after
your change.

At least all tests seem to pass if the call gets removed.

Opinions?

&gt; DefaultFieldParser / DelegatingFieldParser incorrectly reject folded headers as invalid
&gt; ---------------------------------------------------------------------------------------
&gt;
&gt;                 Key: MIME4J-141
&gt;                 URL: https://issues.apache.org/jira/browse/MIME4J-141
&gt;             Project: JAMES Mime4j
&gt;          Issue Type: Bug
&gt;            Reporter: Oleg Kalnichevski
&gt;             Fix For: 0.7
&gt;
&gt;
&gt; DefaultFieldParser / DelegatingFieldParser incorrectly reject folded headers as invalid.
Value of the header field must be unfolded prior to parsing.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (MIME4J-109) Support for MIME Parameter Value and Encoded Word Extensions</title>
<author><name>&quot;Markus Wiederkehr (JIRA)&quot; &lt;mime4j-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200912.mbox/%3c121988687.1259704280759.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c121988687-1259704280759-JavaMail-jira@brutus%3e</id>
<updated>2009-12-01T21:51:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/MIME4J-109?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Markus Wiederkehr updated MIME4J-109:
-------------------------------------

    Fix Version/s:     (was: 0.7)
                   0.8

&gt; Support for MIME Parameter Value and Encoded Word Extensions
&gt; ------------------------------------------------------------
&gt;
&gt;                 Key: MIME4J-109
&gt;                 URL: https://issues.apache.org/jira/browse/MIME4J-109
&gt;             Project: JAMES Mime4j
&gt;          Issue Type: New Feature
&gt;    Affects Versions: 0.5
&gt;            Reporter: Markus Wiederkehr
&gt;            Assignee: Markus Wiederkehr
&gt;             Fix For: 0.8
&gt;
&gt;
&gt; See RFC 2231.
&gt; Mime4j should be capable of correctly decoding and encoding these extensions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: 0.7 release road map; was Re: Release 0.6.1?</title>
<author><name>Markus Wiederkehr &lt;markus.wiederkehr@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200912.mbox/%3ca92573960912011334n18573bc1t2876493310acb3e5@mail.gmail.com%3e"/>
<id>urn:uuid:%3ca92573960912011334n18573bc1t2876493310acb3e5@mail-gmail-com%3e</id>
<updated>2009-12-01T21:34:33Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Tue, Dec 1, 2009 at 10:16 PM, Stefano Bagnara &lt;apache@bago.org&gt; wrote:
&gt; 2009/12/1 Oleg Kalnichevski &lt;olegk@apache.org&gt;:
&gt;&gt; Folks,
&gt;&gt;
&gt;&gt; Could you please invest a few minutes into a quick review of open issues and
&gt;&gt; reassign some of them to a later target (0.8 / 0.9 / 1.0)? It would be great
&gt;&gt; to have a more concrete / realistic road map for the 0.7 release.
&gt;
&gt; I moved any unussigned&amp;unresolved issue from 0.7 to 0.8 and I made the
&gt; crypto notice issue "blocker" for a release.
&gt;
&gt; Markus have this 2 issues assigned:
&gt; MIME4J-109 - Support for MIME Parameter Value and Encoded Word Extensions
&gt; http://issues.apache.org/jira/browse/MIME4J-109
&gt; MIME4J-130 - Add parse method for e-mail addresses that contain
&gt; special characters in the display name
&gt; http://issues.apache.org/jira/browse/MIME4J-130

I don't have time for #109 ATM and I'm still not sure how to address
#130 so I'm going to move both to 0.8..

Markus

&gt;
&gt; Robert have 2 issues assigned:
&gt; MIME4J-98 - Review Use Of java.util.Date
&gt; http://issues.apache.org/jira/browse/MIME4J-98
&gt; MIME4J-131 - Factor out storage module
&gt; http://issues.apache.org/jira/browse/MIME4J-131
&gt;
&gt; Robert, Markus, can you updated the status or move them to the 0.8 if
&gt; you don't plan to resolve them soon?
&gt;
&gt; Stefano


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: 0.7 release road map; was Re: Release 0.6.1?</title>
<author><name>Stefano Bagnara &lt;apache@bago.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200912.mbox/%3c9426afb70912011316l23b08e8bif4802ddcadfb4cca@mail.gmail.com%3e"/>
<id>urn:uuid:%3c9426afb70912011316l23b08e8bif4802ddcadfb4cca@mail-gmail-com%3e</id>
<updated>2009-12-01T21:16:13Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
2009/12/1 Oleg Kalnichevski &lt;olegk@apache.org&gt;:
&gt; Folks,
&gt;
&gt; Could you please invest a few minutes into a quick review of open issues and
&gt; reassign some of them to a later target (0.8 / 0.9 / 1.0)? It would be great
&gt; to have a more concrete / realistic road map for the 0.7 release.

I moved any unussigned&amp;unresolved issue from 0.7 to 0.8 and I made the
crypto notice issue "blocker" for a release.

Markus have this 2 issues assigned:
MIME4J-109 - Support for MIME Parameter Value and Encoded Word Extensions
http://issues.apache.org/jira/browse/MIME4J-109
MIME4J-130 - Add parse method for e-mail addresses that contain
special characters in the display name
http://issues.apache.org/jira/browse/MIME4J-130

Robert have 2 issues assigned:
MIME4J-98 - Review Use Of java.util.Date
http://issues.apache.org/jira/browse/MIME4J-98
MIME4J-131 - Factor out storage module
http://issues.apache.org/jira/browse/MIME4J-131

Robert, Markus, can you updated the status or move them to the 0.8 if
you don't plan to resolve them soon?

Stefano


</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Assigned: (MIME4J-133) File ECCN 5D002 notice for Mime4j</title>
<author><name>&quot;Stefano Bagnara (JIRA)&quot; &lt;mime4j-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200912.mbox/%3c1936667678.1259701640843.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1936667678-1259701640843-JavaMail-jira@brutus%3e</id>
<updated>2009-12-01T21:07:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/MIME4J-133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Stefano Bagnara reassigned MIME4J-133:
--------------------------------------

    Assignee: Norman Maurer  (was: Danny Angus)

I think this is now a duty for Norman ;-)
This can be done together with jDKIM and mailet-crypto stuff.
Is there anything other project we can notify in the mean time?

&gt; File ECCN 5D002 notice for Mime4j
&gt; ---------------------------------
&gt;
&gt;                 Key: MIME4J-133
&gt;                 URL: https://issues.apache.org/jira/browse/MIME4J-133
&gt;             Project: JAMES Mime4j
&gt;          Issue Type: Sub-task
&gt;    Affects Versions: 0.7
&gt;            Reporter: Robert Burrell Donkin
&gt;            Assignee: Norman Maurer
&gt;             Fix For: 0.7
&gt;
&gt;
&gt; Hey Danny!
&gt; Looks like we need to notify the US government about Mime4j. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (MIME4J-133) File ECCN 5D002 notice for Mime4j</title>
<author><name>&quot;Stefano Bagnara (JIRA)&quot; &lt;mime4j-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200912.mbox/%3c1918765246.1259701640871.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1918765246-1259701640871-JavaMail-jira@brutus%3e</id>
<updated>2009-12-01T21:07:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/MIME4J-133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Stefano Bagnara updated MIME4J-133:
-----------------------------------

    Priority: Blocker  (was: Major)

&gt; File ECCN 5D002 notice for Mime4j
&gt; ---------------------------------
&gt;
&gt;                 Key: MIME4J-133
&gt;                 URL: https://issues.apache.org/jira/browse/MIME4J-133
&gt;             Project: JAMES Mime4j
&gt;          Issue Type: Sub-task
&gt;    Affects Versions: 0.7
&gt;            Reporter: Robert Burrell Donkin
&gt;            Assignee: Norman Maurer
&gt;            Priority: Blocker
&gt;             Fix For: 0.7
&gt;
&gt;
&gt; Hey Danny!
&gt; Looks like we need to notify the US government about Mime4j. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>0.7 release road map; was Re: Release 0.6.1?</title>
<author><name>Oleg Kalnichevski &lt;olegk@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200912.mbox/%3c4B1583E0.2040302@apache.org%3e"/>
<id>urn:uuid:%3c4B1583E0-2040302@apache-org%3e</id>
<updated>2009-12-01T21:00:16Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Norman Maurer wrote:
&gt; I can take care if noone else want to tackle it..
&gt; 
&gt; Bye,
&gt; Norman
&gt; 
&gt; 2009/11/17 Oleg Kalnichevski &lt;olegk@apache.org&gt;:
&gt;&gt; Markus Wiederkehr wrote:
&gt;&gt;&gt; Mime4j development seems to progress very slow at the moment. To me it
&gt;&gt;&gt; does not look like that's going to change anytime soon.
&gt;&gt;&gt;
&gt;&gt;&gt; But since 0.6 we have fixed three important bugs in trunk (MIME4J-138,
&gt;&gt;&gt; 139 and 140).
&gt;&gt;&gt;
&gt;&gt;&gt; If 0.7 cannot be expected soon, should we cut a 0.6.1 instead?
&gt;&gt;&gt;
&gt;&gt;&gt; Markus
&gt;&gt;
&gt;&gt; And who would be willing to act as a release manager?
&gt;&gt;
&gt;&gt; Oleg
&gt;&gt;

Folks,

Could you please invest a few minutes into a quick review of open issues 
and reassign some of them to a later target (0.8 / 0.9 / 1.0)? It would 
be great to have a more concrete / realistic road map for the 0.7 release.

Oleg


</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Resolved: (MIME4J-141) DefaultFieldParser / DelegatingFieldParser incorrectly reject folded headers as invalid</title>
<author><name>&quot;Oleg Kalnichevski (JIRA)&quot; &lt;mime4j-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200912.mbox/%3c1673919682.1259701040660.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1673919682-1259701040660-JavaMail-jira@brutus%3e</id>
<updated>2009-12-01T20:57:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/MIME4J-141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oleg Kalnichevski resolved MIME4J-141.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: 0.7

Fixed in SVN trunk. Please review.

Oleg

&gt; DefaultFieldParser / DelegatingFieldParser incorrectly reject folded headers as invalid
&gt; ---------------------------------------------------------------------------------------
&gt;
&gt;                 Key: MIME4J-141
&gt;                 URL: https://issues.apache.org/jira/browse/MIME4J-141
&gt;             Project: JAMES Mime4j
&gt;          Issue Type: Bug
&gt;            Reporter: Oleg Kalnichevski
&gt;             Fix For: 0.7
&gt;
&gt;
&gt; DefaultFieldParser / DelegatingFieldParser incorrectly reject folded headers as invalid.
Value of the header field must be unfolded prior to parsing.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r885926 - /james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/field/DelegatingFieldParser.java</title>
<author><name>olegk@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200912.mbox/%3c20091201205422.892B42388962@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091201205422-892B42388962@eris-apache-org%3e</id>
<updated>2009-12-01T20:54:22Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: olegk
Date: Tue Dec  1 20:54:22 2009
New Revision: 885926

URL: http://svn.apache.org/viewvc?rev=885926&amp;view=rev
Log:
MIME4J-141: DefaultFieldParser / DelegatingFieldParser incorrectly reject folded headers as
invalid

Modified:
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/field/DelegatingFieldParser.java

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/field/DelegatingFieldParser.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/field/DelegatingFieldParser.java?rev=885926&amp;r1=885925&amp;r2=885926&amp;view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/field/DelegatingFieldParser.java
(original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/field/DelegatingFieldParser.java
Tue Dec  1 20:54:22 2009
@@ -23,6 +23,7 @@
 import java.util.Map;
 
 import org.apache.james.mime4j.util.ByteSequence;
+import org.apache.james.mime4j.util.MimeUtil;
 
 public class DelegatingFieldParser implements FieldParser {
     private static final FieldParser DEFAULT_PARSER = UnstructuredField.PARSER;
@@ -48,6 +49,6 @@
     
     public ParsedField parse(final String name, final String body, final ByteSequence raw)
{
         final FieldParser parser = getParser(name);
-        return parser.parse(name, body, raw);
+        return parser.parse(name, MimeUtil.unfold(body), raw);
     }
 }




</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Created: (MIME4J-141) DefaultFieldParser / DelegatingFieldParser incorrectly reject folded headers as invalid</title>
<author><name>&quot;Oleg Kalnichevski (JIRA)&quot; &lt;mime4j-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200912.mbox/%3c1192731396.1259700801085.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1192731396-1259700801085-JavaMail-jira@brutus%3e</id>
<updated>2009-12-01T20:53:21Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
DefaultFieldParser / DelegatingFieldParser incorrectly reject folded headers as invalid
---------------------------------------------------------------------------------------

                 Key: MIME4J-141
                 URL: https://issues.apache.org/jira/browse/MIME4J-141
             Project: JAMES Mime4j
          Issue Type: Bug
            Reporter: Oleg Kalnichevski


DefaultFieldParser / DelegatingFieldParser incorrectly reject folded headers as invalid. Value
of the header field must be unfolded prior to parsing.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Resolved: (MIME4J-140) MIME4J-57 is not practical in its limits and incorrect in its RFC interpretation</title>
<author><name>&quot;Oleg Kalnichevski (JIRA)&quot; &lt;mime4j-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200912.mbox/%3c935485710.1259700680693.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c935485710-1259700680693-JavaMail-jira@brutus%3e</id>
<updated>2009-12-01T20:51:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/MIME4J-140?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oleg Kalnichevski resolved MIME4J-140.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: 0.7

Marking as resolved

Oleg

&gt; MIME4J-57 is not practical in its limits and incorrect in its RFC interpretation
&gt; --------------------------------------------------------------------------------
&gt;
&gt;                 Key: MIME4J-140
&gt;                 URL: https://issues.apache.org/jira/browse/MIME4J-140
&gt;             Project: JAMES Mime4j
&gt;          Issue Type: Bug
&gt;    Affects Versions: 0.6
&gt;            Reporter: mike bell
&gt;            Assignee: Markus Wiederkehr
&gt;             Fix For: 0.7
&gt;
&gt;
&gt; I have begun playing with Mime4j for potential use in a software project. Very quickly
I found a simple email (Which i can attach) which has about 30 TO addresses. The default was
to throw an exception
&gt; Looking at MIME4J-57 the author has misunderstood the SMTP RFC 2821. Yes you are limited
to 998 octets PER LINE, but you may FOLD as many 998 octet lines as you wish. Technically
it's 100% legal to have a 50 megabyte header value, as long as it is folded. (per 76 or 998
rules).
&gt; I think the limit chosen by default of 1000 is absurdly low - this should be 100000 minimum
or perhaps even unlimited by default. There is something to be said for a sanity check option,
for sure - but not one that is triggered so easily.
&gt; I can also open somewhat related JIRAS if people find them of merit:
&gt; 1. Documentation - defaults should be clearly stated in MimeEntityConfig javadoc. They
are not
&gt; 2. Bug - The javadocs for MimeEntityConfig claim mc.setMaxHeaderCount(-1); would defeat;
this check. It does not (I worked around with Integer.MaxValue)
&gt; 3. Design Question: Should the MimeTokenStream not have a public constructor that allows
MimeEntityConfig to be fed. As it was I had to create my own subclass to access the protected
constructor - is there a reason for this?
&gt; Thanks
&gt; Example header that blew stuff up (and I think we've all seen far far worse!) - The To
line triggers this
&gt; Return-Path: &lt;tomxypdq@hotmail.com&gt;
&gt; Received: from c.mx.sonic.net (c.mx.sonic.net [64.142.100.46])
&gt; 	by eth0.a.lds.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id mBT21U5h027864;
&gt; 	Sun, 28 Dec 2008 18:01:30 -0800
&gt; Received: from bay0-omc2-s13.bay0.hotmail.com (bay0-omc2-s13.bay0.hotmail.com [65.54.246.149])
&gt; 	by c.mx.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id mBT21QuA026548;
&gt; 	Sun, 28 Dec 2008 18:01:30 -0800
&gt; Received: from BAY117-W11 ([207.46.8.46]) by bay0-omc2-s13.bay0.hotmail.com with Microsoft
SMTPSVC(6.0.3790.3959);
&gt; 	 Sun, 28 Dec 2008 18:01:26 -0800
&gt; Message-ID: &lt;BAY117-W1177D87B46BEFE5606716BDDE60@phx.gbl&gt;
&gt; Content-Type: multipart/mixed;
&gt; 	boundary="_03df338b-5029-48d8-84e8-34f5e171dcbd_"
&gt; X-Originating-IP: [96.228.108.66]
&gt; From: Tommy Clark &lt;tomxypdq@hotmail.com&gt;
&gt; To: &lt;alayne.newton@thomson.com&gt;,
&gt;         Alexandra Droman
&gt; 	&lt;alexandra_dorman_100@yahoo.com&gt;,
&gt;         Alexis Steinkamp &lt;lexilooo@hotmail.com&gt;, &lt;asteinkamp@ameritech.net&gt;,
&gt;         &lt;attame@msn.com&gt;, Ben Greenberg
&gt; 	&lt;bprofane68@hotmail.com&gt;,
&gt;         blythe gross &lt;muppetgirl1969@yahoo.com&gt;, &lt;brenden@mediamystic.com&gt;,
&gt;         &lt;cliverping@hotmail.com&gt;, Dae-Jin Kim
&gt; 	&lt;polykor@chollian.net&gt;,
&gt;         Doug Arthur &lt;dougside@yahoo.com&gt;,
&gt;         Dox Doxiadis
&gt; 	&lt;evdoxios.doxiadis@gmail.com&gt;, &lt;doxiadis@princeton.edu&gt;,
&gt;         Haidde Sprague
&gt; 	&lt;haidee.sprague@gmail.com&gt;,
&gt;         James Lee &lt;jcl0072@hotmail.com&gt;, Jeff Dorman
&gt; 	&lt;bub365@aol.com&gt;,
&gt;         &lt;jeffejeff@gmail.com&gt;, "Jeff Lim (E-mail)"
&gt; 	&lt;jeffreyelim@hotmail.com&gt;,
&gt;         Jeff Moshman &lt;jmosesian@sonic.net&gt;, Karen Wolfe
&gt; 	&lt;kaka_2702@yahoo.com&gt;,
&gt;         &lt;keirabby@charter.net&gt;, keirabby
&gt; 	&lt;keirabby@cableone.net&gt;,
&gt;         &lt;keirmo@yahoo.com&gt;, Kerry Levenberg
&gt; 	&lt;kerry@levenbergs.com&gt;,
&gt;         Kim-Chi Steger &lt;kcsteger@aol.com&gt;, &lt;lornap78@hotmail.com&gt;,
&gt;         &lt;mbell90@sonic.net&gt;, mike bell &lt;mjb@gwava.com&gt;, &lt;myra13@aol.com&gt;,
&gt;         Natalie Stange &lt;nstange@nyc.rr.com&gt;,
&gt;         karen wolfe
&gt; 	&lt;ngocbao99@yahoo.com&gt;, &lt;polykor@chol.com&gt;,
&gt;         Rob Cliver
&gt; 	&lt;cliver@fulbrightweb.org&gt;, Sharon Lee &lt;weronron@yahoo.com&gt;,
&gt;         the Clarks
&gt; 	&lt;bosudary@comcast.net&gt;, Ward Breeze &lt;wbreeze@gunder.com&gt;,
&gt;         &lt;whosbarley@yahoo.com&gt;
&gt; Subject: N More THANKS
&gt; Date: Sun, 28 Dec 2008 18:01:25 -0800
&gt; Importance: Normal
&gt; In-Reply-To: &lt;BAY117-W268E2179DDEE877110AF11DDE60@phx.gbl&gt;
&gt; References: &lt;c46c51bb0812281737i256ae8depebb851f79b54c326@mail.gmail.com&gt;
&gt;  &lt;BAY117-W268E2179DDEE877110AF11DDE60@phx.gbl&gt;
&gt; MIME-Version: 1.0
&gt; X-OriginalArrivalTime: 29 Dec 2008 02:01:26.0088 (UTC) FILETIME=[5B42CC80:01C96959]
&gt; X-Sonic-SB-IP-RBLs: IP RBLs sorbs-spam.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Address list parser expects unfolded field body. Does that make	sense?</title>
<author><name>Markus Wiederkehr &lt;markus.wiederkehr@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200911.mbox/%3ca92573960911291122j2fd86d82g7ad882ec262b792c@mail.gmail.com%3e"/>
<id>urn:uuid:%3ca92573960911291122j2fd86d82g7ad882ec262b792c@mail-gmail-com%3e</id>
<updated>2009-11-29T19:22:42Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Sat, Nov 28, 2009 at 12:19 AM, Oleg Kalnichevski &lt;olegk@apache.org&gt; wrote:
&gt; Markus Wiederkehr wrote:
&gt;&gt;
&gt;&gt; On Fri, Nov 27, 2009 at 10:21 PM, Oleg Kalnichevski &lt;olegk@apache.org&gt;
&gt;&gt; wrote:
&gt;&gt;&gt;
&gt;&gt;&gt; Markus Wiederkehr wrote:
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; On Fri, Nov 27, 2009 at 2:37 PM, Oleg Kalnichevski &lt;olegk@apache.org&gt;
&gt;&gt;&gt;&gt; wrote:
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Oleg Kalnichevski wrote:
&gt;&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;&gt; Markus et al
&gt;&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;&gt; The address list parser currently chokes on folded field values that
&gt;&gt;&gt;&gt;&gt;&gt; are
&gt;&gt;&gt;&gt;&gt;&gt; otherwise perfectly valid. That seems somewhat illogical to me. It
&gt;&gt;&gt;&gt;&gt;&gt; really
&gt;&gt;&gt;&gt;&gt;&gt; took me a while to figure out what was wrong with the address list
&gt;&gt;&gt;&gt;&gt;&gt; until
&gt;&gt;&gt;&gt;&gt;&gt; I
&gt;&gt;&gt;&gt;&gt;&gt; stumbled upon a commend about the parser expecting unfolded fields.
&gt;&gt;&gt;&gt;&gt;&gt; The
&gt;&gt;&gt;&gt;&gt;&gt; very
&gt;&gt;&gt;&gt;&gt;&gt; cryptic exception message did not really help either.
&gt;&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;&gt; What is the reason for this restriction? It is because folded values
&gt;&gt;&gt;&gt;&gt;&gt; are
&gt;&gt;&gt;&gt;&gt;&gt; difficult to parse with jjtree? Should not we unfold field values
&gt;&gt;&gt;&gt;&gt;&gt; automatically prior to feeding them to the parser?
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; As for the reason, I don't know, that was before my time..
&gt;&gt;&gt;&gt;
&gt;&gt;&gt; And also before mine
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;&gt; Oleg
&gt;&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; DelegatingFieldParser#parse method does not automatically unfold the
&gt;&gt;&gt;&gt;&gt; field
&gt;&gt;&gt;&gt;&gt; body, which actually seems like a bug to me. What is the expected
&gt;&gt;&gt;&gt;&gt; behavior
&gt;&gt;&gt;&gt;&gt; of this method?
&gt;&gt;&gt;&gt;&gt; From what I see the unfolding happens in
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; AbstractField.parse(ByteSequence, String) at line 155. The call
&gt;&gt;&gt;&gt; hierarchy leads to AbstractField.parse(ByteSequence) and
&gt;&gt;&gt;&gt; MessageBuilder.field(Field)..
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; I guess you should use AbstractField.parse(ByteSequence).
&gt;&gt;&gt;&gt;
&gt;&gt;&gt; That still leaves us with DefaultFieldParser and DelegatingFieldParser
&gt;&gt;&gt; that
&gt;&gt;&gt; produce incorrect results, at least in my opinion.
&gt;&gt;
&gt;&gt; Are you referring to DelegatingFieldParser.parse(String, String,
&gt;&gt; ByteSequence)? That method implements FieldParser#parse which can only
&gt;&gt; be considered to be internal API in my opinion.
&gt;
&gt; That would not be a problem if DefaultFieldParser did not subclass
&gt; DelegatingFieldParser
&gt;
&gt;
&gt; Well maybe not quite,
&gt;&gt;
&gt;&gt; a user might want to implement a custom FieldParser but I don't think
&gt;&gt; this method is intended to be invoked directly.
&gt;&gt;
&gt;&gt; Generally you don't have the name, body and raw byte sequence at hand.
&gt;
&gt; When working with MimeTokenStream generally you do.

Okay, that makes sense.

Feel free to change the behaviour if you like (unless someone else
objects). Maybe it would also be sufficient to provide good
documentation for the current behaviour instead. I mean all you'd have
to do to fix your code is add one MimeUtil.unfold() call.

Markus

&gt;
&gt;&gt; Usually name and body are computed from the raw byte sequence or vice
&gt;&gt; versa. So what's wrong with using AbstractField.parse(ByteSequence)
&gt;&gt; instead?
&gt;&gt;
&gt;
&gt; There is nothing wrong with it but inconveniently there is a public class
&gt; called DefaultFieldParser, which seems to suggest that this is what users
&gt; are supposed to use per default. Why would a user pick AbstractField over
&gt; DefaultFieldParser to parse fields?
&gt;
&gt;
&gt;&gt;&gt; Are there any objections to changing the behavior of these classes?
&gt;&gt;
&gt;&gt; I don't see the point. What's your use case?
&gt;&gt;
&gt;
&gt; MimeTokenStream mimestream = new MimeTokenStream();
&gt; mimestream.parse(instream);
&gt;
&gt; FieldParser parser = new DefaultFieldParser();
&gt; boolean completed = false;
&gt; while (!completed) {
&gt;    int state = mimestream.getState();
&gt;    switch (state) {
&gt;    case MimeTokenStream.T_FIELD:
&gt;        Field field = mimestream.getField();
&gt;        String name = field.getName();
&gt;        String body = field.getBody();
&gt;        ByteSequence raw = field.getRaw();
&gt;        ParsedField parsedField = parser.parse(name, body, raw);
&gt;        break;
&gt;    case MimeTokenStream.T_END_OF_STREAM:
&gt;        completed = true;
&gt;        break;
&gt;    }
&gt;    if (!completed) {
&gt;        mimestream.next();
&gt;    }
&gt; }
&gt;
&gt; Oleg
&gt;
&gt;&gt; Markus
&gt;&gt;
&gt;&gt;&gt; Oleg
&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Markus


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Address list parser expects unfolded field body. Does that make 	sense?</title>
<author><name>Oleg Kalnichevski &lt;olegk@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200911.mbox/%3c4B105E7C.4080006@apache.org%3e"/>
<id>urn:uuid:%3c4B105E7C-4080006@apache-org%3e</id>
<updated>2009-11-27T23:19:24Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Markus Wiederkehr wrote:
&gt; On Fri, Nov 27, 2009 at 10:21 PM, Oleg Kalnichevski &lt;olegk@apache.org&gt; wrote:
&gt;&gt; Markus Wiederkehr wrote:
&gt;&gt;&gt; On Fri, Nov 27, 2009 at 2:37 PM, Oleg Kalnichevski &lt;olegk@apache.org&gt;
&gt;&gt;&gt; wrote:
&gt;&gt;&gt;&gt; Oleg Kalnichevski wrote:
&gt;&gt;&gt;&gt;&gt; Markus et al
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; The address list parser currently chokes on folded field values that
are
&gt;&gt;&gt;&gt;&gt; otherwise perfectly valid. That seems somewhat illogical to me. It
&gt;&gt;&gt;&gt;&gt; really
&gt;&gt;&gt;&gt;&gt; took me a while to figure out what was wrong with the address list until
&gt;&gt;&gt;&gt;&gt; I
&gt;&gt;&gt;&gt;&gt; stumbled upon a commend about the parser expecting unfolded fields. The
&gt;&gt;&gt;&gt;&gt; very
&gt;&gt;&gt;&gt;&gt; cryptic exception message did not really help either.
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; What is the reason for this restriction? It is because folded values
are
&gt;&gt;&gt;&gt;&gt; difficult to parse with jjtree? Should not we unfold field values
&gt;&gt;&gt;&gt;&gt; automatically prior to feeding them to the parser?
&gt;&gt;&gt; As for the reason, I don't know, that was before my time..
&gt;&gt;&gt;
&gt;&gt; And also before mine
&gt;&gt;
&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Oleg
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; DelegatingFieldParser#parse method does not automatically unfold the
&gt;&gt;&gt;&gt; field
&gt;&gt;&gt;&gt; body, which actually seems like a bug to me. What is the expected
&gt;&gt;&gt;&gt; behavior
&gt;&gt;&gt;&gt; of this method?
&gt;&gt;&gt;&gt; From what I see the unfolding happens in
&gt;&gt;&gt; AbstractField.parse(ByteSequence, String) at line 155. The call
&gt;&gt;&gt; hierarchy leads to AbstractField.parse(ByteSequence) and
&gt;&gt;&gt; MessageBuilder.field(Field)..
&gt;&gt;&gt;
&gt;&gt;&gt; I guess you should use AbstractField.parse(ByteSequence).
&gt;&gt;&gt;
&gt;&gt; That still leaves us with DefaultFieldParser and DelegatingFieldParser that
&gt;&gt; produce incorrect results, at least in my opinion.
&gt; 
&gt; Are you referring to DelegatingFieldParser.parse(String, String,
&gt; ByteSequence)? That method implements FieldParser#parse which can only
&gt; be considered to be internal API in my opinion. 

That would not be a problem if DefaultFieldParser did not subclass 
DelegatingFieldParser


Well maybe not quite,
&gt; a user might want to implement a custom FieldParser but I don't think
&gt; this method is intended to be invoked directly.
&gt; 
&gt; Generally you don't have the name, body and raw byte sequence at hand.

When working with MimeTokenStream generally you do.

&gt; Usually name and body are computed from the raw byte sequence or vice
&gt; versa. So what's wrong with using AbstractField.parse(ByteSequence)
&gt; instead?
&gt; 

There is nothing wrong with it but inconveniently there is a public 
class called DefaultFieldParser, which seems to suggest that this is 
what users are supposed to use per default. Why would a user pick 
AbstractField over DefaultFieldParser to parse fields?


&gt;&gt; Are there any objections to changing the behavior of these classes?
&gt; 
&gt; I don't see the point. What's your use case?
&gt; 

MimeTokenStream mimestream = new MimeTokenStream();
mimestream.parse(instream);

FieldParser parser = new DefaultFieldParser();
boolean completed = false;
while (!completed) {
     int state = mimestream.getState();
     switch (state) {
     case MimeTokenStream.T_FIELD:
         Field field = mimestream.getField();
         String name = field.getName();
         String body = field.getBody();
         ByteSequence raw = field.getRaw();
         ParsedField parsedField = parser.parse(name, body, raw);
         break;
     case MimeTokenStream.T_END_OF_STREAM:
         completed = true;
         break;
     }
     if (!completed) {
         mimestream.next();
     }
}

Oleg

&gt; Markus
&gt; 
&gt;&gt; Oleg
&gt;&gt;
&gt;&gt;&gt; Markus
&gt; 



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Address list parser expects unfolded field body. Does that make	sense?</title>
<author><name>Markus Wiederkehr &lt;markus.wiederkehr@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200911.mbox/%3ca92573960911271502p4e6e475eha68f6af88b368b57@mail.gmail.com%3e"/>
<id>urn:uuid:%3ca92573960911271502p4e6e475eha68f6af88b368b57@mail-gmail-com%3e</id>
<updated>2009-11-27T23:02:12Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Fri, Nov 27, 2009 at 10:21 PM, Oleg Kalnichevski &lt;olegk@apache.org&gt; wrote:
&gt; Markus Wiederkehr wrote:
&gt;&gt;
&gt;&gt; On Fri, Nov 27, 2009 at 2:37 PM, Oleg Kalnichevski &lt;olegk@apache.org&gt;
&gt;&gt; wrote:
&gt;&gt;&gt;
&gt;&gt;&gt; Oleg Kalnichevski wrote:
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Markus et al
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; The address list parser currently chokes on folded field values that are
&gt;&gt;&gt;&gt; otherwise perfectly valid. That seems somewhat illogical to me. It
&gt;&gt;&gt;&gt; really
&gt;&gt;&gt;&gt; took me a while to figure out what was wrong with the address list until
&gt;&gt;&gt;&gt; I
&gt;&gt;&gt;&gt; stumbled upon a commend about the parser expecting unfolded fields. The
&gt;&gt;&gt;&gt; very
&gt;&gt;&gt;&gt; cryptic exception message did not really help either.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; What is the reason for this restriction? It is because folded values are
&gt;&gt;&gt;&gt; difficult to parse with jjtree? Should not we unfold field values
&gt;&gt;&gt;&gt; automatically prior to feeding them to the parser?
&gt;&gt;
&gt;&gt; As for the reason, I don't know, that was before my time..
&gt;&gt;
&gt;
&gt; And also before mine
&gt;
&gt;
&gt;&gt;&gt;&gt; Oleg
&gt;&gt;&gt;&gt;
&gt;&gt;&gt; DelegatingFieldParser#parse method does not automatically unfold the
&gt;&gt;&gt; field
&gt;&gt;&gt; body, which actually seems like a bug to me. What is the expected
&gt;&gt;&gt; behavior
&gt;&gt;&gt; of this method?
&gt;&gt;
&gt;&gt;&gt; From what I see the unfolding happens in
&gt;&gt;
&gt;&gt; AbstractField.parse(ByteSequence, String) at line 155. The call
&gt;&gt; hierarchy leads to AbstractField.parse(ByteSequence) and
&gt;&gt; MessageBuilder.field(Field)..
&gt;&gt;
&gt;&gt; I guess you should use AbstractField.parse(ByteSequence).
&gt;&gt;
&gt;
&gt; That still leaves us with DefaultFieldParser and DelegatingFieldParser that
&gt; produce incorrect results, at least in my opinion.

Are you referring to DelegatingFieldParser.parse(String, String,
ByteSequence)? That method implements FieldParser#parse which can only
be considered to be internal API in my opinion. Well maybe not quite,
a user might want to implement a custom FieldParser but I don't think
this method is intended to be invoked directly.

Generally you don't have the name, body and raw byte sequence at hand.
Usually name and body are computed from the raw byte sequence or vice
versa. So what's wrong with using AbstractField.parse(ByteSequence)
instead?

&gt; Are there any objections to changing the behavior of these classes?

I don't see the point. What's your use case?

Markus

&gt; Oleg
&gt;
&gt;&gt; Markus


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Address list parser expects unfolded field body. Does that make 	sense?</title>
<author><name>Oleg Kalnichevski &lt;olegk@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200911.mbox/%3c4B1042D3.1070808@apache.org%3e"/>
<id>urn:uuid:%3c4B1042D3-1070808@apache-org%3e</id>
<updated>2009-11-27T21:21:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Markus Wiederkehr wrote:
&gt; On Fri, Nov 27, 2009 at 2:37 PM, Oleg Kalnichevski &lt;olegk@apache.org&gt; wrote:
&gt;&gt; Oleg Kalnichevski wrote:
&gt;&gt;&gt; Markus et al
&gt;&gt;&gt;
&gt;&gt;&gt; The address list parser currently chokes on folded field values that are
&gt;&gt;&gt; otherwise perfectly valid. That seems somewhat illogical to me. It really
&gt;&gt;&gt; took me a while to figure out what was wrong with the address list until I
&gt;&gt;&gt; stumbled upon a commend about the parser expecting unfolded fields. The very
&gt;&gt;&gt; cryptic exception message did not really help either.
&gt;&gt;&gt;
&gt;&gt;&gt; What is the reason for this restriction? It is because folded values are
&gt;&gt;&gt; difficult to parse with jjtree? Should not we unfold field values
&gt;&gt;&gt; automatically prior to feeding them to the parser?
&gt; 
&gt; As for the reason, I don't know, that was before my time..
&gt; 

And also before mine


&gt;&gt;&gt; Oleg
&gt;&gt;&gt;
&gt;&gt; DelegatingFieldParser#parse method does not automatically unfold the field
&gt;&gt; body, which actually seems like a bug to me. What is the expected behavior
&gt;&gt; of this method?
&gt; 
&gt;&gt;&gt;From what I see the unfolding happens in
&gt; AbstractField.parse(ByteSequence, String) at line 155. The call
&gt; hierarchy leads to AbstractField.parse(ByteSequence) and
&gt; MessageBuilder.field(Field)..
&gt; 
&gt; I guess you should use AbstractField.parse(ByteSequence).
&gt; 

That still leaves us with DefaultFieldParser and DelegatingFieldParser 
that produce incorrect results, at least in my opinion.

Are there any objections to changing the behavior of these classes?

Oleg

&gt; Markus
&gt; 



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Address list parser expects unfolded field body. Does that make	sense?</title>
<author><name>Markus Wiederkehr &lt;markus.wiederkehr@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200911.mbox/%3ca92573960911271058x1dc8aff3g7f24a8a7bb250234@mail.gmail.com%3e"/>
<id>urn:uuid:%3ca92573960911271058x1dc8aff3g7f24a8a7bb250234@mail-gmail-com%3e</id>
<updated>2009-11-27T18:58:12Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Fri, Nov 27, 2009 at 2:37 PM, Oleg Kalnichevski &lt;olegk@apache.org&gt; wrote:
&gt; Oleg Kalnichevski wrote:
&gt;&gt;
&gt;&gt; Markus et al
&gt;&gt;
&gt;&gt; The address list parser currently chokes on folded field values that are
&gt;&gt; otherwise perfectly valid. That seems somewhat illogical to me. It really
&gt;&gt; took me a while to figure out what was wrong with the address list until I
&gt;&gt; stumbled upon a commend about the parser expecting unfolded fields. The very
&gt;&gt; cryptic exception message did not really help either.
&gt;&gt;
&gt;&gt; What is the reason for this restriction? It is because folded values are
&gt;&gt; difficult to parse with jjtree? Should not we unfold field values
&gt;&gt; automatically prior to feeding them to the parser?

As for the reason, I don't know, that was before my time..

&gt;&gt; Oleg
&gt;&gt;
&gt;
&gt; DelegatingFieldParser#parse method does not automatically unfold the field
&gt; body, which actually seems like a bug to me. What is the expected behavior
&gt; of this method?

&gt;From what I see the unfolding happens in
AbstractField.parse(ByteSequence, String) at line 155. The call
hierarchy leads to AbstractField.parse(ByteSequence) and
MessageBuilder.field(Field)..

I guess you should use AbstractField.parse(ByteSequence).

Markus


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Address list parser expects unfolded field body. Does that make sense?</title>
<author><name>Oleg Kalnichevski &lt;olegk@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200911.mbox/%3c4B0FD61E.1060205@apache.org%3e"/>
<id>urn:uuid:%3c4B0FD61E-1060205@apache-org%3e</id>
<updated>2009-11-27T13:37:34Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Oleg Kalnichevski wrote:
&gt; Markus et al
&gt; 
&gt; The address list parser currently chokes on folded field values that are 
&gt; otherwise perfectly valid. That seems somewhat illogical to me. It 
&gt; really took me a while to figure out what was wrong with the address 
&gt; list until I stumbled upon a commend about the parser expecting unfolded 
&gt; fields. The very cryptic exception message did not really help either.
&gt; 
&gt; What is the reason for this restriction? It is because folded values are 
&gt; difficult to parse with jjtree? Should not we unfold field values 
&gt; automatically prior to feeding them to the parser?
&gt; 
&gt; Oleg
&gt; 

DelegatingFieldParser#parse method does not automatically unfold the 
field body, which actually seems like a bug to me. What is the expected 
behavior of this method?

Oleg


</pre>
</div>
</content>
</entry>
<entry>
<title>Address list parser expects unfolded field body. Does that make sense?</title>
<author><name>Oleg Kalnichevski &lt;olegk@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200911.mbox/%3c4B0FD321.9070000@apache.org%3e"/>
<id>urn:uuid:%3c4B0FD321-9070000@apache-org%3e</id>
<updated>2009-11-27T13:24:49Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Markus et al

The address list parser currently chokes on folded field values that are 
otherwise perfectly valid. That seems somewhat illogical to me. It 
really took me a while to figure out what was wrong with the address 
list until I stumbled upon a commend about the parser expecting unfolded 
fields. The very cryptic exception message did not really help either.

What is the reason for this restriction? It is because folded values are 
difficult to parse with jjtree? Should not we unfold field values 
automatically prior to feeding them to the parser?

Oleg


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: SMTP Transport?</title>
<author><name>Norman Maurer &lt;norman.maurer@googlemail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200911.mbox/%3c75bda7a00911231146w52fe40c9u1c79e18e61f71e7e@mail.gmail.com%3e"/>
<id>urn:uuid:%3c75bda7a00911231146w52fe40c9u1c79e18e61f71e7e@mail-gmail-com%3e</id>
<updated>2009-11-23T19:46:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Oleg,

I will have a look soon. Thx for keeping us in the loop :)

Bye,
Norman

2009/11/23 Oleg Kalnichevski &lt;olegk@apache.org&gt;:
&gt; Norman Maurer wrote:
&gt;&gt;
&gt;&gt; Hi Oleg,
&gt;&gt;
&gt;&gt; I would be very interested in this :-)
&gt;&gt;
&gt;&gt; Bye,
&gt;&gt; Norman
&gt;&gt;
&gt;
&gt; Folks,
&gt;
&gt; I finally have the library in a fairly usable (or shall I rather say
&gt; testable) state. I can now send messages to the postfix daemon using my SMTP
&gt; client transport and have the messages passed onto the local LMTP agent
&gt; based on the same transport code for local delivery.
&gt;
&gt; In essence I have a reasonably complete SMTP/LMTP transport library that
&gt; implements RFC 2821 (minimum implementation), RFC 2033, plus a number of
&gt; extensions required by LMTP: RFC 2034 (ENHANCEDSTATUSCODES), RFC 1854
&gt; (PIPELINING), RFC 1652 (8BITMIME).
&gt;
&gt; The code is still very experimental but good enough for getting the feel of
&gt; the API.
&gt;
&gt; Here's the sample of the LMTP transfer agent
&gt;
&gt; http://code.google.com/p/lightmtp/source/browse/trunk/src/examples/java/com/ok2c/lightmtp/examples/LocalMailServerTransportExample.java
&gt;
&gt; Envelop validation / message delivery can be fully asynchronous. Long
&gt; running processes such as DB or LDAP queries can be executed without
&gt; blocking the I/O transport.
&gt;
&gt; The client side transport can either be event (callback) driven
&gt;
&gt; http://code.google.com/p/lightmtp/source/browse/trunk/src/examples/java/com/ok2c/lightmtp/examples/LocalMailClientTransportExample.java
&gt;
&gt; or future driven
&gt;
&gt; http://code.google.com/p/lightmtp/source/browse/trunk/src/examples/java/com/ok2c/lightmtp/examples/MailUserAgentExample.java
&gt; http://code.google.com/p/lightmtp/source/browse/trunk/src/examples/java/com/ok2c/lightmtp/examples/SendMailExample.java
&gt;
&gt; The mail user agent can maintain a pool of persistent connections that can
&gt; be reused for subsequent delivery requests.
&gt;
&gt; The NIO framework is basically a fork of Apache HttpCore with all HTTP
&gt; dependencies removed.
&gt;
&gt; http://code.google.com/p/lightnio/
&gt;
&gt; You would have to get the latest snapshots of both libraries in order to run
&gt; samples.
&gt;
&gt; I developed this code for my private use. If you do not think this is
&gt; something that can be potentially useful for a larger user base, just ignore
&gt; my message.
&gt;
&gt; Cheers
&gt;
&gt; Oleg
&gt;
&gt;
&gt;
&gt;
&gt;&gt; 2009/6/12 Oleg Kalnichevski &lt;olegk@apache.org&gt;:
&gt;&gt;&gt;
&gt;&gt;&gt; On Thu, Jun 11, 2009 at 04:30:58PM +0200, Markus Wiederkehr wrote:
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; I've written a class SmtpTransport that can be used to send a Mime4j
&gt;&gt;&gt;&gt; message to an SMTP server.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Currently it is very simple. Meaning it is not yet capable of
&gt;&gt;&gt;&gt; authentication or TLS or other extensions.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Would it be worth to include this code in Mime4j?
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Cheers,
&gt;&gt;&gt;&gt; Markus
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; PS: Testing is a bit of a PITA with sockets and all.. Robert, could
&gt;&gt;&gt;&gt; MPT help with that? I haven't looked into it yet..
&gt;&gt;&gt;
&gt;&gt;&gt; Markus et al
&gt;&gt;&gt;
&gt;&gt;&gt; _Coincidentally_, I have been working on a LMTP agent and LMTP client
&gt;&gt;&gt; with
&gt;&gt;&gt; support for mandatory extensions required by LMTP [1]: PIPELINING,
&gt;&gt;&gt; ENHANCEDSTATUSCODES and 8BITMIME. The implementation is based a NIO
&gt;&gt;&gt; framework
&gt;&gt;&gt; derived from HttpCore NIO and should be quite scalable. This is my
&gt;&gt;&gt; private
&gt;&gt;&gt; project, but if there is interest in such work, I am willing to
&gt;&gt;&gt; contribute it
&gt;&gt;&gt; to James. Alternatively you are very welcome to contribute to the effort.
&gt;&gt;&gt; It is
&gt;&gt;&gt; ASLv2 licensed.
&gt;&gt;&gt;
&gt;&gt;&gt; Cheers
&gt;&gt;&gt;
&gt;&gt;&gt; Oleg
&gt;&gt;&gt;
&gt;&gt;&gt; [1] http://www.ietf.org/rfc/rfc2033.txt
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: SMTP Transport?</title>
<author><name>Oleg Kalnichevski &lt;olegk@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200911.mbox/%3c4B09C9D3.7050003@apache.org%3e"/>
<id>urn:uuid:%3c4B09C9D3-7050003@apache-org%3e</id>
<updated>2009-11-22T23:31:31Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Norman Maurer wrote:
&gt; Hi Oleg,
&gt; 
&gt; I would be very interested in this :-)
&gt; 
&gt; Bye,
&gt; Norman
&gt; 

Folks,

I finally have the library in a fairly usable (or shall I rather say 
testable) state. I can now send messages to the postfix daemon using my 
SMTP client transport and have the messages passed onto the local LMTP 
agent based on the same transport code for local delivery.

In essence I have a reasonably complete SMTP/LMTP transport library that 
implements RFC 2821 (minimum implementation), RFC 2033, plus a number of 
extensions required by LMTP: RFC 2034 (ENHANCEDSTATUSCODES), RFC 1854 
(PIPELINING), RFC 1652 (8BITMIME).

The code is still very experimental but good enough for getting the feel 
of the API.

Here's the sample of the LMTP transfer agent

http://code.google.com/p/lightmtp/source/browse/trunk/src/examples/java/com/ok2c/lightmtp/examples/LocalMailServerTransportExample.java

Envelop validation / message delivery can be fully asynchronous. Long 
running processes such as DB or LDAP queries can be executed without 
blocking the I/O transport.

The client side transport can either be event (callback) driven

http://code.google.com/p/lightmtp/source/browse/trunk/src/examples/java/com/ok2c/lightmtp/examples/LocalMailClientTransportExample.java

or future driven

http://code.google.com/p/lightmtp/source/browse/trunk/src/examples/java/com/ok2c/lightmtp/examples/MailUserAgentExample.java
http://code.google.com/p/lightmtp/source/browse/trunk/src/examples/java/com/ok2c/lightmtp/examples/SendMailExample.java

The mail user agent can maintain a pool of persistent connections that 
can be reused for subsequent delivery requests.

The NIO framework is basically a fork of Apache HttpCore with all HTTP 
dependencies removed.

http://code.google.com/p/lightnio/

You would have to get the latest snapshots of both libraries in order to 
run samples.

I developed this code for my private use. If you do not think this is 
something that can be potentially useful for a larger user base, just 
ignore my message.

Cheers

Oleg




&gt; 2009/6/12 Oleg Kalnichevski &lt;olegk@apache.org&gt;:
&gt;&gt; On Thu, Jun 11, 2009 at 04:30:58PM +0200, Markus Wiederkehr wrote:
&gt;&gt;&gt; I've written a class SmtpTransport that can be used to send a Mime4j
&gt;&gt;&gt; message to an SMTP server.
&gt;&gt;&gt;
&gt;&gt;&gt; Currently it is very simple. Meaning it is not yet capable of
&gt;&gt;&gt; authentication or TLS or other extensions.
&gt;&gt;&gt;
&gt;&gt;&gt; Would it be worth to include this code in Mime4j?
&gt;&gt;&gt;
&gt;&gt;&gt; Cheers,
&gt;&gt;&gt; Markus
&gt;&gt;&gt;
&gt;&gt;&gt; PS: Testing is a bit of a PITA with sockets and all.. Robert, could
&gt;&gt;&gt; MPT help with that? I haven't looked into it yet..
&gt;&gt; Markus et al
&gt;&gt;
&gt;&gt; _Coincidentally_, I have been working on a LMTP agent and LMTP client with
&gt;&gt; support for mandatory extensions required by LMTP [1]: PIPELINING,
&gt;&gt; ENHANCEDSTATUSCODES and 8BITMIME. The implementation is based a NIO framework
&gt;&gt; derived from HttpCore NIO and should be quite scalable. This is my private
&gt;&gt; project, but if there is interest in such work, I am willing to contribute it
&gt;&gt; to James. Alternatively you are very welcome to contribute to the effort. It is
&gt;&gt; ASLv2 licensed.
&gt;&gt;
&gt;&gt; Cheers
&gt;&gt;
&gt;&gt; Oleg
&gt;&gt;
&gt;&gt; [1] http://www.ietf.org/rfc/rfc2033.txt
&gt;&gt;
&gt;&gt;
&gt;&gt;



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Release 0.6.1?</title>
<author><name>Norman Maurer &lt;norman.maurer@googlemail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200911.mbox/%3c75bda7a00911180312q6cb30a3en9ea55c1e68854386@mail.gmail.com%3e"/>
<id>urn:uuid:%3c75bda7a00911180312q6cb30a3en9ea55c1e68854386@mail-gmail-com%3e</id>
<updated>2009-11-18T11:12:32Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I can take care if noone else want to tackle it..

Bye,
Norman

2009/11/17 Oleg Kalnichevski &lt;olegk@apache.org&gt;:
&gt; Markus Wiederkehr wrote:
&gt;&gt;
&gt;&gt; Mime4j development seems to progress very slow at the moment. To me it
&gt;&gt; does not look like that's going to change anytime soon.
&gt;&gt;
&gt;&gt; But since 0.6 we have fixed three important bugs in trunk (MIME4J-138,
&gt;&gt; 139 and 140).
&gt;&gt;
&gt;&gt; If 0.7 cannot be expected soon, should we cut a 0.6.1 instead?
&gt;&gt;
&gt;&gt; Markus
&gt;
&gt;
&gt; And who would be willing to act as a release manager?
&gt;
&gt; Oleg
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Release 0.6.1?</title>
<author><name>Oleg Kalnichevski &lt;olegk@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200911.mbox/%3c4B02F2E9.8020205@apache.org%3e"/>
<id>urn:uuid:%3c4B02F2E9-8020205@apache-org%3e</id>
<updated>2009-11-17T19:00:57Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Markus Wiederkehr wrote:
&gt; Mime4j development seems to progress very slow at the moment. To me it
&gt; does not look like that's going to change anytime soon.
&gt; 
&gt; But since 0.6 we have fixed three important bugs in trunk (MIME4J-138,
&gt; 139 and 140).
&gt; 
&gt; If 0.7 cannot be expected soon, should we cut a 0.6.1 instead?
&gt; 
&gt; Markus


And who would be willing to act as a release manager?

Oleg


</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Commented: (MIME4J-140) MIME4J-57 is not practical in its limits and incorrect in its RFC interpretation</title>
<author><name>&quot;Oleg Kalnichevski (JIRA)&quot; &lt;mime4j-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200911.mbox/%3c1821597690.1258484439596.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1821597690-1258484439596-JavaMail-jira@brutus%3e</id>
<updated>2009-11-17T19:00:39Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/MIME4J-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12779045#action_12779045
] 

Oleg Kalnichevski commented on MIME4J-140:
------------------------------------------

Works for me

Oleg

&gt; MIME4J-57 is not practical in its limits and incorrect in its RFC interpretation
&gt; --------------------------------------------------------------------------------
&gt;
&gt;                 Key: MIME4J-140
&gt;                 URL: https://issues.apache.org/jira/browse/MIME4J-140
&gt;             Project: JAMES Mime4j
&gt;          Issue Type: Bug
&gt;    Affects Versions: 0.6
&gt;            Reporter: mike bell
&gt;            Assignee: Markus Wiederkehr
&gt;
&gt; I have begun playing with Mime4j for potential use in a software project. Very quickly
I found a simple email (Which i can attach) which has about 30 TO addresses. The default was
to throw an exception
&gt; Looking at MIME4J-57 the author has misunderstood the SMTP RFC 2821. Yes you are limited
to 998 octets PER LINE, but you may FOLD as many 998 octet lines as you wish. Technically
it's 100% legal to have a 50 megabyte header value, as long as it is folded. (per 76 or 998
rules).
&gt; I think the limit chosen by default of 1000 is absurdly low - this should be 100000 minimum
or perhaps even unlimited by default. There is something to be said for a sanity check option,
for sure - but not one that is triggered so easily.
&gt; I can also open somewhat related JIRAS if people find them of merit:
&gt; 1. Documentation - defaults should be clearly stated in MimeEntityConfig javadoc. They
are not
&gt; 2. Bug - The javadocs for MimeEntityConfig claim mc.setMaxHeaderCount(-1); would defeat;
this check. It does not (I worked around with Integer.MaxValue)
&gt; 3. Design Question: Should the MimeTokenStream not have a public constructor that allows
MimeEntityConfig to be fed. As it was I had to create my own subclass to access the protected
constructor - is there a reason for this?
&gt; Thanks
&gt; Example header that blew stuff up (and I think we've all seen far far worse!) - The To
line triggers this
&gt; Return-Path: &lt;tomxypdq@hotmail.com&gt;
&gt; Received: from c.mx.sonic.net (c.mx.sonic.net [64.142.100.46])
&gt; 	by eth0.a.lds.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id mBT21U5h027864;
&gt; 	Sun, 28 Dec 2008 18:01:30 -0800
&gt; Received: from bay0-omc2-s13.bay0.hotmail.com (bay0-omc2-s13.bay0.hotmail.com [65.54.246.149])
&gt; 	by c.mx.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id mBT21QuA026548;
&gt; 	Sun, 28 Dec 2008 18:01:30 -0800
&gt; Received: from BAY117-W11 ([207.46.8.46]) by bay0-omc2-s13.bay0.hotmail.com with Microsoft
SMTPSVC(6.0.3790.3959);
&gt; 	 Sun, 28 Dec 2008 18:01:26 -0800
&gt; Message-ID: &lt;BAY117-W1177D87B46BEFE5606716BDDE60@phx.gbl&gt;
&gt; Content-Type: multipart/mixed;
&gt; 	boundary="_03df338b-5029-48d8-84e8-34f5e171dcbd_"
&gt; X-Originating-IP: [96.228.108.66]
&gt; From: Tommy Clark &lt;tomxypdq@hotmail.com&gt;
&gt; To: &lt;alayne.newton@thomson.com&gt;,
&gt;         Alexandra Droman
&gt; 	&lt;alexandra_dorman_100@yahoo.com&gt;,
&gt;         Alexis Steinkamp &lt;lexilooo@hotmail.com&gt;, &lt;asteinkamp@ameritech.net&gt;,
&gt;         &lt;attame@msn.com&gt;, Ben Greenberg
&gt; 	&lt;bprofane68@hotmail.com&gt;,
&gt;         blythe gross &lt;muppetgirl1969@yahoo.com&gt;, &lt;brenden@mediamystic.com&gt;,
&gt;         &lt;cliverping@hotmail.com&gt;, Dae-Jin Kim
&gt; 	&lt;polykor@chollian.net&gt;,
&gt;         Doug Arthur &lt;dougside@yahoo.com&gt;,
&gt;         Dox Doxiadis
&gt; 	&lt;evdoxios.doxiadis@gmail.com&gt;, &lt;doxiadis@princeton.edu&gt;,
&gt;         Haidde Sprague
&gt; 	&lt;haidee.sprague@gmail.com&gt;,
&gt;         James Lee &lt;jcl0072@hotmail.com&gt;, Jeff Dorman
&gt; 	&lt;bub365@aol.com&gt;,
&gt;         &lt;jeffejeff@gmail.com&gt;, "Jeff Lim (E-mail)"
&gt; 	&lt;jeffreyelim@hotmail.com&gt;,
&gt;         Jeff Moshman &lt;jmosesian@sonic.net&gt;, Karen Wolfe
&gt; 	&lt;kaka_2702@yahoo.com&gt;,
&gt;         &lt;keirabby@charter.net&gt;, keirabby
&gt; 	&lt;keirabby@cableone.net&gt;,
&gt;         &lt;keirmo@yahoo.com&gt;, Kerry Levenberg
&gt; 	&lt;kerry@levenbergs.com&gt;,
&gt;         Kim-Chi Steger &lt;kcsteger@aol.com&gt;, &lt;lornap78@hotmail.com&gt;,
&gt;         &lt;mbell90@sonic.net&gt;, mike bell &lt;mjb@gwava.com&gt;, &lt;myra13@aol.com&gt;,
&gt;         Natalie Stange &lt;nstange@nyc.rr.com&gt;,
&gt;         karen wolfe
&gt; 	&lt;ngocbao99@yahoo.com&gt;, &lt;polykor@chol.com&gt;,
&gt;         Rob Cliver
&gt; 	&lt;cliver@fulbrightweb.org&gt;, Sharon Lee &lt;weronron@yahoo.com&gt;,
&gt;         the Clarks
&gt; 	&lt;bosudary@comcast.net&gt;, Ward Breeze &lt;wbreeze@gunder.com&gt;,
&gt;         &lt;whosbarley@yahoo.com&gt;
&gt; Subject: N More THANKS
&gt; Date: Sun, 28 Dec 2008 18:01:25 -0800
&gt; Importance: Normal
&gt; In-Reply-To: &lt;BAY117-W268E2179DDEE877110AF11DDE60@phx.gbl&gt;
&gt; References: &lt;c46c51bb0812281737i256ae8depebb851f79b54c326@mail.gmail.com&gt;
&gt;  &lt;BAY117-W268E2179DDEE877110AF11DDE60@phx.gbl&gt;
&gt; MIME-Version: 1.0
&gt; X-OriginalArrivalTime: 29 Dec 2008 02:01:26.0088 (UTC) FILETIME=[5B42CC80:01C96959]
&gt; X-Sonic-SB-IP-RBLs: IP RBLs sorbs-spam.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Release 0.6.1?</title>
<author><name>Norman Maurer &lt;norman.maurer@googlemail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200911.mbox/%3c75bda7a00911160557t308285ecq53a750566a00a628@mail.gmail.com%3e"/>
<id>urn:uuid:%3c75bda7a00911160557t308285ecq53a750566a00a628@mail-gmail-com%3e</id>
<updated>2009-11-16T13:57:15Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
+1

Bye,
Norman

2009/11/16 Markus Wiederkehr &lt;markus.wiederkehr@gmail.com&gt;:
&gt; Mime4j development seems to progress very slow at the moment. To me it
&gt; does not look like that's going to change anytime soon.
&gt;
&gt; But since 0.6 we have fixed three important bugs in trunk (MIME4J-138,
&gt; 139 and 140).
&gt;
&gt; If 0.7 cannot be expected soon, should we cut a 0.6.1 instead?
&gt;
&gt; Markus
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Release 0.6.1?</title>
<author><name>Markus Wiederkehr &lt;markus.wiederkehr@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200911.mbox/%3ca92573960911160555u5bd2bf09w3486571efb46b34e@mail.gmail.com%3e"/>
<id>urn:uuid:%3ca92573960911160555u5bd2bf09w3486571efb46b34e@mail-gmail-com%3e</id>
<updated>2009-11-16T13:55:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Mime4j development seems to progress very slow at the moment. To me it
does not look like that's going to change anytime soon.

But since 0.6 we have fixed three important bugs in trunk (MIME4J-138,
139 and 140).

If 0.7 cannot be expected soon, should we cut a 0.6.1 instead?

Markus


</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Commented: (MIME4J-140) MIME4J-57 is not practical in its limits and incorrect in its RFC interpretation</title>
<author><name>&quot;Markus Wiederkehr (JIRA)&quot; &lt;mime4j-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200911.mbox/%3c345848652.1258378179817.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c345848652-1258378179817-JavaMail-jira@brutus%3e</id>
<updated>2009-11-16T13:29:39Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/MIME4J-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12778338#action_12778338
] 

Markus Wiederkehr commented on MIME4J-140:
------------------------------------------

@Mike: Regarding the other issues:

#1 and #2 should be fixed in trunk.

#3: I don't know why that constructor is not public. But do you really want to use MimeTokenStream
directly? MimeStreamParser has a public constructor that passes the specified MimeEntityConfig
to MimeTokenStream. Please file a separate JIRA if you still want that to be addressed.

&gt; MIME4J-57 is not practical in its limits and incorrect in its RFC interpretation
&gt; --------------------------------------------------------------------------------
&gt;
&gt;                 Key: MIME4J-140
&gt;                 URL: https://issues.apache.org/jira/browse/MIME4J-140
&gt;             Project: JAMES Mime4j
&gt;          Issue Type: Bug
&gt;    Affects Versions: 0.6
&gt;            Reporter: mike bell
&gt;            Assignee: Markus Wiederkehr
&gt;
&gt; I have begun playing with Mime4j for potential use in a software project. Very quickly
I found a simple email (Which i can attach) which has about 30 TO addresses. The default was
to throw an exception
&gt; Looking at MIME4J-57 the author has misunderstood the SMTP RFC 2821. Yes you are limited
to 998 octets PER LINE, but you may FOLD as many 998 octet lines as you wish. Technically
it's 100% legal to have a 50 megabyte header value, as long as it is folded. (per 76 or 998
rules).
&gt; I think the limit chosen by default of 1000 is absurdly low - this should be 100000 minimum
or perhaps even unlimited by default. There is something to be said for a sanity check option,
for sure - but not one that is triggered so easily.
&gt; I can also open somewhat related JIRAS if people find them of merit:
&gt; 1. Documentation - defaults should be clearly stated in MimeEntityConfig javadoc. They
are not
&gt; 2. Bug - The javadocs for MimeEntityConfig claim mc.setMaxHeaderCount(-1); would defeat;
this check. It does not (I worked around with Integer.MaxValue)
&gt; 3. Design Question: Should the MimeTokenStream not have a public constructor that allows
MimeEntityConfig to be fed. As it was I had to create my own subclass to access the protected
constructor - is there a reason for this?
&gt; Thanks
&gt; Example header that blew stuff up (and I think we've all seen far far worse!) - The To
line triggers this
&gt; Return-Path: &lt;tomxypdq@hotmail.com&gt;
&gt; Received: from c.mx.sonic.net (c.mx.sonic.net [64.142.100.46])
&gt; 	by eth0.a.lds.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id mBT21U5h027864;
&gt; 	Sun, 28 Dec 2008 18:01:30 -0800
&gt; Received: from bay0-omc2-s13.bay0.hotmail.com (bay0-omc2-s13.bay0.hotmail.com [65.54.246.149])
&gt; 	by c.mx.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id mBT21QuA026548;
&gt; 	Sun, 28 Dec 2008 18:01:30 -0800
&gt; Received: from BAY117-W11 ([207.46.8.46]) by bay0-omc2-s13.bay0.hotmail.com with Microsoft
SMTPSVC(6.0.3790.3959);
&gt; 	 Sun, 28 Dec 2008 18:01:26 -0800
&gt; Message-ID: &lt;BAY117-W1177D87B46BEFE5606716BDDE60@phx.gbl&gt;
&gt; Content-Type: multipart/mixed;
&gt; 	boundary="_03df338b-5029-48d8-84e8-34f5e171dcbd_"
&gt; X-Originating-IP: [96.228.108.66]
&gt; From: Tommy Clark &lt;tomxypdq@hotmail.com&gt;
&gt; To: &lt;alayne.newton@thomson.com&gt;,
&gt;         Alexandra Droman
&gt; 	&lt;alexandra_dorman_100@yahoo.com&gt;,
&gt;         Alexis Steinkamp &lt;lexilooo@hotmail.com&gt;, &lt;asteinkamp@ameritech.net&gt;,
&gt;         &lt;attame@msn.com&gt;, Ben Greenberg
&gt; 	&lt;bprofane68@hotmail.com&gt;,
&gt;         blythe gross &lt;muppetgirl1969@yahoo.com&gt;, &lt;brenden@mediamystic.com&gt;,
&gt;         &lt;cliverping@hotmail.com&gt;, Dae-Jin Kim
&gt; 	&lt;polykor@chollian.net&gt;,
&gt;         Doug Arthur &lt;dougside@yahoo.com&gt;,
&gt;         Dox Doxiadis
&gt; 	&lt;evdoxios.doxiadis@gmail.com&gt;, &lt;doxiadis@princeton.edu&gt;,
&gt;         Haidde Sprague
&gt; 	&lt;haidee.sprague@gmail.com&gt;,
&gt;         James Lee &lt;jcl0072@hotmail.com&gt;, Jeff Dorman
&gt; 	&lt;bub365@aol.com&gt;,
&gt;         &lt;jeffejeff@gmail.com&gt;, "Jeff Lim (E-mail)"
&gt; 	&lt;jeffreyelim@hotmail.com&gt;,
&gt;         Jeff Moshman &lt;jmosesian@sonic.net&gt;, Karen Wolfe
&gt; 	&lt;kaka_2702@yahoo.com&gt;,
&gt;         &lt;keirabby@charter.net&gt;, keirabby
&gt; 	&lt;keirabby@cableone.net&gt;,
&gt;         &lt;keirmo@yahoo.com&gt;, Kerry Levenberg
&gt; 	&lt;kerry@levenbergs.com&gt;,
&gt;         Kim-Chi Steger &lt;kcsteger@aol.com&gt;, &lt;lornap78@hotmail.com&gt;,
&gt;         &lt;mbell90@sonic.net&gt;, mike bell &lt;mjb@gwava.com&gt;, &lt;myra13@aol.com&gt;,
&gt;         Natalie Stange &lt;nstange@nyc.rr.com&gt;,
&gt;         karen wolfe
&gt; 	&lt;ngocbao99@yahoo.com&gt;, &lt;polykor@chol.com&gt;,
&gt;         Rob Cliver
&gt; 	&lt;cliver@fulbrightweb.org&gt;, Sharon Lee &lt;weronron@yahoo.com&gt;,
&gt;         the Clarks
&gt; 	&lt;bosudary@comcast.net&gt;, Ward Breeze &lt;wbreeze@gunder.com&gt;,
&gt;         &lt;whosbarley@yahoo.com&gt;
&gt; Subject: N More THANKS
&gt; Date: Sun, 28 Dec 2008 18:01:25 -0800
&gt; Importance: Normal
&gt; In-Reply-To: &lt;BAY117-W268E2179DDEE877110AF11DDE60@phx.gbl&gt;
&gt; References: &lt;c46c51bb0812281737i256ae8depebb851f79b54c326@mail.gmail.com&gt;
&gt;  &lt;BAY117-W268E2179DDEE877110AF11DDE60@phx.gbl&gt;
&gt; MIME-Version: 1.0
&gt; X-OriginalArrivalTime: 29 Dec 2008 02:01:26.0088 (UTC) FILETIME=[5B42CC80:01C96959]
&gt; X-Sonic-SB-IP-RBLs: IP RBLs sorbs-spam.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r880739 - /james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractEntity.java</title>
<author><name>mwiederkehr@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200911.mbox/%3c20091116132246.8A62A238888E@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091116132246-8A62A238888E@eris-apache-org%3e</id>
<updated>2009-11-16T13:22:46Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: mwiederkehr
Date: Mon Nov 16 13:22:46 2009
New Revision: 880739

URL: http://svn.apache.org/viewvc?rev=880739&amp;view=rev
Log:
Do not check header count if maxHeaderCount is not positive (in accordance to the javadoc
of MimeEntityConfig).

Modified:
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractEntity.java

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractEntity.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractEntity.java?rev=880739&amp;r1=880738&amp;r2=880739&amp;view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractEntity.java
(original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractEntity.java
Mon Nov 16 13:22:46 2009
@@ -178,12 +178,12 @@
     }
 
     protected boolean parseField() throws MimeException, IOException {
-        int maxHeaderLimit = config.getMaxHeaderCount();
+        int maxHeaderCount = config.getMaxHeaderCount();
         for (;;) {
             if (endOfHeader) {
                 return false;
             }
-            if (headerCount &gt;= maxHeaderLimit) {
+            if (maxHeaderCount &gt; 0 &amp;&amp; headerCount &gt;= maxHeaderCount) {
                 throw new MaxHeaderLimitException("Maximum header limit exceeded");
             }
 




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r880728 - in /james/mime4j/trunk/core/src: main/java/org/apache/james/mime4j/io/MaxHeaderLengthLimitException.java main/java/org/apache/james/mime4j/parser/AbstractEntity.java test/java/org/apache/james/mime4j/parser/MimeEntityTest.java</title>
<author><name>mwiederkehr@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200911.mbox/%3c20091116123642.3774B23888CE@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091116123642-3774B23888CE@eris-apache-org%3e</id>
<updated>2009-11-16T12:36:41Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: mwiederkehr
Date: Mon Nov 16 12:36:41 2009
New Revision: 880728

URL: http://svn.apache.org/viewvc?rev=880728&amp;view=rev
Log:
Added MaxHeaderLengthLimitException (MIME4J-140).

Added:
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/io/MaxHeaderLengthLimitException.java
Modified:
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractEntity.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeEntityTest.java

Added: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/io/MaxHeaderLengthLimitException.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/io/MaxHeaderLengthLimitException.java?rev=880728&amp;view=auto
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/io/MaxHeaderLengthLimitException.java
(added)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/io/MaxHeaderLengthLimitException.java
Mon Nov 16 12:36:41 2009
@@ -0,0 +1,35 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mime4j.io;
+
+import org.apache.james.mime4j.MimeException;
+
+/**
+ * Signals a I/O error due to the total header length exceeding the maximum limit.
+ */
+public class MaxHeaderLengthLimitException extends MimeException {
+
+    private static final long serialVersionUID = 8924290744274769913L;
+
+    public MaxHeaderLengthLimitException(final String message) {
+        super(message);
+    }
+
+}

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractEntity.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractEntity.java?rev=880728&amp;r1=880727&amp;r2=880728&amp;view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractEntity.java
(original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractEntity.java
Mon Nov 16 12:36:41 2009
@@ -30,6 +30,7 @@
 import org.apache.james.mime4j.descriptor.MaximalBodyDescriptor;
 import org.apache.james.mime4j.descriptor.MutableBodyDescriptor;
 import org.apache.james.mime4j.io.LineReaderInputStream;
+import org.apache.james.mime4j.io.MaxHeaderLengthLimitException;
 import org.apache.james.mime4j.io.MaxHeaderLimitException;
 import org.apache.james.mime4j.io.MaxLineLimitException;
 import org.apache.james.mime4j.util.ByteArrayBuffer;
@@ -136,7 +137,7 @@
                 // copy it to the field buffer
                 int len = linebuf.length();
                 if (maxHeaderLen &gt; 0 &amp;&amp; fieldbuf.length() + len &gt;= maxHeaderLen)
{
-                    throw new MaxLineLimitException("Maximum header length limit exceeded");
+                    throw new MaxHeaderLengthLimitException("Maximum header length limit
exceeded");
                 }
                 if (len &gt; 0) {
                     fieldbuf.append(linebuf.buffer(), 0, len);

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeEntityTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeEntityTest.java?rev=880728&amp;r1=880727&amp;r2=880728&amp;view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeEntityTest.java
(original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeEntityTest.java
Mon Nov 16 12:36:41 2009
@@ -25,6 +25,7 @@
 import org.apache.commons.io.IOUtils;
 import org.apache.james.mime4j.MimeException;
 import org.apache.james.mime4j.io.BufferedLineReaderInputStream;
+import org.apache.james.mime4j.io.MaxHeaderLengthLimitException;
 import org.apache.james.mime4j.io.MaxHeaderLimitException;
 import org.apache.james.mime4j.io.MaxLineLimitException;
 import org.apache.james.mime4j.io.LineNumberInputStream;
@@ -423,8 +424,7 @@
         try {
             entity.advance();
             fail("MimeException caused by MaxLineLimitException should have been thrown");
-        } catch (MimeException expected) {
-            assertTrue(expected.getCause() instanceof MaxLineLimitException);
+        } catch (MaxHeaderLengthLimitException expected) {
         }
     }
 




</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Commented: (MIME4J-140) MIME4J-57 is not practical in its limits and incorrect in its RFC interpretation</title>
<author><name>&quot;Markus Wiederkehr (JIRA)&quot; &lt;mime4j-dev@james.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200911.mbox/%3c588637341.1258370979560.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c588637341-1258370979560-JavaMail-jira@brutus%3e</id>
<updated>2009-11-16T11:29:39Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/MIME4J-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12778299#action_12778299
] 

Markus Wiederkehr commented on MIME4J-140:
------------------------------------------

Patch committed, please review.

&gt; MIME4J-57 is not practical in its limits and incorrect in its RFC interpretation
&gt; --------------------------------------------------------------------------------
&gt;
&gt;                 Key: MIME4J-140
&gt;                 URL: https://issues.apache.org/jira/browse/MIME4J-140
&gt;             Project: JAMES Mime4j
&gt;          Issue Type: Bug
&gt;    Affects Versions: 0.6
&gt;            Reporter: mike bell
&gt;            Assignee: Markus Wiederkehr
&gt;
&gt; I have begun playing with Mime4j for potential use in a software project. Very quickly
I found a simple email (Which i can attach) which has about 30 TO addresses. The default was
to throw an exception
&gt; Looking at MIME4J-57 the author has misunderstood the SMTP RFC 2821. Yes you are limited
to 998 octets PER LINE, but you may FOLD as many 998 octet lines as you wish. Technically
it's 100% legal to have a 50 megabyte header value, as long as it is folded. (per 76 or 998
rules).
&gt; I think the limit chosen by default of 1000 is absurdly low - this should be 100000 minimum
or perhaps even unlimited by default. There is something to be said for a sanity check option,
for sure - but not one that is triggered so easily.
&gt; I can also open somewhat related JIRAS if people find them of merit:
&gt; 1. Documentation - defaults should be clearly stated in MimeEntityConfig javadoc. They
are not
&gt; 2. Bug - The javadocs for MimeEntityConfig claim mc.setMaxHeaderCount(-1); would defeat;
this check. It does not (I worked around with Integer.MaxValue)
&gt; 3. Design Question: Should the MimeTokenStream not have a public constructor that allows
MimeEntityConfig to be fed. As it was I had to create my own subclass to access the protected
constructor - is there a reason for this?
&gt; Thanks
&gt; Example header that blew stuff up (and I think we've all seen far far worse!) - The To
line triggers this
&gt; Return-Path: &lt;tomxypdq@hotmail.com&gt;
&gt; Received: from c.mx.sonic.net (c.mx.sonic.net [64.142.100.46])
&gt; 	by eth0.a.lds.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id mBT21U5h027864;
&gt; 	Sun, 28 Dec 2008 18:01:30 -0800
&gt; Received: from bay0-omc2-s13.bay0.hotmail.com (bay0-omc2-s13.bay0.hotmail.com [65.54.246.149])
&gt; 	by c.mx.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id mBT21QuA026548;
&gt; 	Sun, 28 Dec 2008 18:01:30 -0800
&gt; Received: from BAY117-W11 ([207.46.8.46]) by bay0-omc2-s13.bay0.hotmail.com with Microsoft
SMTPSVC(6.0.3790.3959);
&gt; 	 Sun, 28 Dec 2008 18:01:26 -0800
&gt; Message-ID: &lt;BAY117-W1177D87B46BEFE5606716BDDE60@phx.gbl&gt;
&gt; Content-Type: multipart/mixed;
&gt; 	boundary="_03df338b-5029-48d8-84e8-34f5e171dcbd_"
&gt; X-Originating-IP: [96.228.108.66]
&gt; From: Tommy Clark &lt;tomxypdq@hotmail.com&gt;
&gt; To: &lt;alayne.newton@thomson.com&gt;,
&gt;         Alexandra Droman
&gt; 	&lt;alexandra_dorman_100@yahoo.com&gt;,
&gt;         Alexis Steinkamp &lt;lexilooo@hotmail.com&gt;, &lt;asteinkamp@ameritech.net&gt;,
&gt;         &lt;attame@msn.com&gt;, Ben Greenberg
&gt; 	&lt;bprofane68@hotmail.com&gt;,
&gt;         blythe gross &lt;muppetgirl1969@yahoo.com&gt;, &lt;brenden@mediamystic.com&gt;,
&gt;         &lt;cliverping@hotmail.com&gt;, Dae-Jin Kim
&gt; 	&lt;polykor@chollian.net&gt;,
&gt;         Doug Arthur &lt;dougside@yahoo.com&gt;,
&gt;         Dox Doxiadis
&gt; 	&lt;evdoxios.doxiadis@gmail.com&gt;, &lt;doxiadis@princeton.edu&gt;,
&gt;         Haidde Sprague
&gt; 	&lt;haidee.sprague@gmail.com&gt;,
&gt;         James Lee &lt;jcl0072@hotmail.com&gt;, Jeff Dorman
&gt; 	&lt;bub365@aol.com&gt;,
&gt;         &lt;jeffejeff@gmail.com&gt;, "Jeff Lim (E-mail)"
&gt; 	&lt;jeffreyelim@hotmail.com&gt;,
&gt;         Jeff Moshman &lt;jmosesian@sonic.net&gt;, Karen Wolfe
&gt; 	&lt;kaka_2702@yahoo.com&gt;,
&gt;         &lt;keirabby@charter.net&gt;, keirabby
&gt; 	&lt;keirabby@cableone.net&gt;,
&gt;         &lt;keirmo@yahoo.com&gt;, Kerry Levenberg
&gt; 	&lt;kerry@levenbergs.com&gt;,
&gt;         Kim-Chi Steger &lt;kcsteger@aol.com&gt;, &lt;lornap78@hotmail.com&gt;,
&gt;         &lt;mbell90@sonic.net&gt;, mike bell &lt;mjb@gwava.com&gt;, &lt;myra13@aol.com&gt;,
&gt;         Natalie Stange &lt;nstange@nyc.rr.com&gt;,
&gt;         karen wolfe
&gt; 	&lt;ngocbao99@yahoo.com&gt;, &lt;polykor@chol.com&gt;,
&gt;         Rob Cliver
&gt; 	&lt;cliver@fulbrightweb.org&gt;, Sharon Lee &lt;weronron@yahoo.com&gt;,
&gt;         the Clarks
&gt; 	&lt;bosudary@comcast.net&gt;, Ward Breeze &lt;wbreeze@gunder.com&gt;,
&gt;         &lt;whosbarley@yahoo.com&gt;
&gt; Subject: N More THANKS
&gt; Date: Sun, 28 Dec 2008 18:01:25 -0800
&gt; Importance: Normal
&gt; In-Reply-To: &lt;BAY117-W268E2179DDEE877110AF11DDE60@phx.gbl&gt;
&gt; References: &lt;c46c51bb0812281737i256ae8depebb851f79b54c326@mail.gmail.com&gt;
&gt;  &lt;BAY117-W268E2179DDEE877110AF11DDE60@phx.gbl&gt;
&gt; MIME-Version: 1.0
&gt; X-OriginalArrivalTime: 29 Dec 2008 02:01:26.0088 (UTC) FILETIME=[5B42CC80:01C96959]
&gt; X-Sonic-SB-IP-RBLs: IP RBLs sorbs-spam.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r880712 - in /james/mime4j/trunk/core/src: main/java/org/apache/james/mime4j/parser/AbstractEntity.java main/java/org/apache/james/mime4j/parser/MimeEntityConfig.java test/java/org/apache/james/mime4j/parser/MimeEntityTest.java</title>
<author><name>mwiederkehr@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/james-mime4j-dev/200911.mbox/%3c20091116112548.E4FE323889D2@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091116112548-E4FE323889D2@eris-apache-org%3e</id>
<updated>2009-11-16T11:25:48Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: mwiederkehr
Date: Mon Nov 16 11:25:48 2009
New Revision: 880712

URL: http://svn.apache.org/viewvc?rev=880712&amp;view=rev
Log:
Added configuration parameter maxHeaderLen (MIME4J-140).

Modified:
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractEntity.java
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/MimeEntityConfig.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeEntityTest.java

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractEntity.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractEntity.java?rev=880712&amp;r1=880711&amp;r2=880712&amp;view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractEntity.java
(original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractEntity.java
Mon Nov 16 11:25:48 2009
@@ -126,7 +126,7 @@
         if (endOfHeader) 
             throw new IllegalStateException();
 
-        int maxLineLen = config.getMaxLineLen();
+        int maxHeaderLen = config.getMaxHeaderLen();
         LineReaderInputStream instream = getDataStream();
         ByteArrayBuffer fieldbuf = new ByteArrayBuffer(64);
 
@@ -135,8 +135,8 @@
                 // If there's still data stuck in the line buffer
                 // copy it to the field buffer
                 int len = linebuf.length();
-                if (maxLineLen &gt; 0 &amp;&amp; fieldbuf.length() + len &gt;= maxLineLen)
{
-                    throw new MaxLineLimitException("Maximum line length limit exceeded");
+                if (maxHeaderLen &gt; 0 &amp;&amp; fieldbuf.length() + len &gt;= maxHeaderLen)
{
+                    throw new MaxLineLimitException("Maximum header length limit exceeded");
                 }
                 if (len &gt; 0) {
                     fieldbuf.append(linebuf.buffer(), 0, len);

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/MimeEntityConfig.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/MimeEntityConfig.java?rev=880712&amp;r1=880711&amp;r2=880712&amp;view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/MimeEntityConfig.java
(original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/MimeEntityConfig.java
Mon Nov 16 11:25:48 2009
@@ -32,6 +32,7 @@
     private boolean strictParsing;
     private int maxLineLen;
     private int maxHeaderCount;
+    private int maxHeaderLen;
     private long maxContentLen;
     private boolean countLineNumbers;
     private String defaultContentType;
@@ -41,6 +42,7 @@
         this.strictParsing = false;
         this.maxLineLen = 1000;
         this.maxHeaderCount = 1000;
+        this.maxHeaderLen = 10000;
         this.maxContentLen = -1;
         this.countLineNumbers = false;
         this.defaultContentType = null;
@@ -149,6 +151,34 @@
         this.maxHeaderCount = maxHeaderCount;
     }
 
+    /**
+     * Returns the maximum header length limit
+     * @see #setMaxHeaderLen(int)
+     * 
+     * @return value of the maximum header length limit
+     */
+    public int getMaxHeaderLen() {
+        return maxHeaderLen;
+    }
+
+    /**
+     * Sets the maximum header length limit. Parsing of a MIME entity will be terminated

+     * with a {@link MimeException} if the total length of a header exceeds this limit.
+     * If this parameter is set to a non positive value the header length check will be
+     * disabled.
+     * &lt;p&gt;
+     * A message header may be folded across multiple lines. This configuration parameter
+     * is used to limit the total length of a header, i.e. the sum of the length of all
+     * lines the header spans across (including line terminators).
+     * &lt;p&gt;
+     * Default value: &lt;code&gt;10000&lt;/code&gt;
+     * 
+     * @param maxHeaderLen maximum header length limit
+     */
+    public void setMaxHeaderLen(int maxHeaderLen) {
+        this.maxHeaderLen = maxHeaderLen;
+    }
+
     /** 
      * Returns the maximum content length limit
      * @see #setMaxContentLen(long)

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeEntityTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeEntityTest.java?rev=880712&amp;r1=880711&amp;r2=880712&amp;view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeEntityTest.java
(original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeEntityTest.java
Mon Nov 16 11:25:48 2009
@@ -330,6 +330,9 @@
     }
 
     public void testMaxLineLimitCheck() throws Exception {
+        MimeEntityConfig config = new MimeEntityConfig();
+        config.setMaxLineLen(50);
+
         String message = 
             "To: Road Runner &lt;runner@example.org&gt;\r\n" +
             "From: Wile E. Cayote &lt;wile@example.org&gt;\r\n" +
@@ -342,10 +345,8 @@
         byte[] raw = message.getBytes("US-ASCII");
         ByteArrayInputStream instream = new ByteArrayInputStream(raw);
         LineNumberInputStream lineInput = new LineNumberInputStream(instream); 
-        BufferedLineReaderInputStream rawstream = new BufferedLineReaderInputStream(lineInput,
12); 
+        BufferedLineReaderInputStream rawstream = new BufferedLineReaderInputStream(lineInput,
12, config.getMaxLineLen()); 
         
-        MimeEntityConfig config = new MimeEntityConfig();
-        config.setMaxLineLen(50);
         MimeEntity entity = new MimeEntity(
                 lineInput,
                 rawstream,
@@ -355,25 +356,23 @@
                 config);
         
         assertEquals(EntityStates.T_START_MESSAGE, entity.getState());
-        entity.advance();
+        entity.advance(); // advances to T_START_HEADER
         assertEquals(EntityStates.T_START_HEADER, entity.getState());
-        entity.advance();
-        assertEquals(EntityStates.T_FIELD, entity.getState());
-        entity.advance();
+        entity.advance(); // reads To: into field buffer, From: into line buffer
         assertEquals(EntityStates.T_FIELD, entity.getState());
-        entity.advance();
+        entity.advance(); // reads Date: into line buffer
         assertEquals(EntityStates.T_FIELD, entity.getState());
-        entity.advance();
+        entity.advance(); // reads Subject: into line buffer
         assertEquals(EntityStates.T_FIELD, entity.getState());
         try {
-            entity.advance();
+            entity.advance(); // reads DoS: into line buffer
             fail("MimeException caused by MaxLineLimitException should have been thrown");
         } catch (MimeException expected) {
             assertTrue(expected.getCause() instanceof MaxLineLimitException);
         }
     }
     
-    public void testMaxLineLimitCheckFoldedLines() throws Exception {
+    public void testMaxHeaderLimitCheckFoldedLines() throws Exception {
         String message = 
             "To: Road Runner &lt;runner@example.org&gt;\r\n" +
             "From: Wile E. Cayote &lt;wile@example.org&gt;\r\n" +
@@ -400,7 +399,8 @@
         BufferedLineReaderInputStream rawstream = new BufferedLineReaderInputStream(lineInput,
12); 
         
         MimeEntityConfig config = new MimeEntityConfig();
-        config.setMaxLineLen(50);
+        config.setMaxLineLen(100);
+        config.setMaxHeaderLen(200);
         MimeEntity entity = new MimeEntity(
                 lineInput,
                 rawstream,
@@ -428,6 +428,47 @@
         }
     }
 
+    public void testMaxHeaderLengthMayExceedMaxLineLength() throws Exception {
+        MimeEntityConfig config = new MimeEntityConfig();
+        config.setMaxLineLen(50);
+        config.setMaxHeaderLen(130);
+
+        String message = 
+            "To: Road Runner &lt;runner@example.org&gt;\r\n" +
+            "From: Wile E. Cayote &lt;wile@example.org&gt;\r\n" +
+            "Date: Tue, 12 Feb 2008 17:34:09 +0000 (GMT)\r\n" +
+            "Subject: Mail\r\n" +
+            "X-LongHeader: xxxxxxxxxxxxxxxxxxxxxxx\r\n" +
+            "    xxxxxxxxxxxxxxxxxxxxxxx\r\n" +
+            "    xxxxxxxxxxxxxxxxxxxxxxx\r\n" +
+            "    xxxxxxxxxxxxxxxxxxxxxxx\r\n" +
+            "Content-Type: text/plain\r\n" +
+            "\r\n" +
+            "a very important message";
+        byte[] raw = message.getBytes("US-ASCII");
+        ByteArrayInputStream instream = new ByteArrayInputStream(raw);
+        LineNumberInputStream lineInput = new LineNumberInputStream(instream); 
+        BufferedLineReaderInputStream rawstream = new BufferedLineReaderInputStream(lineInput,
12, config.getMaxLineLen()); 
+        
+        MimeEntity entity = new MimeEntity(
+                lineInput,
+                rawstream,
+                null,
+                EntityStates.T_START_MESSAGE,
+                EntityStates.T_END_MESSAGE,
+                config);
+        
+        assertEquals(EntityStates.T_START_MESSAGE, entity.getState());
+        entity.advance();
+        assertEquals(EntityStates.T_START_HEADER, entity.getState());
+        for (int i = 0; i &lt; 6; i++) {
+            entity.advance();
+            assertEquals(EntityStates.T_FIELD, entity.getState());
+        }
+        entity.advance();
+        assertEquals(EntityStates.T_END_HEADER, entity.getState());
+    }
+    
     public void testMaxHeaderCount() throws Exception {
         String message = 
             "To: Road Runner &lt;runner@example.org&gt;\r\n" +




</pre>
</div>
</content>
</entry>
</feed>
