Jenkins Email notification sent successfully but not delivered - jenkins

Below is the log and its working fine when i ask Jenkins to send it to individuals but the same is not working fine when i ask Jenkins to send it to a distribution list.
04:22:08 Email was triggered for: Always
04:22:08 Sending email for trigger: Always
04:22:08 Request made to compress build log
04:22:08 Sending email to: XXXXXX.XXX#XXXX.com
04:22:08 Finished: UNSTABLE
any help?

enable the option Extended E-mail Notification -> Allow sending to unregistered users and try again.
If Still not receiving the emails, enable the option Extended E-mail Notification -> Enable Debug Mode. So that you will get detailed message.

That usually means you are using an exchange server and the distribution group has only allow authenticated users (which is the default)

Related

Jenkins email extension randomly doesn't send

I'm using the Jenkins Email Extension to send automated build emails, and about 1/4th of the time, it just simply will not send.
I am getting the expected output of
Email was triggered for: Success
Sending email for trigger: Success
Sending email to: emailaddress#example.com anotheremailaddress#example.com
Finished: SUCCESS
But it doesn't send the email. This is completely random. No matter what time, what build, or the list of recipients, it just pretends to send the email but doesn't roughly 1/4th of the time.
Are there additional logs for this extension somewhere? Because other than "Sending email to:" in the regular build logs, it doesn't actually give any confirmation that an email was really sent.
Dunno how you've got the email extension configured, but what I would suggest is spinning up a postfix relay on the server that Jenkins is running on, and configure the email extension to use "localhost". The reason is that then you would get log messages on the server that would show you if Jenkins is actually trying to send the emails or not. It might not be jenkins, it might be something else.

TFS not always emailing pull request notifications

I have a project in TFS. The last two pull requests, we got emails for "xxx has approved the code" but not the subsequent emails for "xxx marked the pull request as completed" The pull requests in question were both approved and completed. The emails do not appear to have been caught in Outlook's spam filter.
The subscription for all projects is "A pull request I created or am a reviewer on is updated"
Version: 15.117.26714.0
Is there a way to diagnose why TFS email notifications are so flaky? This isn't the first complaint I've gotten about TFS email notifications being unreliable.
Have tested TFS 2017.2 instance but could not reproduce the issue on my side. Both approved and completed E-mail sent correctly.
So the issue seems not be able to stable reproduce. For now, there is no way to trouble shoot this directly. You could check the event log in TFS sever to see if you got any error or warning info there.
To narrow down the issue, you could analysis both address the E-mail achieved and sent.
Notifications are sent to your preferred email address, which you can
change from your account preferences. Change the preferred one
and use another to see if issue still exists.
The received notifications are sent by the configured SMTP
server. Try to specify another SMTP Server and the email address
to use for sending emails.
One possibility for this issue, the action of approved and completed pull request were too closely. This may cause TFS only trigger one E-Mail. Do it slowly and try again. Based on my testing, in this case, the E-Mail are sent not in sequence, the completed came first then the approved one.
Moreover, you could also explicitly add a subscription with "A pull request I created or am a reviewer on is updated" just for the project you are working on, which may do the trick.

Jenkins Email sending fails

