Mail integration problem

  • 1
  • 14

I am in a process of researching the YouTrack product (which looks really very good) and I have just configured the Mail integration.
It seems that everything is working when I send an email to the configured mail address (a ticket is created successfully), but when I try to comment/reply on an issue I am getting an error which is saying that the App is not able to connect the the SMTP host. I have tried to use both – IMAPS and POP3S but the result is the same:

15:05:16,243 ERROR [MailingServiceImpl ] [taskExecutor-3 ] [root@10.0.1.60] Error sending email.
org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 0;
nested exception is:
java.net.ConnectException: Connection refused. Failed messages: javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 0;
nested exception is:
java.net.ConnectException: Connection refused; message exception details (1) are:
Failed message 1:
javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 0;
nested exception is:
java.net.ConnectException: Connection refused
java.net.ConnectException: Connection refused
 at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1545)
 at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:453)
 at javax.mail.Service.connect(Service.java:291)
 at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:389)
 at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:340)
 at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:336)
 at jetbrains.mps.webr.notifications.runtime.spring.MailingServiceImpl$1.run(MailingServiceImpl.java:101)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 at java.lang.Thread.run(Thread.java:744)
Caused by: java.net.ConnectException: Connection refused
 at java.net.PlainSocketImpl.socketConnect(Native Method)
 at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
 at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
 at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
 at java.net.Socket.connect(Socket.java:579)
 at java.net.Socket.connect(Socket.java:528)
 at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:267)
 at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:227)
 at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1511)
 ... 9 more



I have deployed the YouTrack WAR file on Tomcat on CentOS 6.5.
I have tried to setup the Mail integration by using the following link: http://blog.jetbrains.com/youtrack/2014/02/using-youtrack-as-a-help-desk/
The only difference that I noticed during the setup was that the Project 'from' email field was missing in my system.


Do you have any idea how to solve the problem?
Hi Lubomir,

Thank you for choosing YouTrack!

Unfortunately, we didn't provided all the details in our blog post. Actually there is one more step in setting up Mailbox Integration. You see, it should work in two directions - collecting emails from users and sending them notifications back. The first direction is provided by setting up Mailbox Integration according the blog post, and the second one is about setting up notifications on Settings page. On the bottom of the latter there is an "Email" checkbox. As soon as you check it, some additional fields appear, where you should set up sending emails via SMTP. When done, the Project 'from' email field will also appear.

I strongly recommend you avoid using Gmail SMTP for sending notifications, as it doesn't allow using From address other than the one you actually send emails from. Or, at least, for the matter of test, you can set up the same Gmail address for both sending and collecting messages. These guys are rather paranoid with their security policies, and we can do nothing about it, unfortunately.

Please let us know if you need more assistance.

Regards,
Mariya Davydova.