Confluence fails to send emails with User Unknown error when using Exchange and the number of failures is displayed in the Error Queue

Still need help?

The Atlassian Community is here for you.

Ask the community

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


Confluence fails to send emails with User Unknown error when using Exchange and the number of failures is displayed in the Error Queue 

Symptoms

  • The first observation is the number present in Confluence error queue ( sample screenshot below )

  • The second observation is the below stack trace in logs
Confluence Logs
2024-02-02 08:40:17,263 WARN [Caesium-1-1] [troubleshooting.healthcheck.concurrent.SupportHealthCheckProcess] lambda$getCompletedStatuses$0 Health check 'Mail Error Queue' failed with severity 'warning': 'There are 3 emails in the error queue for this node.'
Outgoing Mail Log 
2024-02-02 08:18:52,357 ERROR [NotificationSender:thread-2] [plugin.notifications.dispatcher.NotificationErrorRegistryImpl] addError Error sending notification to server '<Unknown>'(-1) for INDIVIDUAL task (resent 2 times): Error sending to individual '2c92a3e66bb13c19016bf9e73c0a0197' on server 'System Mail'
NotificationException: javax.mail.SendFailedException: Invalid Addresses;
  nested exception is:
	com.sun.mail.smtp.SMTPAddressFailedException: 550 5.1.1 User Unknown

Cause

  • Usually the SMTP server isn't permitting sending on to other domains
  • The Email IDs present for the user is incorrect or has become invalid due to some reason. 

Solution

  1. From the above outgoing mail log, we see a user key 2c92a3e66bb13c19016bf9e73c0a0197 and in the log we can have many more unique numbers too based on the number of errors we see in the error queue. 
  2. First please check if you have one SMTP server or more than one in Confluence UI just to be sure which also helps in troubleshooting the issue quicker. 
  3. Please grab the user_key IDs from above one by one and use the below query to identify the users. ( (info) Note, the below query is tested in PostgreSQL )

    select user_name, lower_user_name, email_address, directory_id from cwd_user where lower_user_name in (select lower_username from user_mapping where user_key='2c92a3e66bb13c19016bf9e73c0a0197');
  4. Next please also run the below query to be sure about the directory name the user belongs to. 

    select d.id, d.directory_name, m.list_index from cwd_directory d join cwd_app_dir_mapping m on d.id=m.directory_id;
  5. After getting the output of the user details from the first query, please verify all the details of each user and if there is any invalid or incorrect email address please rectify them. 
  6. Try to resend the mails in the error queue and after few hrs observe the error queue again where the expectation is to be no errors mails present there. 


Last modified on Feb 28, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.