The Jira "Mail Error Queue" Health Check fails due to emails being sent to an invalid email address

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs 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

As per Jira 9.8.0 release notes, this version introduced a new health check meant to monitor the Mail Error Queue. When this health check fails, a warning will show in the UI, and also the warning below will be added to the Jira logs:

1 2024-09-10 16:50:10,767+0200 http-nio2-8080-exec-11 url: /rest/troubleshooting/1.0/check; user: jira-administrator WARN jira-administrator XXXXxXXXXXXXxX XXXXXX 127.0.0.1 /rest/troubleshooting/1.0/check [c.a.t.healthcheck.concurrent.SupportHealthCheckProcess] Health check 'Mail Error Queue' failed with severity 'warning': 'There are 10 emails in the error queue for this node.'

This KB article focuses on the common scenarios in which this Health Check fails because the Jira application is sending emails to invalid email addresses and how to identify each of these scenarios.

Environment

Jira Data Center on any version from 9.8.0.

Diagnosis

  • Check the Jira Outgoing Mail log files, and look for any error similar to the 3 errors listed below, which indicates a format error with the email address of the recipient:

    • Example of Error 1

      1 2 3 4 5 6 2024-09-11 14:20:19,611+0000 ERROR [] Sending mailitem To='test@gmail.com? ' Subject='dd' From='someserver@gmail.com' FromName='' Cc='' Bcc='' ReplyTo='' InReplyTo='null' MimeType='text/plain' Encoding='UTF-8' Multipart='javax.mail.internet.MimeMultipart@40cef0ff' MessageId='null' ExcludeSubjectPrefix=true' admin 860x2665x1 n4758h 172.29.219.204,172.50.0.2 /secure/admin/MailQueueAdmin.jspa [c.a.mail.queue.MailQueueImpl] Error occurred in sending e-mail: To='test@gmail.com? ' Subject='dd' From='someserver@gmail.com' FromName='' Cc='' Bcc='' ReplyTo='' InReplyTo='null' MimeType='text/plain' Encoding='UTF-8' Multipart='javax.mail.internet.MimeMultipart@40cef0ff' MessageId='null' ExcludeSubjectPrefix=true' com.atlassian.mail.MailException: javax.mail.internet.AddressException: Domain contains illegal character in string ``test@gmail.com?'' at com.atlassian.mail.server.impl.SMTPMailServerImpl.sendWithMessageId(SMTPMailServerImpl.java:224) [atlassian-mail-5.1.3.jar:?] at com.atlassian.mail.queue.SingleMailQueueItem.send(SingleMailQueueItem.java:38) [atlassian-mail-5.1.3.jar:?] at com.atlassian.mail.queue.MailQueueImpl.sendBufferUnderLock(MailQueueImpl.java:83) [atlassian-mail-5.1.3.jar:?] at com.atlassian.mail.queue.MailQueueImpl.sendBuffer(MailQueueImpl.java:47) [atlassian-mail-5.1.3.jar:?]
    • Example of Error 2

      1 2 3 4 5 6 7 8 9 10 11 12 2024-09-11 14:36:56,378+0000 ERROR [] Sending mailitem To='<test>' Subject='dd' From='someserver@gmail.com' FromName='' Cc='' Bcc='' ReplyTo='' InReplyTo='null' MimeType='text/plain' Encoding='UTF-8' Multipart='javax.mail.internet.MimeMultipart@686e84b0' MessageId='null' ExcludeSubjectPrefix=true' admin 876x100x1 9kq9iu 172.29.219.204,172.50.0.2 /secure/admin/MailQueueAdmin.jspa [c.a.mail.queue.MailQueueImpl] Error occurred in sending e-mail: To='<test>' Subject='dd' From='someserver@gmail.com' FromName='' Cc='' Bcc='' ReplyTo='' InReplyTo='null' MimeType='text/plain' Encoding='UTF-8' Multipart='javax.mail.internet.MimeMultipart@686e84b0' MessageId='null' ExcludeSubjectPrefix=true' com.atlassian.mail.MailException: javax.mail.SendFailedException: Invalid Addresses; nested exception is: com.sun.mail.smtp.SMTPAddressFailedException: 553-5.1.3 The recipient address <test> is not a valid RFC 5321 address. For more 553-5.1.3 information, go to 553-5.1.3 https://support.google.com/a/answer/3221692 and review RFC 5321 553 5.1.3 specifications. 4fb4d7f45d1cf-5c3ebd41cd7sm5502639a12.3 - gsmtp at com.atlassian.mail.server.impl.SMTPMailServerImpl.sendWithMessageId(SMTPMailServerImpl.java:224) [atlassian-mail-5.1.3.jar:?] at com.atlassian.mail.queue.SingleMailQueueItem.send(SingleMailQueueItem.java:38) [atlassian-mail-5.1.3.jar:?] at com.atlassian.mail.queue.MailQueueImpl.sendBufferUnderLock(MailQueueImpl.java:83) [atlassian-mail-5.1.3.jar:?] at com.atlassian.mail.queue.MailQueueImpl.sendBuffer(MailQueueImpl.java:47) [atlassian-mail-5.1.3.jar:?]
    • Example of Error 3

      1 2 3 4 2024-09-11 14:36:56,378+0000 ERROR [] Sending mailitem To='<test>' Subject='dd' From='someserver@gmail.com' FromName='' Cc='' Bcc='' ReplyTo='' InReplyTo='null' MimeType='text/plain' Encoding='UTF-8' Multipart='javax.mail.internet.MimeMultipart@686e84b0' MessageId='null' ExcludeSubjectPrefix=true' admin 876x100x1 9kq9iu 172.29.219.204,172.50.0.2 /secure/admin/MailQueueAdmin.jspa [c.a.mail.queue.MailQueueImpl] Error occurred in sending e-mail: To='<test>' Subject='dd' From='someserver@gmail.com' FromName='' Cc='' Bcc='' ReplyTo='' InReplyTo='null' MimeType='text/plain' Encoding='UTF-8' Multipart='javax.mail.internet.MimeMultipart@686e84b0' MessageId='null' ExcludeSubjectPrefix=true' com.atlassian.mail.MailException: javax.mail.SendFailedException: Invalid Addresses;    nested exception is: com.sun.mail.smtp.SMTPAddressFailedException: 550 5.1.1 <test>: Recipient address rejected:
    • Example of Error 4

      1 2 3 4 5 6 7 2024-09-11 14:50:45,028+0000 ERROR [] Sending mailitem To='test (test) <test@gmail.com>,test' Subject='dd' From='someserver@gmail.com' FromName='' Cc='' Bcc='' ReplyTo='' InReplyTo='null' MimeType='text/plain' Encoding='UTF-8' Multipart='javax.mail.internet.MimeMultipart@180a209' MessageId='null' ExcludeSubjectPrefix=true' admin 890x445x1 1p6d6du 172.29.219.204,172.50.0.2 /secure/admin/MailQueueAdmin.jspa [c.a.mail.queue.MailQueueImpl] Error occurred in sending e-mail: To='test (test) <test@gmail.com>,test' Subject='dd' From='someserver@gmail.com' FromName='' Cc='' Bcc='' ReplyTo='' InReplyTo='null' MimeType='text/plain' Encoding='UTF-8' Multipart='javax.mail.internet.MimeMultipart@180a209' MessageId='null' ExcludeSubjectPrefix=true' com.atlassian.mail.MailException: javax.mail.internet.AddressException: Illegal address in string ``(test)'' at com.atlassian.mail.server.impl.SMTPMailServerImpl.sendWithMessageId(SMTPMailServerImpl.java:224) [atlassian-mail-5.1.3.jar:?] at com.atlassian.mail.queue.SingleMailQueueItem.send(SingleMailQueueItem.java:38) [atlassian-mail-5.1.3.jar:?] at com.atlassian.mail.queue.MailQueueImpl.sendBufferUnderLock(MailQueueImpl.java:83) [atlassian-mail-5.1.3.jar:?] at com.atlassian.mail.queue.MailQueueImpl.sendBuffer(MailQueueImpl.java:47) [atlassian-mail-5.1.3.jar:?]
  • Identify the problematic recipient email address

    • In the example of Error 1, the email address is: 

      1 test@gmail.com?
    • In the example of Error 2 and 3, the email address is: 

      1 <test>
    • In the example of Error 4, the email address is: 

      1 test (test) <test@gmail.com>,test

