Custom sender e-mail in Jira does not send notifications
Platform Notice: Data Center - This article 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
Whenever you configure a Service Management Project to use a different email address as sender of mail notifications as of the one configured in the Outgoing Notifications, an exception can happen if the Mail Server is not properly configured to allow this. This is because it can be seen as a security breach leading to impersonation.
Environment
Any version of Jira Data Center
Diagnosis
The following exception can be seen in the atlassian-jira-outgoing-mail.log:
2024-01-01 08:00:00,000+0100 ERROR [] Sending mailitem To='user@example.com' Subject='Ticket created' From='myproject@example.com' FromName='' Cc='' Bcc='' ReplyTo='' InReplyTo='null' MimeType='text/plain' Encoding='UTF-8' Multipart='javax.mail.internet.MimeMultipart@e31154c' MessageId='null' ExcludeSubjectPrefix=true' anonymous Mail Queue Service [c.a.mail.queue.MailQueueImpl] Error occurred in sending e-mail: To='user@example.com' Subject='Ticket created' From='myproject@example.com' FromName='' Cc='' Bcc='' ReplyTo='' InReplyTo='null' MimeType='text/plain' Encoding='UTF-8' Multipart='javax.mail.internet.MimeMultipart@e36154c' MessageId='null' ExcludeSubjectPrefix=true'
com.atlassian.mail.MailException: com.sun.mail.smtp.SMTPSendFailedException: 554 5.2.252 SendAsDenied; myjira@example.com not allowed to send as myproject@example.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:?]
at com.atlassian.jira.mail.JiraMailQueue.lambda$sendBuffer$0(JiraMailQueue.java:49) [classes/:?]
at com.atlassian.jira.util.velocity.DefaultVelocityRequestContextFactory.runWithStaticBaseUrl(DefaultVelocityRequestContextFactory.java:110) [classes/:?]
at com.atlassian.jira.util.DefaultBaseUrl.runWithStaticBaseUrl(DefaultBaseUrl.java:56) [classes/:?]
at com.atlassian.jira.mail.JiraMailQueue.sendBuffer(JiraMailQueue.java:48) [classes/:?]
at com.atlassian.jira.service.services.mail.MailQueueService.run(MailQueueService.java:21) [classes/:?]
at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:68) [classes/:?]
at com.atlassian.jira.service.ServiceRunner.runService(ServiceRunner.java:62) [classes/:?]
at com.atlassian.jira.service.ServiceRunner.runServiceId(ServiceRunner.java:44) [classes/:?]
at com.atlassian.jira.service.ServiceRunner.runJob(ServiceRunner.java:32) [classes/:?]
at com.atlassian.scheduler.core.JobLauncher.runJob(JobLauncher.java:134) [atlassian-scheduler-core-4.0.0.jar:?]
at com.atlassian.scheduler.core.JobLauncher.launchAndBuildResponse(JobLauncher.java:106) [atlassian-scheduler-core-4.0.0.jar:?]
at com.atlassian.scheduler.core.JobLauncher.launch(JobLauncher.java:90) [atlassian-scheduler-core-4.0.0.jar:?]
at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.launchJob(CaesiumSchedulerService.java:435) [atlassian-scheduler-caesium-3.0.4.jar:?]
at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeLocalJob(CaesiumSchedulerService.java:402) [atlassian-scheduler-caesium-3.0.4.jar:?]
at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.executeQueuedJob(CaesiumSchedulerService.java:380) [atlassian-scheduler-caesium-3.0.4.jar:?]
at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeJob(SchedulerQueueWorker.java:66) [atlassian-scheduler-caesium-3.0.4.jar:?]
at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.executeNextJob(SchedulerQueueWorker.java:60) [atlassian-scheduler-caesium-3.0.4.jar:?]
at com.atlassian.scheduler.caesium.impl.SchedulerQueueWorker.run(SchedulerQueueWorker.java:35) [atlassian-scheduler-caesium-3.0.4.jar:?]
at java.base/java.lang.Thread.run(Unknown Source) [?:?]
Caused by: com.sun.mail.smtp.SMTPSendFailedException: 554 5.2.252 SendAsDenied; myjira@example.com not allowed to send as myproject@example.com; [...]
Cause
The email address has security features that don't allow one authenticated users to send emails with another address.
Solution
You will need to contact your mail server administrators to allow an exception for the host here Jira is installed.