Monday, March 26, 2012

Jenkins: Setting up Email Notification using Yahoo SMTP

NOTE: This tutorial is for developers who are using Jenkins installed on their local server (with Internet Connectivity).

So you want to setup Jenkin's Email Notification but you don't have email server?

Assuming you have Yahoo Email account, that will work just fine. We just have to configure the Email Notification of Jenkins.

Under Manage Jenkins, go down to E-mail Notification then set these following information:
SMTP server - smtp.mail.yahoo.com
Default user e-mail suffix - @yahoo.com
Sender E-mail Address - Foobar CI <your.email@yahoo.com>

Use SMTP Authentication - yes
User Name - your.email
Password - p******d

Use SSL - yes
SMTP Port - 465
Reply-To Address - noreply@yahoo.com
Charset - UTF-8

Optionally, you might want to try if it's really working. Type-in your email address and click Test Configuration.

You should be able to receive something like: "This is test email #20 sent from Jenkins"

Below is what your configuration should look like.

Happy spamming! :P

4 comments:

Unknown said...

I'm using Jenkins version 1.476and trying to setup email notifications. When I go to "Configure Jenkins" and go to the "E-mail Notification" section, it only has spots for "SMTP server", "Default user e-mail suffix", and "Sender E-mail Address". The form does not have anything for specifying authentication schemes or parameters (it is not like the form in your post).

Is there something in the configuration I need to change somewhere in order to specify the email sending authentication parameters?

Unknown said...

Someone at work just showed me the solution because he, too, was hung up on this for a long time.

There is an "Advanced" button you have to press. It is located on the right side of the browser window. You have to scroll the browser to the right to see it.

dj80hd said...

I am using Jenkins version 1.6000

I noticed that the "Sender E-mail Address" setting is no longer in the Advanced section of the "Email Notification" section.

Instead I had to configure the
"System Admin e-mail address" setting in the "Jenkins Location" section.

frog said...

Update:
Since 2016, NOTE WELL!!
NOTE WELL!
1. The "reply-to" address must match the authenticated account.
(not no-reply@yahoo.com or anything different)
If you specify anything else, you get error like this...
Failed to send out e-mail
com.sun.mail.smtp.SMTPSendFailedException: 550 Request failed; Mailbox unavailable
(see https://stackoverflow.com/questions/50534061/smtpclient-request-failed-mailbox-unavailable)
2. The Password field cannot be your normal (web interface) login password.
Instead, Yahoo requires you to use a special randomly generated
"Application password", used for third-party apps connecting to their SMTP
server. I believe Yahoo did this because it didn't want your
account's credentials to be compromised by less secure apps potentially.

An "application password" is a randomly generated password that you create
once logged into your account; Once you create it, you cannot see it again
(but would have to create a new one).

To setup app password
Instructions:
https://help.yahoo.com/kb/learn-generate-third-party-passwords-sln15241.html
Actual website that takes you to app password generation dialog...
https://login.yahoo.com/account/security?.scrumb=za8qMKmDmdv

I created my app password as "Other", then gave it a name of "Jenkins".
Make sure you save it somewhere. You use this password in the "Password"
field as mentioned earlier.

Good luck.