Diagnosis for Root Cause 1

Go to the page ⚙ > User Management > Users and search for the email address identified in the logs

  • If you find a matching user (=user associated to the problematic address), then Root Cause 1 is relevant, and you came move to the Solution for Root Cause 1 section

  • If you don't find any match, move on to the Diagnosis for Root Cause 2 section.

Diagnosis for Root Cause 2

There might be an automation rule configured to send emails to an invalid email address. Let's follow the steps below to check if it's the case, and to identify the rule(s) that is/are using this incorrect email address:

  • Log into the Jira Database

  • Run the SQL query below after replacing <PROBLEMATIC_EMAIL_ADDRESS> with the problematic email address:

    1 2 3 4 select * from "AO_589059_RULE_CFG_COMPONENT" WHERE "COMPONENT" = 'ACTION' AND "TYPE" = 'jira.issue.outgoing.email' AND "VALUE" like '%<PROBLEMATIC_EMAIL_ADDRESS>%';
    • Example of query (from the 3rd example)

      1 2 3 4 5 select * from "AO_589059_RULE_CFG_COMPONENT" WHERE "COMPONENT" = 'ACTION' AND "TYPE" = 'jira.issue.outgoing.email' AND "VALUE" like '%test (test) <test@gmail.com>,test%';
    • Example of result:

      1 2 3 |COMPONENT|CONDITION_PARENT_ID|ID |PARENT_CFG_COMPONENT_ID|RULE_CONFIG_ID|SCHEMA_VERSION|SEQUENCE|TYPE |VALUE | |---------|-------------------|---|-----------------------|--------------|--------------|--------|-------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |ACTION | |45 | |9 |3 |1 |jira.issue.outgoing.email|{"from":"","fromName":"","replyTo":"","to":[{"type":"FREE","value":"test (test) <test@gmail.com>,test"}],"cc":[],"bcc":[],"subject":"dd","body":"dddd","mimeType":"text/html","convertLineBreaks":true}|
  • If you find at least 1 result (note that there might be several results)

    • Take note of the ID in the RULE_CONFIG_ID column, this is the ID of the automation rule that is sending emails to an invalid email address

    • You can move on to the section Solution for Root Cause 2 section

  • If you don't find any result, move on to the Diagnosis for Root Cause 3 section.

Diagnosis for Root Cause 3

Check if you have any script/customization from 3rd party add-on (such as ScriptRunner) that is sending emails to an invalid email 

Cause

Root Cause 1

There is a Jira user who is associated with an invalid email address. This might happen due to various reasons:

  • the user was manually created via the UI via the page ⚙ > User Management > Users with an invalid email address format

  • Jira is configured to sync users from an LDAP directory, and the LDAP directory has a user with an invalid email address format

Example of an invalid user found in the UI:

(Auto-migrated image: description temporarily unavailable)

Root Cause 2

There is an automation rule configured to send an email to an invalid email address.

Example of automation rule:

(Auto-migrated image: description temporarily unavailable)

Root Cause 3

There is a third-party add-on that is configured to send an email to an invalid email address. Since there are many add-ons on the Atlassian Marketplace that can perform this type of action, it is difficult to list all of them.

Solution

Solution for Root Cause 1

Log into Jira as an System Admin user and fix the invalid user as per either of the step below:

  • If the user comes from Jira's internal directory or an LDAP directory configured with read/write permissions, manually edit this user's email address via the UI

  • If the user comes from an LDAP directory configured without read/write permissions, you will need to fix the email address on the LDAP side, and then sync Jira with this LDAP

Solution for Root Cause 2

Log into Jira and fix the problematic automation rule as per the steps below:

  • Go to the URL below after replacing <RULE_ID> with the rule ID identified in the diagnostic steps:

    1 <JIRA_BASE_URL>/secure/AutomationGlobalAdminAction!default.jspa#/rule/<RULE_ID>
  • Fix the email address in the Send Email action of the rule

Solution for Root Cause 3

This solution will depend on the 3rd party add-on that you identified as the culprit.

Updated on March 20, 2025

Still need help?

The Atlassian Community is here for you.