7

I am trying to setup email notification for my jenkins server for build failures.

Things I have tried:

1) Use my company smtp mail server with authentication - does not work. Connection refused

2) Setup my own James mail server. SMTP server - localhost. Authentication - admin,admin. Port 25. I see that my SMTP server is running. - does not work. Connection refused

3) Use my personal gmail account with authentication - Works!!!

I have followed other discussions on this topic but not got an answer.

Some say it may be a firewall issue but I am not sure how to overcome it.

Any suggestions are most welcome.

Thanks,

Sairam Sankaran
  • 309
  • 9
  • 18
  • What do the Jenkins logs say exactly? To rule out a firewall issue, have you tried running a telnet from the Jenkins machine to the company SMTP server / James server? – Spiff Jun 19 '13 at 18:21
  • javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25; nested exception is: java.net.ConnectException: Connection refused: connect – Sairam Sankaran Jun 19 '13 at 18:30
  • Yes. I can telnet to both from the Jenkins server machine – Sairam Sankaran Jun 19 '13 at 18:30

2 Answers2

2

I had the similar problem.

I was on wireless + windows 7 and when checked internet connectivity status, IPV4 was connected to internet but IPV6 was not. Looks like IPV6 is used as default on windows 7 but it was not able to connect to the SMTP server using it.

Started my jenkins with -Djava.net.preferIPv4Stack=true and it worked for me.

java -Djava.net.preferIPv4Stack=true -jar jenkins.war and the "Test Configuration" worked.

Deepak Singhvi
  • 727
  • 6
  • 13
1

For Sending Email Notifications using localhost SMTP server you need to install postfix,

For Linux :

  1. sudo apt-get install postfix
  2. telnet localhost 25

and then try sending test email. :)

I know this is late but just in case any other person is facing problem!

Shivani Sharma
  • 697
  • 1
  • 7
  • 22