Automation For Jira - The Send Email action does not send an email to all the recipients
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
When using Automation For Jira, it is possible to configure a rule that will automatically send emails to a list of users by adding to the recipient list:
- a user picker field (Reporter, Assignee, Custom Field...)
- a group picker field
- a group
- specific email addresses
- the user who initiated the rule
The purpose of this article is to list the most common scenarios where the rule might fail to send the email to some or all the users as per the the rule configuration.
環境
- 8.0.0 以降の任意のバージョンの Jira Server/Data Center
- Automation For Jira (A4J) on any version
Note about the "Send Email" action
Something that is very important to note about the Send Email action is that it works differently than the regular Jira notification feature. The table below lists the main differences between both mail features.
Automation "Send Email" action | Jira Notification feature |
---|---|
Users are not required to have Jira application access to receive an email from the rule. | Users are required to have Jira application access to receive a Jira notification. |
Users are not required to have the permission to view the issue, is the Send Email action contains date related to a specific Jira issue. | Users are required to have the permission to view the issue, if a Jira notification is triggered from a specific Jira issue. |
If multiple users are eligible to receive an email from the rule, the rule will send 1 single email and will concatenate all the user email addresses into the "To" header (or "CC" or "BCC").
| The Jira notification feature will send 1 individual email per Jira user eligible to receive a notification from an event (as per the notification scheme configuration). |
The rule can only send an email to the first 100 users from a Jira group.
| There is no limitation for the number of Jira users that can receive a Jira notification from an event (as per the notification scheme configuration). |
診断
To troubleshoot this type of issue and to identify which root cause might be relevant, please follow the steps below:
- Go to the page ⚙ > System > Logging and Profiling
- [送信メールのログ] で [有効化] をクリック
- Then underneath that click Enable Debugging
- Replicate the issue by triggering the rule that is sending the email
- Check the the Jira outgoing mail logs in the file <JIRA_HOME>/log/atlassian-jira-outgoing-mail.log
- Look for entries that contain the string "Sending mailitem To=" along with "Subject=<SUBJECT_FROM_ACTION>" (<SUBJECT_FROM_ACTION> being the subject configured in the "Send Email" action)
例:
2024-11-26 14:43:25,700+0000 DEBUG [] Sending mailitem To='someaddress2@atlassian.com,someaddress@atlassian.com,someaddress3@atlassian.com' Subject='Test from A4J' From='jiraoutgoingmailserver@gmail.com' FromName='' Cc='' Bcc='' ReplyTo='' InReplyTo='null' MimeType='text/plain' Encoding='UTF-8' Multipart='javax.mail.internet.MimeMultipart@1f56bfe9' MessageId='null' ExcludeSubjectPrefix=true' admin 883x2771x1 yh1nw2 172.29.211.209,172.50.0.3 /secure/admin/MailQueueAdmin.jspa [c.atlassian.mail.outgoing] Message was sent with Message-Id <465617458.15.1732632205200@d7a7a59de671>
If you see the error "Invalid Addresses" in the logs, similar to one shown below, then Root Cause 1 is relevant:
2024-11-26 14:34:00,899+0000 ERROR [] Sending mailitem To='héy@gmail.com,anotheruser@gmail.com,someuser@gmail.com' Subject='Test from A4J' From='jiraoutgoingmailserver@gmail.com' FromName='' Cc='' Bcc='' ReplyTo='' InReplyTo='null' MimeType='text/plain' Encoding='UTF-8' Multipart='javax.mail.internet.MimeMultipart@75ee25b6' MessageId='null' ExcludeSubjectPrefix=true' anonymous Mail Queue Service [c.a.mail.queue.MailQueueImpl] Error occurred in sending e-mail: To='héy@gmail.com,anotheruser@gmail.com,someuser@gmail.com' Subject='Test from A4J' From='jiraoutgoingmailserver@gmail.com' FromName='' Cc='' Bcc='' ReplyTo='' InReplyTo='null' MimeType='text/plain' Encoding='UTF-8' Multipart='javax.mail.internet.MimeMultipart@75ee25b6' MessageId='null' ExcludeSubjectPrefix=true' com.atlassian.mail.MailException: javax.mail.SendFailedException: Invalid Addresses; nested exception is: com.sun.mail.smtp.SMTPAddressFailedException: 555-5.5.2 Syntax error, cannot decode response. For more information, go to 555-5.5.2 https://support.google.com/a/answer/3221692 and review RFC 5321 555 5.5.2 specifications. ffacd0b85a97d-3825fd04ec7sm13503049f8f.110 - gsmtp at com.atlassian.mail.server.impl.SMTPMailServerImpl.sendWithMessageId(SMTPMailServerImpl.java:240) [atlassian-mail-6.0.2.jar:?] at com.atlassian.mail.queue.SingleMailQueueItem.send(SingleMailQueueItem.java:39) [atlassian-mail-6.0.2.jar:?] at com.atlassian.jira.mail.CountingMailQueueItemWrapper.send(CountingMailQueueItemWrapper.java:26) [classes/:?] at com.atlassian.mail.queue.MailQueueImpl.sendBufferUnderLock(MailQueueImpl.java:83) [atlassian-mail-6.0.2.jar:?] at com.atlassian.mail.queue.MailQueueImpl.sendBuffer(MailQueueImpl.java:47) [atlassian-mail-6.0.2.jar:?]
- If you don't see any error, move on to the next steps below
- Check the header that contains the list of recipients configured in the automation rule (To=, Cc= or Bcc= depending on the rule configuration)
- If you see that the list of recipient contains exactly 100 email addresses, and if the rule was configured to send an email to a group of more than 100 users, then Root Cause 2 is relevant
- If the list of recipients does not contain exactly 100 email addresses, then Root Cause 3 "might" be relevant
- Look for entries that contain the string "Sending mailitem To=" along with "Subject=<SUBJECT_FROM_ACTION>" (<SUBJECT_FROM_ACTION> being the subject configured in the "Send Email" action)
原因
Root Cause 1 - At least one of the recipient of the email has an invalid address
If at least one of the recipient of the email has an invalid address (for example héy@gmail.com, which contains the invalid character é), the rule will fail to send the email to all the recipients, even if the other recipients have a correct address. The reason why other recipients will not receive the email is because the Send Email action will send 1 single email with all the user email addresses in the recipient list (instead of sending 1 separate email to each recipient). If at least 1 address is invalid, the SMTP Mail Server will reject the email.
Root Cause 2 - The "Send Email" action can only send emails to 100 users max
The Send Email action can only send an email to the first 100 users of a Jira group. If a group contains more than 100 users, any user located after the 100th user will not receive the email.
There is an open feature request meant to change this behavior:
JIRAAUTOSERVER-859
-
Allow the "Send Email" action send emails to all users from groups having more than 100 users
Gathering Interest
Root Cause 3 - The SMTP Mail Server is configured with a recipient limit
Some mail server such as Exchange servers can be configured with a recipient limit, as described in this Microsoft Documentation about Recipient limits. As mentioned in this documentation, Exchange Servers have a setting called Maximum number of recipients in a message that's sent by the specific sender which is unlimited by default, but which can be changed to a specific value.
Since the Send Email action will send 1 single email with all the user email addresses in the recipient list, if the Mail Server is configured with a recipient limit, it is possible that the rule will either completely fail, or will only be able to send the email to a limited number of users, depending on how the SMTP Mail Server handles this limit.
ソリューション
根本原因の解決策 1
- Identify the invalid email address(es) in the error from outgoing mail logs (look for invalid email characters, such as è, ë, é, ä, etc...)
- Go to Jira's user management page in ⚙ > User Management > Users
- Search for the invalid email address to identify the user this address belongs to, and fix it
Note that, if the user was synced from an external LDAP directory, you might have to fix the email address in the LDAP directory first and then sync Jira with this directory
根本原因の解決策 2
Due to the feature limitation, there is no straight forward solution to it.
One possible solution consists in:
- Splitting the group into 2 smaller groups of 100 users max
- Splitting the Send Email action into 2 separate Send Email actions, and configuring each of them with a different group
根本原因の解決策 3
For this solution, we recommend reaching out to your Mail Server administrator to ask then to increase the recipient limit.