Uploaded image for project: 'James Mime4j'
  1. James Mime4j
  2. MIME4J-242

Patch MboxIterator to support From Lines without '@'

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.8.0
    • 0.8.0
    • None
    • None

    Description

      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 ieugen@apache.org 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?

      Attachments

        1. mime4j-from-line-patch.txt
          6 kB
          Ioan Eugen Stan

        Activity

          People

            ieugen Ioan Eugen Stan
            ieugen Ioan Eugen Stan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: