How to get the message id of the email notification that is sent successfully from confluence
Platform Notice: Server, Data Center, and Cloud By Request - This article was written for the Atlassian server and data center platforms but may also be useful for Atlassian Cloud customers. If completing instructions in this article would help you, please contact Atlassian Support and mention it.
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
Problem
A user is not receiving email notifications from Confluence. On checking the logs you don't see any errors, You were also able to successfully send a test email to the user, however, the user says that they have not received the email.
In this case, You can track the message ID for the message that is sent by Confluence so it can be used by the mail server team to track where the email is routed.
Solution
- Go to > General Configuration > Logging and Profiling.
- select a cluster node.
- Locate "com.atlassian.confluence.mail", and change the logging level to DEBUG
- Save changes
- Remember, your changes will not be written to the log4j.properties file and will be discarded when you next stop Confluence.
- On the same cluster node, send a test email to the "user"
In atlassian-confluence-outgoing-mail.log , you would see logs such as the below if a successful mail was sent out of the Confluence application to the mail server
2024-04-17 07:23:38,939 DEBUG [http-nio-8090-exec-27 url: /confluence/admin/mail/dosendtestemail.action; user: xxxx [atlassian.confluence.mail.ConfluenceMailServerManager] getSessionFromServerManager Getting session 2024-04-17 07:23:38,942 DEBUG [http-nio-8090-exec-27 url: /confluence/admin/mail/dosendtestemail.action; user: xxxx [atlassian.confluence.mail.ConfluenceMailServerManager] getMoreDebugInfoAboutCreatedSession Session providers: [[javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle], javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle], javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle], javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Oracle], javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle], javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Oracle], javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle], javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle], javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle], javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Oracle], javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle], javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Oracle]]] 2024-04-17 07:23:38,942 DEBUG [http-nio-8090-exec-27 url: /confluence/admin/mail/dosendtestemail.action; user: xxxx] [atlassian.confluence.mail.ConfluenceMailServerManager] getMoreDebugInfoAboutCreatedSession Session addressMap: [{rfc822=smtp}] 2024-04-17 07:23:38,944 DEBUG [http-nio-8090-exec-27 url: /confluence/admin/mail/dosendtestemail.action; user: xxxx] [atlassian.confluence.mail.ConfluenceMailServerManager] sendWithMessageId Getting transport for protocol [smtp] 2024-04-17 07:23:38,944 DEBUG [http-nio-8090-exec-27 url: /confluence/admin/mail/dosendtestemail.action; user: xxx] [atlassian.confluence.mail.ConfluenceMailServerManager] getTransport Obtaining transport object directly (no caching). 2024-04-17 07:23:38,944 DEBUG [http-nio-8090-exec-27 url: /confluence/admin/mail/dosendtestemail.action; user: xxxx] [atlassian.confluence.mail.ConfluenceMailServerManager] sendWithMessageId Got transport: [smtp://mailservername.com]. Connecting 2024-04-17 07:23:38,947 DEBUG [http-nio-8090-exec-27 url: /confluence/admin/mail/dosendtestemail.action; user: xxxx] [atlassian.confluence.mail.ConfluenceMailServerManager] sendWithMessageId Sending message 2024-04-17 07:23:42,164 DEBUG [http-nio-8090-exec-27 url: /confluence/admin/mail/dosendtestemail.action; user: xxxx] [atlassian.confluence.mail.ConfluenceMailServerManager] sendWithMessageId Message was sent with Message-Id <832303358.9340.1713363818950@mailservername.com>
- Collect the message id from the above log example" Message-Id <832303358.9340.1713363818950@mailservername.com>" and share it with mail server team to track where the mail is routed to.