How can I set the Sender’s address in Jenkins?

I’m sending mail from Jenkins to an anonymous SMTP relay internally. That relay then securely sends mail to exchange online via TLS on port 587. The transport works perfectly, the issue is that Microsoft requires the Sender address match the authentication credentials login name which is the same as the account email address. For example sake, say this is [email protected] How can I make jenkins always send mail from [email protected]?

BTW when I say the transport works perfectly what I mean specifically is that I can drop a formatted e-mail file into the “Pickup” directory on the SMTP relay server and it is properly sent to any recipient provided the From address is [email protected]

Using IMAPClient how do you view the Senders address?

Using IMAPClient how do I view the message body and the senders email address? server = IMAPClient(imap_server, use_uid=True, ssl=ssl) server.login(imap_user, imap_password) print ‘login successful’ s



How can I use my users (non verified) addresses as senders with Amazon SES?

I’m writing a send to a friend feature and I need the from address to be the senders email to be a bit more personal. However, with Amazon SES it looks like I can only send from verified addresses. I

How can I set the jenkins authentication token?

On my Jenkins build server, I want to set an Authentication Token so that only users that know the token can fire off builds. (As described here.) This doc page says that it should be configurable und

Senders mail address of a mail item using Outlook object model

How to check the senders mail address of an individual or group of a mail item? Is it possible if outlook addin can validate even if outlook is not opened? This is what I have tried so far but unable

How can I point Jenkins to another .jenkins home directory?

I have the working /.jenkins folder under a specific user in home on Linux. I want to start Jenkins with another user, but re-use the .jenkins folder of the other user. How can I do this? Jenkins offe

How can I integrate Jenkins with Redmine?

I would like to integrate Jenkins with Redmine. If some build breaks, Jenkins would open an issue in Redmine to notify it with the console output. How can I do it? Are there any plugins? Are there any

How can I set up Jenkins CI to use https on Windows?

We’ve recently set up a Jenkins CI server on Windows. Now in order to use Active Directory authentication I’d like to require https (SSL/TLS) for access. Given this setup, what is the recommended way

How to set Jenkins installation file location?

I want to set Jenkins file location to E:/Programs/Jenkins kind of location I’m using the command java -jar jenkins.war How do i specify the file location with that commad

How can I set the outgoing IPv6 address in Perl’s LWP::UserAgent?

I know it is possible to set IPv4 outgoing IP in LWP::UserAgent, but is it possible to set specific IPv6 address as outgoing IP? If yes: how can I do this?

How can I fetch source code from synergy using Jenkins

I have installed synergy plugin for Jenkins. I want to fetch some code from synergy DB. How can I do it using jenkins? I have given all the details in SCM section of Jenkins like DB value, Engine, Use

Answers

I’m not sure if it is what you meant, but Jenkins enables you to provide a full Sender E-mail Address for notifications. Go to Manage jenkins, then System configuration and find section called E-mail Notification.

You can provide you email address in a form of Jenkins <[email protected]>.

Jenkins uses the System Admin e-mail address as the sender address for e-mail notification. You can configure this under Manage Jenkins -> Configure System. This is under the Jenkins Location header on that page! It is not immediately obvious that this setting is tied to the e-mail notification settings, since it is not under the E-mail notification header on the configuration page.

Manage Jenkins -> Configure System -> Jenkins Location -> System Admin e-mail address

You can search the page for “Jenkins Location” to change the default value of address not configured yet to whatever you want.

If you need to do this without using the jenkins UI (for instance in automating a jenkins setup) – you can do so with a groovy script.

import jenkins.model.*

def jenkinsLocationConfiguration = JenkinsLocationConfiguration.get()

jenkinsLocationConfiguration.setAdminAddress("[your admin name] <[your admin email address]>")
// example format -> .setAdminAddress("Jane Doe <[email protected]_email.com>")    

jenkinsLocationConfiguration.save()

Do note: I did not write this script (although I have tested it and it works), all credit to Peter Halliday and his website with other helpful groovy scripts here.

Manage Jenkins -> Configure System -> Jenkins Location -> System Admin e-mail address

You can search the page for “Jenkins Location” to change the default value of address not configured yet to whatever you want.