Configure Jenkins to send gmail: What am I missing? - jenkins

Trying to have Jenkins send an email to a Gmail account upon every build. I get:
Failed to send out e-mail
com.sun.mail.smtp.SMTPSendFailedException: 530-5.5.1 Authentication Required. Learn more at
530 5.5.1 https://support.google.com/mail/?p=WantAuthError 9sm5733284oij.25 - gsm
Here's what I tried so far:
Made the gmail account accept emails from less secure apps
Generated an application password from gmail and used it in my Jenkins configuration - got the same error with and without the app password
Looked at at least a dozen answers (yeah) and all the screens showing the Jenkins gmail config look the same as mine
telnet smpt.gmail.com 465 responds as connected
My Jenkins install is localhost using this URL: http://192.168.0.1:8080/
My system admin email address exists and is entered in Jenkins
I've tried filling in the section on Extended E-mail notification and removing the entries - no difference
Turned off Windows Defender, thinking, just maybe???
Also tried to configure Outlook/Hotmail using those smpt parms but that gave different errors
Don't know if this matters but I have that 'It appears that your reverse proxy set up is broken' and I don't recall setting up a reverse proxy!
Any help would be greatly appreciated!
Set up Jenkins email notification as shown below:

To resolve this, create & use app passwords with 2-step verification turned on.
A less secure method is to allow less secure apps without 2-step verification.

Related

CI - Xcode 9 Server doesn't send email after integration

