Jira Service Management not rejecting or filtering automatic reply emails from certain users
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Jira Service Management incoming mail channel is not rejecting or filtering automatic reply emails from certain users. As a result, some automatic replies are getting created as a new issue when they are not supposed to.
Environment
Any version of Jira Service Management
Exchange Mail server
Diagnosis
- The Auto-reply email filter is enabled and working. This can be confirmed by
- Verifying that the auto-reply-mail-filter module is enabled
- Verifying that other automatic replies are correctly being rejected by the filter when checking Processing Log in (Setting > Applications > Email requests > View Log) or (Project > Project settings > Email requests > View Log)
- Affected emails are Microsoft Exchange's Out of Office automatic replies
- In addition, there seem to be a specific type of configuration whereby OOO replies will only be sent to a user once
- When viewing the email in the receiving inbox from Outlook UI, the auto-submitted: auto-generated exist in the email
- When extracting the same email which was processed by Jira from the AO_2C4E5C_MAILITEMCHUNK.MIME.MIME_MSG_CHUNK DB column and using a base64 decoder, we can see that the auto-submitted: auto-generated does not exist in the record
- Enable -Dmail.debug=true and analyze the stack trace when the email is being sent from Exchange to Jira. We can see that Exchange does not send the auto-submitted: auto-generated header to Jira in the email.
Cause
The email which Jira receives from the Exchange does not contain the auto-submitted: auto-generated header. Due to this, the email will be processed like other regular emails and not filtered/rejected by the auto-reply-mail-filter filter. This is confirmed by:
- Analyzing the traces when -Dmail.debug=true is enabled (refer to Setting properties and options on startup). The traces here are exactly what the mail server sends to Jira (it includes all headers and entire contents of the email). As the relevant header is not found here, we can confirm that Exchange doesn't actually send the header to Jira.
- Checking AO_2C4E5C_MAILITEMCHUNK.MIME.MIME_MSG_CHUNK column. This column stores the full content of the email (base64 encoded) which Jira receives from the mail server. This column is what Jira will process to create/comment in issues. Again, the relevant header does not exist in this contents of this column, suggesting that Jira didn't actually receive the header from the mail server.
It seems that Microsoft Exchange has some specific method/scenario where viewing from the UI will show this header, but the header will not actually be sent to external applications.
Solution
No recommended solution within Jira at the moment. Please reach out to your mail server admin or vendor to understand why and how the header is sent/not sent to external applications polling the inbox. As long as Jira receives the relevant header, Jira would process/reject it accordingly.