Confluence is unable to connect to the mail server (response code 421)
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
Problem
Confluence cannot reach the mail server, returns code 421 error which indicates that the service is not available and the connection will be closed.
The following appears in the atlassian-confluence.log
:
2012-12-05 16:02:00,105 ERROR [scheduler_Worker-9] [atlassian.core.task.AbstractErrorQueuedTaskQueue] handleException com.atlassian.mail.MailException: javax.mail.MessagingException: Could not connect to SMTP host: 192.168.27.25, port: 2526, response: 421
com.atlassian.mail.MailException: javax.mail.MessagingException: Could not connect to SMTP host: 192.168.27.25, port: 2526, response: 421
at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:191)
at com.atlassian.confluence.jmx.JmxSMTPMailServer.send(JmxSMTPMailServer.java:71)
at com.atlassian.confluence.mail.template.AbstractMailNotificationQueueItem.send(AbstractMailNotificationQueueItem.java:128)
at com.atlassian.confluence.mail.template.PreRenderedMailNotificationQueueItem.send(PreRenderedMailNotificationQueueItem.java:117)
at com.atlassian.confluence.mail.template.AbstractMailNotificationQueueItem.execute(AbstractMailNotificationQueueItem.java:99)
at com.atlassian.core.task.AbstractErrorQueuedTaskQueue$TaskDecorator.execute(AbstractErrorQueuedTaskQueue.java:107)
at com.atlassian.core.task.AbstractTaskQueue.flush(AbstractTaskQueue.java:45)
at com.atlassian.core.task.AbstractErrorQueuedTaskQueue.flush(AbstractErrorQueuedTaskQueue.java:37)
at com.atlassian.quartz.jobs.TaskQueueFlushJob.doExecute(TaskQueueFlushJob.java:32)
at com.atlassian.quartz.jobs.AbstractJob.executeInternal(AbstractJob.java:86)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at com.atlassian.confluence.setup.quartz.DelegatingClusterAwareQuartzJobBean.executeJob(DelegatingClusterAwareQuartzJobBean.java:16)
Diagnosis
- Check that the SMTP is running on its host. If unsure, verify this with your System Administrator.
- See if you can send mail with an application other than Confluence.
- Check the physical connection from the Confluence box to the SMTP host with the following:
Windows
Linux
- If you're unable to connect to the SMTP host from the JIRA host, it may indicate a problem with the network. Please check this with your hosting provider or System Administrator.
Cause
The Mail Sever is not available/reachable.
Resolution 1
Re-create the SMTP server settings in Confluence Admin > Mail Server.
Resolution 2
If the above does not work, move the 'activation' and 'mail' jar files from /confluence/WEB-INF/lib
to <Confluence Standalone install>/lib
, restart Confluence and see if the problem persists.