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

Issue creation via email failed if email subject exceeds 255 characters

      NOTE: This bug report is for JIRA Service Desk Server. Using JIRA Service Desk Cloud? See the corresponding bug report.

      Problem Description

      The SD incoming mail stops processing further.

      Diagnostic

      On the logs with incoming mail debug enabled, it seems to stuck on a particular mail.

      2015-03-20 11:25:09,133 atlassian-scheduler-quartz1.clustered_Worker-2 DEBUG ServiceRunner     [mail.incoming.jepp.processor] Starts processing mail item [id: 3063] ...
      2015-03-20 11:25:09,133 atlassian-scheduler-quartz1.clustered_Worker-2 DEBUG ServiceRunner     [mail.incoming.jepp.processor] Checking if mail item [id: 3063] is a mail loop ...
      2015-03-20 11:25:09,138 atlassian-scheduler-quartz1.clustered_Worker-2 DEBUG ServiceRunner     [mail.incoming.jepp.processor] Detected mail item [id: 3063] as a mail loop
      

      The example above shows ID: 3063

      Verify which ID being stuck:

      jira=# select "ID" from "AO_2C4E5C_MAILITEMCHUNK" where "MAIL_ITEM_ID" = 3063;
        ID
      ------
       3123
      (1 row)
      

      example above returns 3123 by placing "MAIL_ITEM_ID" = 3063

      Then check the content by base64 decode the result obtained:

      select "MIME_MSG_CHUNK" from "AO_2C4E5C_MAILITEMCHUNK" where "ID" = 3123;
      

      Explanation

      Subject field that carries more than 255 characters will cause the SQL injection to return error therefore hitting into a halt.

      Workaround

      If you wish to recover the email content before deletion, follow the KB below:

      Then you can proceed with deleting the affected ID that stuck, refer to the steps below:

      1. Backup the database
      2. Delete following the command below:
        delete from "AO_2C4E5C_MAILITEMCHUNK" where "MAIL_ITEM_ID" = <id from above>;
        delete from "AO_2C4E5C_MAILITEM" where "ID" = <id from above>;
        

        Replace the ID with the ID found at the Diagnostic area above 3063 for this example

            [JSDSERVER-1685] Issue creation via email failed if email subject exceeds 255 characters

            Deyves (Inactive) made changes -
            Link New: This issue was cloned as JSDSERVER-6441 [ JSDSERVER-6441 ]
            Owen made changes -
            Workflow Original: JSD Bug Workflow v5 - TEMP [ 2304558 ] New: JAC Bug Workflow v3 [ 3125038 ]
            Status Original: Done [ 10044 ] New: Closed [ 6 ]
            Katherine Yabut made changes -
            Workflow Original: JSD Bug Workflow v5 [ 2058396 ] New: JSD Bug Workflow v5 - TEMP [ 2304558 ]
            Katherine Yabut made changes -
            Workflow Original: JSD Bug Workflow v5 - TEMP [ 2055394 ] New: JSD Bug Workflow v5 [ 2058396 ]
            Katherine Yabut made changes -
            Workflow Original: JSD Bug Workflow v5 [ 1956395 ] New: JSD Bug Workflow v5 - TEMP [ 2055394 ]
            Katherine Yabut made changes -
            Workflow Original: JSD Bug Workflow v4 [ 1616126 ] New: JSD Bug Workflow v5 [ 1956395 ]
            jonah (Inactive) made changes -
            Description Original: *Problem Description*

            The SD incoming mail stops processing further.

            *Diagnostic*

            On the logs with incoming mail debug enabled, it seems to stuck on a particular mail.

            {noformat}
            2015-03-20 11:25:09,133 atlassian-scheduler-quartz1.clustered_Worker-2 DEBUG ServiceRunner [mail.incoming.jepp.processor] Starts processing mail item [id: 3063] ...
            2015-03-20 11:25:09,133 atlassian-scheduler-quartz1.clustered_Worker-2 DEBUG ServiceRunner [mail.incoming.jepp.processor] Checking if mail item [id: 3063] is a mail loop ...
            2015-03-20 11:25:09,138 atlassian-scheduler-quartz1.clustered_Worker-2 DEBUG ServiceRunner [mail.incoming.jepp.processor] Detected mail item [id: 3063] as a mail loop
            {noformat}
            (i) The example above shows {{ID: 3063}}

            Verify which ID being stuck:
            {noformat}
            jira=# select "ID" from "AO_2C4E5C_MAILITEMCHUNK" where "MAIL_ITEM_ID" = 3063;
              ID
            ------
             3123
            (1 row)
            {noformat}
            (i) example above returns {{3123}} by placing {{"MAIL_ITEM_ID" = 3063}}

            Then check the content by base64 decode the result obtained:
            {noformat}
            select "MIME_MSG_CHUNK" from "AO_2C4E5C_MAILITEMCHUNK" where "ID" = 3123;
            {noformat}

            *Explanation*

            Subject field that carries more than 255 characters will cause the SQL injection to return error therefore hitting into a halt.

            *Workaround*

            If you wish to recover the email content before deletion, follow the KB below:

            * https://confluence.atlassian.com/pages/viewpage.action?pageId=728138770

            Then you can proceed with deleting the affected ID that stuck, refer to the steps below:
            # Backup the database
            # Delete following the command below:
            {noformat}
            delete from "AO_2C4E5C_MAILITEMCHUNK" where "MAIL_ITEM_ID" = <id from above>;
            delete from "AO_2C4E5C_MAILITEM" where "ID" = <id from above>;
            {noformat}
            (i) Replace the ID with the ID found at the Diagnostic area above {{3063 for this example}}
            New: {panel:bgColor=#e7f4fa}
              *NOTE:* This bug report is for *JIRA Service Desk Server*. Using *JIRA Service Desk Cloud*? [See the corresponding bug report|http://jira.atlassian.com/browse/JSDCLOUD-1685].
              {panel}

            *Problem Description*

            The SD incoming mail stops processing further.

            *Diagnostic*

            On the logs with incoming mail debug enabled, it seems to stuck on a particular mail.

            {noformat}
            2015-03-20 11:25:09,133 atlassian-scheduler-quartz1.clustered_Worker-2 DEBUG ServiceRunner [mail.incoming.jepp.processor] Starts processing mail item [id: 3063] ...
            2015-03-20 11:25:09,133 atlassian-scheduler-quartz1.clustered_Worker-2 DEBUG ServiceRunner [mail.incoming.jepp.processor] Checking if mail item [id: 3063] is a mail loop ...
            2015-03-20 11:25:09,138 atlassian-scheduler-quartz1.clustered_Worker-2 DEBUG ServiceRunner [mail.incoming.jepp.processor] Detected mail item [id: 3063] as a mail loop
            {noformat}
            (i) The example above shows {{ID: 3063}}

            Verify which ID being stuck:
            {noformat}
            jira=# select "ID" from "AO_2C4E5C_MAILITEMCHUNK" where "MAIL_ITEM_ID" = 3063;
              ID
            ------
             3123
            (1 row)
            {noformat}
            (i) example above returns {{3123}} by placing {{"MAIL_ITEM_ID" = 3063}}

            Then check the content by base64 decode the result obtained:
            {noformat}
            select "MIME_MSG_CHUNK" from "AO_2C4E5C_MAILITEMCHUNK" where "ID" = 3123;
            {noformat}

            *Explanation*

            Subject field that carries more than 255 characters will cause the SQL injection to return error therefore hitting into a halt.

            *Workaround*

            If you wish to recover the email content before deletion, follow the KB below:

            * https://confluence.atlassian.com/pages/viewpage.action?pageId=728138770

            Then you can proceed with deleting the affected ID that stuck, refer to the steps below:
            # Backup the database
            # Delete following the command below:
            {noformat}
            delete from "AO_2C4E5C_MAILITEMCHUNK" where "MAIL_ITEM_ID" = <id from above>;
            delete from "AO_2C4E5C_MAILITEM" where "ID" = <id from above>;
            {noformat}
            (i) Replace the ID with the ID found at the Diagnostic area above {{3063 for this example}}
            jonah (Inactive) made changes -
            Link New: This issue relates to JSDCLOUD-1685 [ JSDCLOUD-1685 ]
            Michael S made changes -
            Remote Link Original: This issue links to "Page (Extranet)" [ 268755 ]
            Michael S made changes -
            Remote Link New: This issue links to "Page (Extranet)" [ 268755 ]

              dnguyen@atlassian.com Duy Nguyen JSM
              rgee Richie Gee (Inactive)
              Affected customers:
              1 This affects my team
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: