Error sending to the following VALID addresses; SendFailedException message: 501 5.1.7 Invalid Address

7,012 views
Skip to first unread message

Jim Lloyd

unread,
Jul 15, 2014, 1:29:47 PM7/15/14
to jenkins...@googlegroups.com
We have a Jenkins installation that has undergone several changes in the last couple months as we transition from using Perforce to using Git as our SCM. We've had numerous problems with email-ext during the transition, but we may be getting close to a solution.

We're currently using the most recent LTS build (v1.554.3) and latest email-ext (v2.38.1). The error that is preventing Build Result email now is rather strange:

Adding recipients from project recipient list
Adding recipients from trigger recipient list
Successfully created MimeMessage
Sending email to: engineering_p...@redsealnetworks.com
Error sending to the following VALID addresses: engineering_p...@redsealnetworks.com
SendFailedException message: 501 5.1.7 Invalid address

The listed recipient email address is definitely valid. I suppose the error might be indicating that the sender email address is invalid, but it's not obvious to me how to follow up on that hypothesis. Can anyone help?

Slide

unread,
Jul 15, 2014, 2:03:16 PM7/15/14
to Jenkins User Mailing List
You can turn on debug mode in the plugin (global config) and more information should come up in the build log, it should give information from JavaMail as to what is going on.


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Website: http://earl-of-code.com

Jim Lloyd

unread,
Jul 15, 2014, 2:15:45 PM7/15/14
to jenkins...@googlegroups.com
Debug mode was already on for that build. The two lines of error message were all that were present in the log.

Slide

unread,
Jul 15, 2014, 2:42:05 PM7/15/14
to Jenkins User Mailing List
Hmmm, that's strange, I've normally seen a bunch more output from JavaMail, does your mailserver require authentication and is it setup correctly? Can you also check the logs for the container and see if there is additional JavaMail log info there?

Jim Lloyd

unread,
Jul 15, 2014, 3:18:58 PM7/15/14
to jenkins...@googlegroups.com
We don't require authentication, and I can successfully send test emails using the "Test configuration by sending test e-mail" setting under the global setting for E-mail Notification.

We're running the .war directly using "java -jar jenkins.war --logfile=/var/log/jenkins/jenkins.log". The jenkins.log file does not contain any information about this error.


--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/uTCRSeOVME4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.

Slide

unread,
Jul 15, 2014, 4:07:08 PM7/15/14
to Jenkins User Mailing List
Ok, another option is to restart Jenkins and add -Dmail.debug=true to the command line. 

Richard Bywater

unread,
Jul 15, 2014, 5:12:44 PM7/15/14
to jenkins...@googlegroups.com
I would start by asking the group who administers the SMTP server you are talking to. Given that the Invalid Address error is being returned by the server, perhaps there is some policy in place on the SMTP server that prevents you sending to that address?

Richard.


Jim Lloyd

unread,
Jul 15, 2014, 5:31:47 PM7/15/14
to jenkins...@googlegroups.com
I don't think that is the problem. I can send test emails from Jenkins using the "Test configuration by sending test e-mail" setting under the global setting for E-mail Notification. And I can also send emails from the machine without authentication using the mailx command:

mailx -s "Testing 1,2,3" -S smtp=smtp://smtp.ourcompany.com:25 < test.txt

Where the smtp.ourcompany.com address is the same address configured in jenkins.

Finally, we have had emails work in the past. The problems have all come after upgrading Jenkins and various plugins in order to be able to use Git, which was not supported on the ancient version of Jenkins that we were previously using. Even after the upgrade, we were able to have some mails delivered, albeit there were other problems. For more info, see the thread I started on June 13th:

https://groups.google.com/forum/#!topic/jenkinsci-users/eZQsgfCSYM4



You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/uTCRSeOVME4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.

Slide

unread,
Jul 15, 2014, 6:23:10 PM7/15/14
to Jenkins User Mailing List
Ok, let's start over with this. The server is sending back a response that says that engineering_p...@redsealnetworks.com is invalid, but JavaMail thinks the address is valid. This can happen when either the sender or recipient is invalid, can you try the -Dmail.debug=true option that I mentioned? Also, can you post your global config.xml file (after you scrub it for company information). 

Jim Lloyd

unread,
Jul 15, 2014, 7:38:15 PM7/15/14
to jenkins...@googlegroups.com
I have managed to find a combination that seems to work. I stopped using the outlook based smtp server and simply used the default server running on the localhost, and one email was successfully delivered. Note that we have been using the outlook smtp server continuously for months, and all sent multiple test emails through it today, yet that was the only thing I changed in order to get a successful email. I'll do some more testing and reply back if I learn anything more specific about the underlying problem. 

ayuoj...@gmail.com

unread,
Sep 18, 2018, 8:24:10 AM9/18/18
to Jenkins Users
Jim,

Did you find anything other than changing smtp value. I am facing same issue and got only one smtp. All my test emails are working but its throwing error once build done in jenkins. 

Ujjawal Khare

unread,
Jan 4, 2019, 3:32:13 AM1/4/19
to Jenkins Users
Hello,

Me too facing same issue. Test mail works fine but when run build, i get "Error sending mail to following valid...".

@Jim: When  you say you used local server did you mean you configured any email client ?

Can you please guide me in this direction ?


Regards,
Ujjawal

Ujjawal Khare

unread,
Jan 10, 2019, 3:03:56 AM1/10/19
to Jenkins Users
Can any one guide me how to fix this issue "SendFailedException message: 501 5.1.7 Invalid address" ?

Test email was success but fails with error when i execute the build.


Regards,
Ujjawal

Slide

unread,
Jan 10, 2019, 8:23:56 AM1/10/19
to Jenkins User Mailing List
Can you give more information about what mail server you are using and so forth? Also, if you can enable debug mode in the global config area for email-ext (Extended Email Plugin) and post the log with secure information redacted, it might help.


For more options, visit https://groups.google.com/d/optout.


--

Ujjawal Khare

unread,
Jan 10, 2019, 11:00:03 AM1/10/19
to jenkins...@googlegroups.com
Here are attached configuration. When put on DEBUG it validates recipients email and prints :

Error sending to the following VALID addresses; ujjawa...@xyz.com

SendFailedException message: 501 5.1.7 Invalid Address

Note : 
1. sender and reciever emails are correct.
2. My organization smtp server doesn't require smtp authentication and ssl.
3. Test mail works fine and received.

ZFc1A.png
kGIln.png
7xAt1.png

Slide

unread,
Jan 10, 2019, 11:25:13 AM1/10/19
to Jenkins User Mailing List
You need to setup the server settings in the  Extended E-mail Notification section of the global configuration if you are using that configuration in your job.


For more options, visit https://groups.google.com/d/optout.


--

Ujjawal Khare

unread,
Jan 10, 2019, 10:56:04 PM1/10/19
to jenkins...@googlegroups.com
Do you mean Extended email configuration inside  Manage Jenkins --> Configure System ?
Please see the attached configuration. Its already there but still doesn't work.

Extented Email in Configure Settings.png

Ujjawal Khare

unread,
Jan 11, 2019, 3:33:24 AM1/11/19
to jenkins...@googlegroups.com
Here is the debug logs:

Set build name.
New build name is 'xyz #18'
[Start-xyz-TestSuite] $ /var/jenkins_home/tools/ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/local_allure/bin/allure generate -c -o /home/ukhare/move/Start-xyz-TestSuite/allure-report
Report successfully generated to /home/ukhare/move/Start-xyz-TestSuite/allure-report
Allure report was successfully generated.
Creating artifact for the build.
Artifact was added to the build.
Archiving artifacts
Checking for post-build
Performing post-build step
Checking if email needs to be generated
Email was triggered for: Always
Sending email for trigger: Always
messageContentType = text/html; charset=UTF-8
Adding recipients from project recipient list
Analyzing: ujjawal.khare
Looking for: ujjawal.khare
	starting at: 0
	firstFoundIdx: 0
	firstFoundIdx-substring: ujjawal.khare
	=> found type: 0
Analyzing: ujjawal.khare
Looking for: ujjawal.khare
	starting at: 0
	firstFoundIdx: 0
	firstFoundIdx-substring: ujjawal.khare
	=> found type: 0
Analyzing: ujjawal.khare
Looking for: ujjawal.khare
	starting at: 0
	firstFoundIdx: 0
	firstFoundIdx-substring: ujjawal.khare
	=> found type: 0
Adding recipients from trigger recipient list
Analyzing: ujjawa...@xyz.com
Looking for: ujjawa...@xyz.com
	starting at: 0
	firstFoundIdx: 0
	firstFoundIdx-substring: ujjawa...@xyz.com
	=> found type: 0
Analyzing: ujjawa...@xyz.com
Looking for: ujjawa...@xyz.com
	starting at: 0
	firstFoundIdx: 0
	firstFoundIdx-substring: ujjawa...@xyz.com
	=> found type: 0
Analyzing: ujjawa...@xyz.com
Looking for: ujjawa...@xyz.com
	starting at: 0
	firstFoundIdx: 0
	firstFoundIdx-substring: ujjawa...@xyz.com
	=> found type: 0
Successfully created MimeMessage
Sending email to: ujjawa...@xyz.com
Error sending to the following VALID addresses: ujjawa...@xyz.com

SendFailedException message: 501 5.1.7 Invalid address

Finished: SUCCESS


Regards,
Ujjawal

Slide

unread,
Jan 11, 2019, 9:02:33 AM1/11/19
to Jenkins User Mailing List
Do you have the ability to see the logs on the server? The message is coming from your server.


For more options, visit https://groups.google.com/d/optout.


--

Ujjawal Khare

unread,
Jan 11, 2019, 9:36:12 AM1/11/19
to jenkins...@googlegroups.com
Yes I can login to the server but what is the path of log file ? Please tell me and i will check.

Regards,
Ujjawal

Slide

unread,
Jan 11, 2019, 10:21:19 AM1/11/19
to Jenkins User Mailing List
It will depend on what email server you are using.


For more options, visit https://groups.google.com/d/optout.


--

Ujjawal Khare

unread,
Jan 11, 2019, 11:15:53 AM1/11/19
to jenkins...@googlegroups.com
no mail server installed on my machine. So I am using jenkins email plugin to connect my company's mail server.

Slide

unread,
Jan 11, 2019, 12:20:45 PM1/11/19
to Jenkins User Mailing List
Sorry, I should have been more clear. When I said can you view logs on the server, I meant the mail server. 


For more options, visit https://groups.google.com/d/optout.


--
Reply all
Reply to author
Forward
0 new messages