I was able to setup Server & Bots with Xcode 9 (ref). The integration can be run smoothly. However, the expected email report is never sent.
I've already setup my Mac to send emails using postfix. For example, I can run this command and then receive the email:
$ date | mail -s test1 nigong#mydomain.com
To make Xcode send email, I have done the following setups:
However, no email is sent or received. I wonder if there is any additional setup is needed.
Any help is appreciated. Many thanks!
After 20 hours searching I finally found the problem. I will try to describe the needed steps to get this working:
On your CI server the postfix SMTP server needs to be configured and working. There are multiple tutorials on the internet. The one I used was this one:
https://blog.anupamsg.me/2012/02/14/enabling-postfix-for-outbound-relay-via-gmail-on-os-x-lion-11/
However, I still was not able to sent a mail with the mail command after I configured everything like explained in the tutorial.
The missing piece was the Gmail setting for "less secure apps". Gmail does not allow sending emails over their SMTP even if login and password are correct. The SMTP server needs to fulfill special requirements. (which I am not aware of...) However, it is possible to losen that restriction and allow access from any SMTP. Here:
https://support.google.com/accounts/answer/6010255
Set "Allow less secure apps" to On. I recommend creating a dedicated Gmail account just for this and not to enable this setting on your day-to-day email account.
Now everything was working and I was able to successfully send mails with the macOS cli command mail.
The last step needed to solve this was to setup the Xcode server settings correctly. (and this is what basically answers OP's question). So, the correct setup (after mail cli works) was to not set any settings in Xcode server. Just remove all the settings, then Xcode server will fall back to postfix.
Just remove all settings, that's it. Now Xcode CI server sends successfully emails.

Rails mailer smtp authentication error

my mailer can't work because of this error. I can't understannd why. I use G-suite for my email.
Thanks very much for your help !
I had the same problem, recently Google really blocked the access to less secure apps.
But, you could resolve it turning on the 2 steps verification log in, and then the option app password should be allowed. this feature was created to applications that cant' make the 2 steps verification. Google will register a diferent password to be only accessed from this app.
https://www.google.com/settings/security
https://support.google.com/accounts/answer/185833?hl=pt-BR
Reason: Google was blocking access from unknown location (app in production)
Solution: go to following link and turn on https://www.google.com/settings/security/lesssecureapps

Sending Email from .NET using windows live smtp

I have configured smtp settings in web.config and I was able to successfully send email when working on my local machine. But when I uploaded the code on the server, its giving me following exception
Mailbox unavailable. The server response was: 5.7.3 Requested action aborted
Meanwhile, I also received an email from Microsoft telling me that an attempt to login to my account from a new location was blocked. I clearly understand the problem that server is in a different part of the world than where I usually login to a Windows Live account. That's why it is blocking the account to login. But I want it to login and send email using my credentials on from remote server. There must be some settings in Windows Live account but I failed to find one.
Contacting Hotmail Support Center first to find out if its really possible what you are intending to do might be helpful. I think if hotmail web administration has put a security check, it must be for a purpose of stopping such remote login activities.

Sending email to the "outside world" from localhost using hMailServer and Gmail SMTP on Windows 7

I am not sure if this is technically possible but I am running a AMPPS box on Windows 7 as my localhost and I have configured it with Gmail SMTP (ssl://smtp.gmail.com) to send out email from my PHP scripts like joomla, wordpress, socialengine, etc.
Now I installed and setup hMailServer and I am able to send and receive emails locally but was wondering if there was a simple way that I could configure my localhost and email server to send out email to outside world (e.g. #hotmail.com or #yahoo.com receipients) using Gmail SMTP?
Currently with my setup, I am only able to receive installation confirmation emails from AMPPS but nothing else like "Forget Password" or "User Registration Forms" work.
Any ideas without getting too deep into code modification?
The simple answer is no, or rather it is far from easy, especially from a home based server.
And the reason is that your IP address amd mail server domain will not be considered as a ligitimate mail server by most of the legitimate mailservers you will be trying to send mail to, and they will just reject it as yet another spam server.
Have a look at these:
https://serverfault.com/questions/72559/setting-up-a-mail-server-best-practices-to-be-recognized-as-legitimate
How to conduct legitimate email campaigns

Jenkins email-ext plugin not sending mail

I have Jenkins version 1.480.3 installed on my machine and Email-Extention Plugin 2.30.2.
Test mail from "Manage Jenkins" section works fine. When I add editable email notification to my jobs, I am not receiving it.
Also tried configuring "Triggers" in editable email notification advanced section. That also didn work. Console logs of build shows email has been triggered.
Can someone help me on how to debug this?
At first you have to create a template http://url-to-jenkins/emailexttemplates/.
In the field "Project Recipient List" you can add some emails (comma separated).
You can also insert global variables (Manage Jenkins > Configure System > Global properties) with:
${ENV, var="PATH"}
The "Advanced Settings..." option provides a trigger management, just add "Recipient List" and now you should get some emails by Jenkins.
It appears that, in some version Extended E-mail Notification become own SMTP Server configuration.
So check your configuration under "Manage Jenkins" -> "Configure System" -> "Extended E-mail Notification" and make sure that fields "SMTP Server" and " Default user E-mail suffix" are filled properly.
Make sure also that the configuration is consistent with "Manage Jenkins" -> "Configure System" -> E-mail Notification.
TL;DR
Fill out fields "SMTP Server" and " Default user E-mail suffix" under "Manage Jenkins" -> "Configure System" -> "Extended E-mail Notification"
Wasted few days.
Also tried to Downgrade the email-ext plugin to 2.25
but this Doesn't help.
Test mail sended, In Console Log was Sending email to: mymail
But stiil have no messages.
I found solution that help me....
I used gmail. So I Verifeid my gmail account via cellphone, than I fill Security Settings and gave Access to my account from unreliable sources.
Then I fill that mail into Use SMTP Authentication in Global Settings.
That worked for me :)
Check if you have SSL enabled under SMTP Auth settings. For me, I was able to see a successful trigger, but email was never sent.
I spent hours trying to resolve this issue, I've implemented everything mentioned here, and didn't work for me, the solution that worked for me was to uninstall the plugin and install it again!
Downgrade the email-ext plugin to 2.25
This is a long shot. But chrome was auto filling my SMTP Authentication password, so when I changed any setting and clicked save, the password would also be overwritten.
Hopefully I can save someone else a headache!
Short Description of problem that I was facing:
When I was sending test mail from Manage Jenkins -> Configure System
-> E-mail Notification, I was able to successfully send and receive emails but there is no such option to test email in Extended E-mail
Notification tab
While running a job, when I was sending email in post-build step via E-mail plugin, I was able to successfully send and receive emails but with same settings, I was getting following error on sending mail via Extended E-mail:
MessagingException message: 535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials
I went almost crazy searching for resolution of this issue.
I tried every resolution mentioned on this page but no success. I even tried downgrading the plugin to 2.25 but I was still getting error when sending email via Extended E-mail plugin. Everywhere on internet also the only solution mentioned to solve this problem was to "Allow less secure apps" and to check if credentials are valid, which in my case were valid since I was able to successfully send mail via normal email plugin.
After struggling for a few days, I finally found the silly thing that was causing this issue.
I had to type-in email ids into each and every box in:
Manage Jenkins -> Configure System -> Extended E-mail Notification.
Copy-pasting email ids or domain names is causing this annoying and time taking issue. So, in case if you fall in such a situation, please make sure you have handwritten email ids in each column and not copy pasted.
Following configurations for "Extended E-mail Notification" worked for me:
Email Extension Plugin : 2.69
SMTP server : smtp.gmail.com
Default user E-mail suffix: <left this blank>
Enabled Use SMTP Authentication
User Name: <email id of account through which email is to be sent>
Password: <Password of account through which email is to be sent>
Advanced Email Properties : <left this blank>
Use SSL : Enabled
SMTP port: 465
Charset: UTF-8
Also, I had enabled less secure apps.
Hope this saves someone's time!!
Sometime after 2.66, if the From field is not set in the project, it doesn't seem to be falling back to the system email address. I believe this ticket is tracking the issue. https://issues.jenkins-ci.org/browse/JENKINS-63522
i performed the following action (after hours and hours of investigation)
and at the end it worked for me.
Unistalled the Extended mail plug in.
Deleted from .jenksins the plugIn (it remains also after Unistall).
Reinstalled the Extended mail plug In and enabled it.
Restart Jenkins.
In the Jenkins Configure System, in the Extended E-mail Notification section,
I set a new credential access to my gmail account
(also the previous credential stored were correct but i preferred to generate a
new one with a different description).
And then... Finally afteer several time on this matter it works for me!.
Try to use Extended E-mail Notification > Enable Debug Mode (selected). It will show you more logs in the Job Run Console section.
In my case, it showed me in the logs that credentials copied from regular email-ext (AK_AWS_SES_CREDENTIALS/****** (Migrated from email-ext username/password)) were not able to connect to AWS SES SMTP service.

Resources