I set up the JENKINS Editable Email notification for my project with trigger for all builds.
the build runs successfully but the emails does not send.
The follwing is the result in the console output.
BUILD SUCCESSFUL
Total time: 43 seconds
Email was triggered for: Always
Sending email for trigger: Always
Sending email to: chauhanheena#gmail.com
Connection error sending email, retrying once more in 10 seconds...
Connection error sending email, retrying once more in 10 seconds...
Failed after second try sending email
Finished: SUCCESS
Make sure SMTP server is configured under "Manage Jenkins" -> "Configure System" -> "Extended E-mail Notification"
Note also that depending on your plug-in set up, you may have another place to configure SMTP server. For example under "Manage Jenkins" -> "Configure System" -> "E-mail Notification".
That is not needed for this particular plug-in but it may lead you think you have everything done, while it is not :)
You should set SMTP Server and Authentication in both E-mail Notification and Extended E-mail Notification sections. Click Advanced button to see this Use SMTP Authentication section.
If issue still persists, then just restart jenkins, it will work. Somehow the Jenkins system was unable to load all of the configs?
A little late to the party but here's how I made it work in my case. I was trying to authenticate the credentials with AWS SES.
TLDR: Try a different SMTP Port. Changing the port from 587 to 465 allowed Jenkins to authenticate with AWS SES.
And for those who are curious. Here's how I figured out what the issue was.
Go to following location.
Jenkins > Manage Jenkins > Configure System
Scroll down until you find the following option to Enable Debug Mode. See below.
And after enabling the debug mode, the console output became a lot more detailed and I could see the below at the very end.
Changing the SMTP Port allowed Jenkins to go through. SES allows the following ports.
Port: 25, 465 or 587
Hopefully that should fix the issue and allow emails to flow though. Or else the the debug mode might steer you in the right direction.
EDIT: Important
The email I was trying to send was from the Editable Email Notification section.
Jenkins > Project $Project_Name > Configure > Post Build Actions > Add Post Build Action > Editable Email Notification.
I was also facing the same issue but again i revisit below things and
it worked.
First make sure email notification related plugins are installed (Manage Jenkins->Manage Plugins->Check if email related plugins are
installed or not)
Then Go to Configure System(Manage
Jenkins->Configure system) and navigate to Extended E-mail
Notification section and provide
SMTP server-smtp.gmail.com
Check -Use SMTP Authentication
Provide User name (say your gmail)and corresponding password( Email address from where email will trigger upon completion of build,Note -you need to turn on allow option for secure app to sign in from gmail settings)
USe SSL-cheked
SMTP Port-465
Add your gmail in Reply to list also.
In E-mail Notification also provide - smtp.gmail.com
Save above all.
Now all you need to do is to set up post build section - Open ur project and in post build section( From your Projecct click on configure), provide desire email address(to whom you want to send the email) on Recipients field of Email Notification/Editable Email Notification field Now go ahead
with build now.
I was having the same issue, and the only way I could send emails was using mail:
mail(
bcc: '',
body: "<p>your body</p>",
cc: '',
charset: 'UTF-8',
from: '',
mimeType: 'text/html',
replyTo: '',
subject: "your subject",
to: "your-email#mail.com"
)
Since I don't know the error log of your issue, I will try to give what worked for me.
I tried everything else but the below step saved me.
Hope it will help someone with the similar issue.
I just set the System Admin e-mail address correctly.
here are detailed steps:
Try this out and test again to send:
These steps are already given in other solutions but still writing down here for completeness: Fill up SMTP server, set Default user e-mail suffix as
#somedomain.com, check Use SMTP Authentication, put username and password, check Use SSL, set SMTP Port, set Charset to UTF-8.
Open: Manage Jenkins > Configure System
Find Jenkins Location option
Fill the System Admin e-mail address like this:
your-name <email-id#somedomain.com>
Try sending test email again.
Does your Jenkins Config have an SMTP server set up correctly? Have you tested the config with a test email?
Go to "Manage Jenkins" -> "Configure System" and scroll to the bottom to make sure these are set up correctly.
If you servlet container server doesn't have an SMTP server, then you need to find whatever your Outlook is connected to, and see if you can use that. You may need to provide credentials for authentication depending on the server's setup.
Under Manage Jenkins -> Configure System:
fill in the section "Extended E-mail Notification" as per your "E-mail Notification" section.
That should work.

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.

Jenkins email configuration - Test email configuration succeeds but email is not received by user

I am Using Jenkins v1.521 on Windows 2008 R2 server. I need to enable email build notifications in the builds. I have also installed email ext plugin.
I have configured the SMTP server details under Configure System in Jenkins.
I tried sending the test email from Jenkins using "Test Configuration" option providing my email address and I get a message that says "Email successfully sent" but I don't seem to be receiving the email.
I also tried doing a telnet to the SMTP server directly on the server hosting Jenkins and sent an email manually and it worked. I received the email.
I wonder why the mail sending part does not work via Jenkins?
Could any one please provide me suggestions to fix this issue?
In order to get this to work, a valid email must be entered into the "System Admin e-mail address" field. That field is on the same page but is located in another section higher up. Without doing so, I too received a message that the email was successfully sent but I never received it. Once I set it, the test emails started to be received properly.

Resources