[
https://issues.apache.org/jira/browse/MIME4J-242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14092055#comment-14092055
]
Ioan Eugen Stan commented on MIME4J-242:
----------------------------------------
I would keep both variants of the regular expression to match FROM lines, with
a good javadoc, so users can use any of them in their code. I would also move
the 'mbox != null' check inside the constructor - this way we make sure we
don't create an object in an inconsistent state.
> Patch MboxIterator to support From Lines without '@'
> ----------------------------------------------------
>
> Key: MIME4J-242
> URL: https://issues.apache.org/jira/browse/MIME4J-242
> Project: James Mime4j
> Issue Type: Improvement
> Affects Versions: 0.8.0
> Reporter: Ioan Eugen Stan
> Assignee: Ioan Eugen Stan
> Fix For: 0.8.0
>
> Attachments: mime4j-from-line-patch.txt
>
>
> Submitted via email by Wolfgang Fahl:
> http://markmail.org/message/frtqsotb2vsc7sfl?q=mime4j+patch+included
> please find attached a patch.
> it uses the following fromline pattern:
> static final String DEFAULT = "^From \\S+.*\\d{4}$";
> so that it matches more lines.
> 1. From [email protected] Fri Sep 09 14:04:52 2011
> 2. From MAILER-DAEMON Wed Oct 05 21:54:09 2011
> 3. From - Wed Apr 02 06:51:08 2014
> so looking for an "@" sign is not enforced any more.
> The patch fixes a typo:
> - private Matcher fromLineMathcer;
> + private Matcher fromLineMatcher;
> in many places of the source code.
> It adds a reference to the original mbox File so that the error message:
> + if (mbox!=null)
> + path=mbox.getPath();
> + throw new IllegalArgumentException("File "+path+" does not
> contain From_ lines that match the pattern
> '"+MESSAGE_START.pattern()+"'! Maybe not be a valid Mbox.");
> can be improved.
> Who is going to check this patch and what needs to be done to get it
> into the official repo?
> I would also like to add more test cases and especially include some
> dummy mboxes. And as mentioned I'd like to check the iterator against
> all my Thunderbird mboxes to check
> whether it will successfully parse them all. Also I am offering to write
> a few "tutorial lines". Where would I have to put these?
--
This message was sent by Atlassian JIRA
(v6.2#6252)