Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-32614

Weird content-type prevents attachments to be processed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 11.5 [Tentative]
    • Fix Version/s: 12.0
    • Component/s: Email Archive
    • Labels:
    • 11 status:
      Please Merge
    • Test Plan:
      Hide

      I am not able to reproduce the Thunderbird environment in my computer, but I have a mail in my inbox with the bad content-type that I can use to test the issue (and their patch).

      Just resending this mail to any mailarchive address (configured to accept mails from any address) causes the stacktrace.

      Show
      I am not able to reproduce the Thunderbird environment in my computer, but I have a mail in my inbox with the bad content-type that I can use to test the issue (and their patch). Just resending this mail to any mailarchive address (configured to accept mails from any address) causes the stacktrace.

      Description

      We have found a weird configuration in an email client (Thunderbird 45.3.0 on Windows 7) that is sending attachments with this content-type:

      Content-Type: application/$row[1];
      name="ENTREGAACTASGrado (2).pdf"
      Content-Transfer-Encoding: base64
      Content-Disposition: attachment;
      filename="ENTREGAACTASGrado (2).pdf"

      and, while Thunderbird seems to ignore the bad content-type and shows correctly the attachment, the $row[1] is throwing an exception in MailArchive when parsing the parameters:

      TYPE: application/$row[1];name="ENTREGAACTASGrado (2).pdf"
      15-jun-2017 14:42:25.036 WARN [org.subethamail.smtp.server.Session-/130.206.163.58:39105] org.sakaiproject.mailarchive.SakaiMessageHandlerFactory.data MessagingException: service(): msg.getContent() threw: javax.mail.internet.ParseException: Expected ';', got "["
      javax.mail.internet.ParseException: Expected ';', got "["
      at javax.mail.internet.ParameterList.<init>(ParameterList.java:289)
      at javax.mail.internet.ContentType.<init>(ContentType.java:114)
      at org.sakaiproject.mailarchive.SakaiMessageHandlerFactory.parseParts(SakaiMessageHandlerFactory.java:687)
      at org.sakaiproject.mailarchive.SakaiMessageHandlerFactory.parseParts(SakaiMessageHandlerFactory.java:654)
      at org.sakaiproject.mailarchive.SakaiMessageHandlerFactory$1.data(SakaiMessageHandlerFactory.java:272)
      at org.subethamail.smtp.command.DataCommand.execute(DataCommand.java:64)

      Though this is a bug of Thunderbird (the $row seems a php variable badly coded), a simple deletion of the square brackets in the content-type fixes the issue. Applied when content-type has been already compared with the known values, it should be harmless.

        Gliffy Diagrams

          Zeplin

            Attachments

              Activity

                People

                Assignee:
                daniel.merino Daniel Merino Echeverría
                Reporter:
                daniel.merino Daniel Merino Echeverría
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    Git Integration