Jira fails to send outgoing emails

Dmitry.Semionin September 4, 2012

So i've had a Jira OnDemand instance but decided that a Download one fits my needs better, so i installed one (5.1.3, Windows x64) and imported the data backed up from the OnDemand instance.

The first issue was being unable to log into the newly installed Jira using the OnDemand accounts' passwords. The accounts were recognized by the Download instance, but their passwords were not accepted. Then i tried the password recovery option, and was told than an email was sent to the corresponding address. But, no email was ever received.

Having looked into the logs, i found the repeated error messages in atlassian-jira-outgoing-mail.log, a single message looking like this:

2012-09-05 01:19:49,182 ERROR [POP Mail Server] Sending mailitem To='Dmitry.Semionin@gmail.com' Subject='Account username(s)' From='null' FromName='null' Cc='null' Bcc='null' ReplyTo='null' InReplyTo='null' MimeType='text/plain' Encoding='UTF-8' Multipart='null' MessageId='null' ServiceRunner Mail Queue Service Error occurred in sending e-mail: To='Dmitry.Semionin@gmail.com' Subject='Account username(s)' From='null' FromName='null' Cc='null' Bcc='null' ReplyTo='null' InReplyTo='null' MimeType='text/plain' Encoding='UTF-8' Multipart='null' MessageId='null'
com.atlassian.mail.MailException: javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
nested exception is:
java.net.ConnectException: Connection refused: connect
at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:193)
at com.atlassian.mail.queue.SingleMailQueueItem.send(SingleMailQueueItem.java:38)
at com.atlassian.mail.queue.MailQueueImpl.sendBuffer(MailQueueImpl.java:66)
at com.atlassian.jira.service.services.mail.MailQueueService.run(MailQueueService.java:28)
at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:61)
at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:47)
at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
at com.atlassian.multitenant.quartz.MultiTenantThreadPool$MultiTenantRunnable.run(MultiTenantThreadPool.java:72)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
nested exception is:
java.net.ConnectException: Connection refused: connect
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1972)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:642)
at javax.mail.Service.connect(Service.java:295)
at javax.mail.Service.connect(Service.java:176)
at javax.mail.Service.connect(Service.java:125)
at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:164)
... 8 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:319)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:233)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1938)
... 13 more

As it says, connection to localhost:25 is refused. Using "netstat -o" shows that nobody's listening to that port, so i guess that's the reason of the connection refusal (although i believe i should have been forced to wait until a timeout occurs). So, my question is: should i have installed a dedicated mail server apart from installing Jira, or such server should have been installed automatically, and its absense signals some installation error?

Also, if it's my fault and i should have done something in a different way then what's my mistake and what should have i done in a different way to make my transition from OnDemand to Download painless?

Many thanks!

2 answers

1 accepted

1 vote
Answer accepted
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 4, 2012

Yes, you need your own mail server!

Btw, how is it different from your other question? It is better to keep track of discussion on a single thread.

Dmitry.Semionin September 4, 2012

Actually, i just wish there was a single word about installing a separate mail server in the Atlassian documentation on migrating from OnDemand to Download.

Because the only instruction i found on configuring a mail server with Jira was related to Gmail and required an administrator access to Jira which i do not have due to the issue described in my other question.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 4, 2012

They are separate subjects really. Your passwords for your users are one issue you've got.

The mail server settings are nothing to do with the user account passwords. You need to set up an outgoing mailserver to send the mail from Jira on. The outgoing mail doesn't even need to be associated with a Jira account.

There is nothing wrong with your installation, Jira doesn't come with a mailserver (there's loads out there and it's not worth bundling one because there's so many options and no way of knowing what a download user might want to do). Pick one that's either easy to configure, or widely used in your organisation, or, best of all, get your mail admins to set up a standard account for your Jira to use (Assuming your organisation has them). There's standard docs for using standard mail servers (e.g. postfix) knocking around, or even gmail.

Dmitry.Semionin September 4, 2012

Btw, how is it different from your other question?

I wish i could link them together, but the link option isn't available for me.
Yet, i believe the questions are different: the one you are talking about is related to the accounts' passwords being messed up, and this one is related to the mail server issue. As for now, i can't be sure that once i fix the mail server issue, the passwords magically start working without any more actions.

Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 4, 2012

I agree, there should be a mention about this in the documentation somewhere. What needs to be changed when someone moves to downloaded version of JIRA. Mail server is a sure candidate.

0 votes
danielwester
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 4, 2012

It looks like you're already using gmail so take a look at - https://confluence.atlassian.com/display/JIRA/Using+Gmail+as+a+JIRA+Mail+Server

Suggest an answer

Log in or Sign up to answer