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

Content-Type parameter values that contain only digits are ignored

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.3, 0.4
    • 0.3, 0.4
    • None
    • None
    • Any

    Description

      Parameter values in the Content-Type message header are ignored if they only contain digits. This is a particular problem if a message contains an unquoted boundary string that contains only digits, it is not recognised as a valid boundary string and therefore the a Multipart object is created that fails the Message.isMultipart() test.

      Attached test case shows the problem

      The ContentTypeParser.jj source for value parsing is

      String value() :

      {Token t;}
      {
      ( t=<ATOKEN>
      | t=<QUOTEDSTRING>
      )
      { return t.image; }
      }

      however, if a value contains only digits, it is parsed as <DIGITS>, so will not be assigned.

      Sensible solution seems to be to change the value() implementation in JavaCC source to include digit. Patch details

      — ContentTypeParser.jj 2007-05-25 02:04:09.000000000 +1000
      +++ ContentTypeParserFix.jj 2008-03-19 08:44:14.109375000 +1100
      @@ -122,6 +122,7 @@
      {Token t;}

      {
      ( t=<ATOKEN>
      +| t=<DIGITS>

      t=<QUOTEDSTRING>
      ) { return t.image; }

      Attachments

        1. MessageTest.java
          5 kB
          Antony Bowesman

        Activity

          People

            Unassigned Unassigned
            adb Antony Bowesman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified