问题
I have Jenkins version 1.480.3 installed on my machine and Email-Extension Plugin 2.28.
I have configured my jobs on Jenkins and everything works fine except the final build success email.
I have configured four triggers for Email-Extension plugin:
- Failure
- Success
- Unstable
- Before Build
For all the triggers I have enabled "Attach Log" and all works fine except the "Success".
I get the following message on screen:
Email was triggered for: Success
Sending email for trigger: Success
Request made to compress build log
Sending email to: abc@example.com def@example.com
Error sending to the following VALID addresses: abc@example.com def@example.com
Notifying upstream projects of job completion
Capturing build context information.
Finished: SUCCESS
Please could someone help me since I really have no clue how to resolve this.
回答1:
I had this problem too. In the end, it was because my attached build log was too large! The SMTP server refused to send out the e-mail causing the error message:
Error sending to the following VALID addresses: ...
Disabling the option to attach the build log or fixing the output of my build to not dump so much text fixed the problem:
回答2:
Looks like a bug in the plugin. Here's a workaround:
In the global settings for the plugin make sure to provide a full e-mail address for System Admin E-mail Address, (e.g. foo@bar.com, not just foo), even though you've specified the Default user E-mail suffix. The address itself can be bogus, though.
回答3:
For Email, you have to install following plugins.
- Email-ext plugin
- Email-ext Template Plugin
To provide the configuration, go to the Jenkins System configuration page (Jenkins > Manage Jenkins > Configure System > ” E-mail Notification ” section). You will be able to see the below screen to add email configurations:
SMTP server name : smtp.gmail.com
User name : user_email_id@gmail.com
Password : user_email password
Use SSL : Checked
SMTP Port : 465
Now, configure “Extended E-mail Notification” section. You will be able to see the below screen. Fill the same value as above parameter.
Now, Click on Default triggers at bottom right corner and select success. Apply and save you configuration.
Now Goto your job and Click the Add post-build action drop-down, select E-mail notification option.
Enter the recipient email id in the ‘E-mail Notification’ box and select the checkbox next to the ‘Send e-mail for every unstable build’ option.
Click the ‘Add post-build action’ drop-down and select the ‘Editable Email Notification’ option.
In Project Recipient List , This is a comma separated list (optional whitespace after commas) of email addresses that should receive emails. May contain references to build parameters. To CC or BCC someone instead of putting them in the To list, add cc: or bcc: before the email address (e.g., cc:someone@example.com, bcc:bob@example.com).
In Attachments field, you have to give the path of your binary file (i.e path of your .ipa file like, build/artifacts/IPA-Name.ipa)
Now click on Advanced Settings at bottom right corner. Click on Add trigger and select Success trigger. Click on Add drop down from the success trigger and select Recipient List option. Apply and Save your configuration.
n mac-mini for iOS job configuration, if email is not send and gives you java exception error message then you must turn on less secure apps.
回答4:
I also had this problem, and it was because I forgot to set the SMTP server (in the plugin section of configuration), but only saw the default SMTP server settings.
回答5:
My first guess is that the global jenkins email configurations are not set correctly.
Manage Jenkins -> Configure System -> E-mail Notification
This is the default plugin, not the extended one you installed manually. The SMTP server field defaults to localhost, so unless you have an email server setup and running on the same box, this needs to be set.
If that is set then I would try telnet'ing to your email server from your Jenkins server to make sure there is not a connection error.
回答6:
After days of search for answer, it turns out the gmail has attachment limit for 25 mb, and my output is larger than that.
Check your output size if you met this issue and you are using gmail for mail server.
回答7:
Refer all above solutions, if it doesn't work. You can try this solution. Zip file is blocked in Gmail. You should rename your zip file inside script before send it. (Example: file.zip.abcxyz). I solved my problem.
回答8:
I had the same problem. It turns out that for some reason, Jenkins would not save my "Extended E-mail Notification" SMTP settings. At one point, it did save the setting and the emails started working. Make sure that the bit in red is selected and double-check it after you press Save:
回答9:
If every thing fails, try restarting jenkins process. That solved for me. Somehow the Jenkins system was unable to load all of the configs without a restart? But give it a try.
回答10:
Today i faced this issue on a jenkins machine that was sending emails just fine till a couple of weeks ago. I turned it on today and it just wont send emails because of "Error sending to the following VALID addresses"
I tried these steps:
- Made sure I am not attaching any log file in the email.
- Made sure "System Admin" email has the domain name mentioned.
- Jenkins was able to successfully send emails to me when i tried it by "Test configuration by sending test e-mail"
- Downgraded my email ext plugin.
None of the above mentioned steps helped.
Finally i replaced my company's SMTP server with the jenkins default server and it worked just fine. Not sure why this has happened, I need to talk to my IT guys and see if they have enabled any new security in SMTP server.
Hope this helps to people who hit this same issue.
Thanks
来源:https://stackoverflow.com/questions/16191040/jenkins-ext-email-plugin-fails-to-send-email-on-build-success