james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <mime4j-...@james.apache.org>
Subject [jira] [Commented] (MIME4J-259) MboxIterator does not handle EOL = CRLF
Date Wed, 08 Mar 2017 14:18:37 GMT

    [ https://issues.apache.org/jira/browse/MIME4J-259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15901319#comment-15901319

Sebb commented on MIME4J-259:

As a work-round, the following FromLine setting seems to do the trick:

fromLine("^From \\S+.*\\d{4}\r?(?=\n)")

i.e. explicitly match LF optionally preceeded by CR but don't include the LF in the match.
The +1 in the code then skips the LF.

> MboxIterator does not handle EOL = CRLF
> ---------------------------------------
>                 Key: MIME4J-259
>                 URL: https://issues.apache.org/jira/browse/MIME4J-259
>             Project: James Mime4j
>          Issue Type: Bug
>            Reporter: Sebb
> The MboxIterator class assumes that the EOL consists of a single character, so it increments
findEnd by 1 to get the start of the message.
> This causes problems for files which have a CRLF line ending, because the generated message
contains a leading LF which confuses the parser.
> The iterator should ensure that the entire EOL is skipped.
> However it might be better to keep the From_ line in the returned message.
> The parser can then process it to extract its data.

This message was sent by Atlassian JIRA

View raw message