Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-3901

Indexing skipped for email with weird content-disposition

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.7.0
    • 3.8.0
    • elasticsearch
    • None

    Description

      Content-Disposition: attachment; 
              filename*=utf-8''4%P001!.DOC;
              filename="4%P001!.DOC"
      

      Lead to:

      java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - Error at index 0 in: \"P0\"
      	at java.base/java.net.URLDecoder.decode(Unknown Source)
      	at java.base/java.net.URLDecoder.decode(Unknown Source)
      	at org.apache.james.mime4j.util.MimeParameterMapping.decodeParameterValue(MimeParameterMapping.java:55)
      	at org.apache.james.mime4j.util.MimeParameterMapping.addParameter(MimeParameterMapping.java:39)
      	at org.apache.james.mime4j.field.ContentDispositionFieldLenientImpl.parse(ContentDispositionFieldLenientImpl.java:165)
      	at org.apache.james.mime4j.field.ContentDispositionFieldLenientImpl.getDispositionType(ContentDispositionFieldLenientImpl.java:72)
      	at org.apache.james.mime4j.message.MaximalBodyDescriptor.getContentDispositionType(MaximalBodyDescriptor.java:183)
      	at org.apache.james.mailbox.opensearch.json.MimePartParser.extractMimePartBodyDescription(MimePartParser.java:133)
      	at org.apache.james.mailbox.opensearch.json.MimePartParser.manageBodyExtraction(MimePartParser.java:120)
      	at org.apache.james.mailbox.opensearch.json.MimePartParser.processMimePart(MimePartParser.java:87)
      	at org.apache.james.mailbox.opensearch.json.MimePartParser.parse(MimePartParser.java:69)
      	at org.apache.james.mailbox.opensearch.json.IndexableMessage$Builder.instantiateIndexedMessage(IndexableMessage.java:111)
      	at org.apache.james.mailbox.opensearch.json.IndexableMessage$Builder.build(IndexableMessage.java:76)
      	at org.apache.james.mailbox.opensearch.json.MessageToOpenSearchJson.convertToJson(MessageToOpenSearchJson.java:74)
      	at org.apache.james.mailbox.opensearch.events.OpenSearchListeningMessageSearchIndex.generateIndexedJson(OpenSearchListeningMessageSearchIndex.java:175)
      	at org.apache.james.mailbox.opensearch.events.OpenSearchListeningMessageSearchIndex.add(OpenSearchListeningMessageSearchIndex.java:169)
      	at org.apache.mailbox.tools.indexer.ReIndexerPerformer.lambda$index$23(ReIndexerPerformer.java:318)
      

      Impact: the following message cannot be indexed...

      Manage the error of James side so the the message is partially indexed (better than nothing!)

      Attachments

        Activity

          People

            Unassigned Unassigned
            btellier Benoit Tellier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 40m
                40m