Uploaded image for project: 'James Mailbox'
  1. James Mailbox
  2. MAILBOX-395

Lenient Mime charset parsing

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.4.0
    • 3.5.0
    • elasticsearch

    Description

      We encountered the following error, leading to not indexed messages:

      10:26:20.800 ESC[1;31m[ERROR]ESC[0;39m o.a.j.m.e.GroupConsumerRetry - Exception happens when handling event after 0 retries
      java.nio.charset.IllegalCharsetNameException: %CHARSET
              at java.nio.charset.Charset.checkName(Charset.java:315)
              at java.nio.charset.Charset.lookup2(Charset.java:484)
              at java.nio.charset.Charset.lookup(Charset.java:464)
              at java.nio.charset.Charset.forName(Charset.java:528)
              at java.util.Optional.map(Optional.java:215)
              at org.apache.james.mailbox.elasticsearch.json.MimePartParser.extractMimePartBodyDescription(MimePartParser.java:125)
              at org.apache.james.mailbox.elasticsearch.json.MimePartParser.manageBodyExtraction(MimePartParser.java:112)
              at org.apache.james.mailbox.elasticsearch.json.MimePartParser.processMimePart(MimePartParser.java:79)
              at org.apache.james.mailbox.elasticsearch.json.MimePartParser.parse(MimePartParser.java:61)
              at org.apache.james.mailbox.elasticsearch.json.IndexableMessage$Builder.instantiateIndexedMessage(IndexableMessage.java:109)
              at org.apache.james.mailbox.elasticsearch.json.IndexableMessage$Builder.build(IndexableMessage.java:75)
              at org.apache.james.mailbox.elasticsearch.json.MessageToElasticSearchJson.convertToJsonWithoutAttachment(MessageToElasticSearchJson.java:78)
              at org.apache.james.mailbox.elasticsearch.events.ElasticSearchListeningMessageSearchIndex.generateIndexedJson(ElasticSearchListeningMessageSearchIndex.java:160)
              at org.apache.james.mailbox.elasticsearch.events.ElasticSearchListeningMessageSearchIndex.add(ElasticSearchListeningMessageSearchIndex.java:145)
              at org.apache.james.mailbox.store.search.ListeningMessageSearchIndex.lambda$handleAdded$1(ListeningMessageSearchIndex.java:100)
      

      Charset parsing is optinal, thus I believe we could sinply INFO log & ignore such failures instead of crashing the whole indexing.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: