Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make jenkins send email via sendmail

I got a nullmailer setup to a 3rd party SMTP relay. It's working well.

How can I tell jenkins to send his email through the sendmail system function ?

I tried setting the SMTP credentials directly in jenkins, but it's a mess with TLS (none of the solution I tried worked with Mandrill)

Thanks.

like image 452
sf_tristanb Avatar asked Aug 15 '14 12:08

sf_tristanb


People also ask

How Jenkins can send email when build pass or failed?

Select “Configure”. Select “Add post-build action” and Click “E-Mail Notification”. Enter your recipients mail address and select first option “Send e-mail for every unstable build”. Click “Save” button.


1 Answers

I run into this problem today. If you don't want to setup a smtp provider such as gmail, you can install postfix (see here about how to install postfix non-interactively) on the maschine/container on which Jenkins is running.

Make sure postfix runs well. In my case postfix did not start automatically after installation.

service postfix start

Then in Jenkins select Manage Jenkins => Configure System => Email Notification. Enter localhost In field "SMTP Server". Let Jenkins send out a test mail to test it.

like image 199
GoFindTruth Avatar answered Sep 24 '22 01:09

GoFindTruth