Search code examples
emailjenkinssmtp

Jenkins SMTP connection refused. What am I missing?


I've got Jenkins ver 1.524 installed on a Windows 7 box and I'm trying to configure email but the "Test configuration" is reporting errors. Jenkins is running as a service under my own domain account.

My settings are as follows:

SMTP server: smtp.corpdomain.com
Default user email suffix: @corpdomain.com
Not using authentication
Not using SSL
SMTP port: 25
Reply-To Address: [email protected]
Charset: UTF-8

When I test the configuration, I usually get the following exception:

javax.mail.MessagingException: Could not connect to SMTP host: smtp.amazon.com, port: 25;
  nested exception is:
    java.net.ConnectException: Connection timed out: connect

Yet every once in a while I receive the following instead:

com.sun.mail.smtp.SMTPSendFailedException: 553 5.1.8 <nobody@nowhere>... Domain of sender address nobody@nowhere does not exist
;
  nested exception is:
    com.sun.mail.smtp.SMTPSenderFailedException: 553 5.1.8 <nobody@nowhere>... Domain of sender address nobody@nowhere does not exist

However, I am able to send mail from the command line without errors via both python script and java (using javax.mail) without authentication, and I'm able to telnet to the SMTP server on port 25, so I don't see how it could be a firewall issue.

One other note that may be related: When I try to install a plug-in via the Jenkins web interface, I receive a 403 response for the URL "http://updates.jenkins-ci.org/update-center.json?uctest". However, I'm able to connect to that URL from a browser on the same machine.

Could this be a Tomcat configuration issue? I'm not familiar with Tomcat so I'm not sure where to even start looking. Maybe a Jenkins configuration that I've missed? Any other ideas?

Thanks in advance!


Solution

  • Still looks to me like your firewall is blocking Jenkins' service from accessing those ports -
    especially as the connection times-out, which is typical for such cases.

    Suggest you try to disable the firewall completely and see if there is any change.

    Cheers