Uploaded image for project: 'Jira Service Management Data Center'
  1. Jira Service Management Data Center
  2. JSDSERVER-6037

The Service Mail Handler drops emails containing attachments with less than 3 characters

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 3.16.2, 4.0.2
    • 3.6.0, 3.7.0, 3.9.0, 3.10.0, 3.11.0, 3.12.0, 3.13.0, 3.14.0, 3.15.0
    • Email - Incoming
    • None

    Description

      Summary

      When using the Service Desk Mail Handler, if the customer replies to a notification and includes an attachment with a filename shorter than 3 characters, the email is discarded and no comment is added to the ticket.

      Steps to reproduce

      • Configure an SMTP server in ⚙ > System > Outgoing Mail
      • Create a Service Desk project
      • Configure a SD Mail Handler in Project Settings > Email Requests
      • Log into the Customer Portal as a customer, and create a Request
      • Log into the customer's mailbox and wait for the "Issue Created" Customer Notification to be received
      • Reply to this customer notification and include a file that has less than 2 characters in the filename. For example: 0

      Expected behavior

      A comment is added to the Service Desk ticket and the file is attached to it.

      Observed behavior

      • The email is discarded by Service Desk and no comment is added to the ticket
      • The customer does not receive any notification about this failure
      • The following FAILURE is shown in the UI in the SD logs:
      • The following exception is found in the incoming email logs:
        2018-09-17 14:33:31,419 ERROR [] Caesium-1-2 anonymous     Exception when MailHandlerWorker handles message: 
        java.lang.RuntimeException: Unexpected error while running action as user 'julienreyjiratestcustomer2@gmail.com'
        	at com.atlassian.pocketknife.internal.util.runner.AuthenticationContextUtilImpl.runAs(AuthenticationContextUtilImpl.java:60) [?:?]
        	at com.atlassian.servicedesk.internal.feature.emailchannel.IncomingEmailServiceImpl.inEmailContext(IncomingEmailServiceImpl.java:473) [?:?]
        	at com.atlassian.servicedesk.internal.feature.emailchannel.IncomingEmailServiceImpl.lambda$doCreateNewOrCommentOnIssueWithMailChannel$15(IncomingEmailServiceImpl.java:172) [?:?]
        	at io.atlassian.fugue.Either$Right.fold(Either.java:620) [fugue-4.5.0.jar:?]
        	at com.atlassian.servicedesk.internal.feature.emailchannel.IncomingEmailServiceImpl.doCreateNewOrCommentOnIssueWithMailChannel(IncomingEmailServiceImpl.java:170) [?:?]
        	at com.atlassian.servicedesk.internal.feature.emailchannel.IncomingEmailServiceImpl.lambda$createNewOrCommentOnIssueWithMailChannel$6(IncomingEmailServiceImpl.java:145) [?:?]
        ...
        Caused by: java.lang.IllegalArgumentException: Prefix string too short
        	at java.io.File.createTempFile(File.java:2001) [?:1.8.0_121]
        	at java.io.File.createTempFile(File.java:2070) [?:1.8.0_121]
        	at com.atlassian.servicedesk.internal.comment.InternalServiceDeskCommentServiceScala.com$atlassian$servicedesk$internal$comment$InternalServiceDeskCommentServiceScala$$createTempFile(InternalServiceDeskCommentServiceScala.scala:521) [?:?]
        	at com.atlassian.servicedesk.internal.comment.InternalServiceDeskCommentServiceScala$$anonfun$14.apply(InternalServiceDeskCommentServiceScala.scala:502) [?:?]
        

      Workaround

      There is no ideal workaround for this issue besides ensuring that customers never attach files that have less than 3 characters when replying to notifications. This can be a problem when customers use mail clients which convert images into thumbnails, since these thumbnails often have names of only 1 character.

      Notes

      This issuse only occurs with the Service Desk Mail Handler, and only when replying to a notification to comment in a ticket. It does not occur when creating an issue via email.

      Also, this issue does not occur with the JIRA Core Mail Handler which is configured in ⚙ > System > Incoming Mail (the bug was fixed for this Mail Handler in JRASERVER-1229).

      Attachments

        Issue Links

          Activity

            People

              ashubovych moofoo (Inactive)
              jrey Julien Rey
              Votes:
              4 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Backbone Issue Sync