Unable to send email notifications

3,367 views
Skip to first unread message

Mehul Sanghvi

unread,
Aug 19, 2011, 7:23:43 PM8/19/11
to jenkins...@googlegroups.com
The setup I've got:

Manage Jenkins -> E-mail notification

SMTP Server: smtp.fu.bar

Default user e-mail suffix: @fu.bar

System Admin E-mail address: CT-Build <ct-b...@fu.bar>


Dashboard -> BUILD-PROJECT-A -> Configure -> E-mail notification

Recipients: user1 user2 user3

Checked "Send e-mail for every unstable build"

Checked "Send separate e-mails to individuals who broke the build"

I get the following error in BUILD-PROJECT-A which I have never seen
before in the logs.

--------- BEGIN ERROR MESSAGE -----------
Sending e-mails to: user1 user2 user3 us...@fu.bar us...@fu.bar
ERROR: 250 2.6.0
<1800803851.401313786809460.JavaMail.SYSTEM@DEV-CT-MASTER5> Queued
mail for delivery

com.sun.mail.smtp.SMTPSendFailedException: 250 2.6.0
<1800803851.401313786809460.JavaMail.SYSTEM@DEV-CT-MASTER5> Queued
mail for delivery
;
nested exception is:
com.sun.mail.smtp.SMTPAddressFailedException: 501 5.1.3 Invalid address
;
nested exception is:
com.sun.mail.smtp.SMTPAddressFailedException: 501 5.1.3 Invalid address
;
nested exception is:
com.sun.mail.smtp.SMTPAddressFailedException: 501 5.1.3 Invalid address
;
nested exception is:
com.sun.mail.smtp.SMTPAddressFailedException: 501 5.1.3 Invalid address
;
nested exception is:
com.sun.mail.smtp.SMTPAddressFailedException: 501 5.1.3 Invalid address
;
nested exception is:
com.sun.mail.smtp.SMTPAddressFailedException: 501 5.1.3 Invalid address
;
nested exception is:
com.sun.mail.smtp.SMTPAddressFailedException: 501 5.1.3 Invalid address

at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:598)
at javax.mail.Transport.send0(Transport.java:169)
at javax.mail.Transport.send(Transport.java:98)
at hudson.tasks.MailSender.execute(MailSender.java:111)
at hudson.tasks.Mailer.perform(Mailer.java:101)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:664)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:639)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:617)
at hudson.model.Build$RunnerImpl.post2(Build.java:161)
at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:586)
at hudson.model.Run.run(Run.java:1400)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:175)
Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 501 5.1.3
Invalid address
;
nested exception is:
com.sun.mail.smtp.SMTPAddressFailedException: 501 5.1.3 Invalid address
;
nested exception is:
com.sun.mail.smtp.SMTPAddressFailedException: 501 5.1.3 Invalid address
;
nested exception is:
com.sun.mail.smtp.SMTPAddressFailedException: 501 5.1.3 Invalid address

at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1047)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:584)
... 14 more
Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 501 5.1.3
Invalid address
;
nested exception is:
com.sun.mail.smtp.SMTPAddressFailedException: 501 5.1.3 Invalid address

... 16 more
Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 501 5.1.3
Invalid address

... 16 more
Finished: UNSTABLE

--------- END ERROR MESSAGE -----------

Why is it saying invalid address ? Shouldn't user1 above have been
changed to us...@fu.bar because E-mail suffix is set to @fu.bar ?
At least that is the interpretation I have of what it says in the help
when you hover over the help icon.

Any thoughts ? Ideas ?

--
Mehul N. Sanghvi
email: mehul....@gmail.com

Slide

unread,
Aug 19, 2011, 7:25:17 PM8/19/11
to jenkins...@googlegroups.com
Just to double check, this is the default email notification setup, not the email-ext plugin, correct?

slide

Mehul Sanghvi

unread,
Aug 19, 2011, 7:34:40 PM8/19/11
to jenkins...@googlegroups.com
On Fri, Aug 19, 2011 at 19:25, Slide <slide...@gmail.com> wrote:
> Just to double check, this is the default email notification setup, not the
> email-ext plugin, correct?
> slide
>
>
>
>
> --
> slide-o-blog
> http://slide-o-blog.blogspot.com/
>

Yes this is the default E-mail notification. Not the one the email-ext plugin.

Jenkins correctly identified the users whose code had been used in the
build (user4 and user5) and also
added the suffix for them. So why is it saying the addresses are incorrect ?

cheers,

mehul

Kamal Ahmed

unread,
Aug 19, 2011, 10:13:06 PM8/19/11
to jenkins...@googlegroups.com
would all the email addresses pass the regex test ?

Mehul Sanghvi

unread,
Aug 19, 2011, 11:34:48 PM8/19/11
to jenkins...@googlegroups.com
I didn't realise that there was a regex test. Where is this configured ?

All the usernames are made from the 1st initial of the first name + lastname:

msan...@fu.bar
kah...@fu.bar

etc etc.

In subversion its just the username (msanghvi, kahmed, etc.) and
Jenkins should be adding @fu.bar
since that is the suffix which has been configured.


Is there some place where I can look at the logs for Jenkins rather
then the console output ? Is there a way to do debugging
output for Jenkins so I can get more details on what is going wrong ?

cheers,

mehul

Slide

unread,
Aug 19, 2011, 11:43:15 PM8/19/11
to jenkins...@googlegroups.com

The regex test is in the java libraries smtp code. Do you have an example of what the full recipient list looks like?

Mehul Sanghvi

unread,
Aug 20, 2011, 12:23:24 AM8/20/11
to jenkins...@googlegroups.com
There are 3 users on the recipient list specified in the project
configuration: user1 user2 user3

They are separated by whitespace not a comma.

There are also 27 other users pulled in from the subversion log
messages for the commits that were
incorporated into that build.

That makes a total of 30 addresses.


Your question prompted me to look at the list of users again, and I
noticed a user that does not exist.
Its just a dummy username used by our build system. It does something
with some svn properties. It may
be a proper user account on some build machine but it is not in our MS
Exchange email directory.

I think that would explain the invalid email address message.

Would be nice if it could mention which email address was invalid in
the console log :)

Is there a way to tell Jenkins to ignore certain log messages in
subversion ? Or maybe tell Jenkins to not
send out email to certain build-bot type users ?

cheers,

mehul

Kamal Ahmed

unread,
Aug 20, 2011, 12:29:38 AM8/20/11
to jenkins...@googlegroups.com
have you tried with one email address for ALL ? also the option of sending email to those who broke the build is tied in with the SCM you are using (i think)

Mehul Sanghvi

unread,
Aug 20, 2011, 10:43:27 AM8/20/11
to jenkins...@googlegroups.com
Yes I have another project for which I am the only recipient and that
was showing the same
error as well. It had to do with the option to send email to those
broke the build. There is a build-bot
type user included in that. I will have to get IT department to add
that user into the email directory
or something like that.

Joshua McKinnon

unread,
Sep 1, 2011, 3:01:58 PM9/1/11
to jenkins...@googlegroups.com
I have also just recently noticed a similar behavior. We just upgraded our Exchange server, and now I get the same message. It probably depends also on mailserver configuration on whether it accepts local mail to address without domain.

I think I know why...email addresses in "Recipients" field do not appear to get the Default user e-mail suffix appended to them. so "user1 user2 user3" translates into user1;user2;user3, not us...@foo.com;us...@foo.com;us...@foo.com

What happens if you fully qualify all email addresses in the Recipients list? Any committers emails would get fully qualified from "foo" to "f...@bar.com" but recipients list entries do not appear to...

This was not intuitive to me at all, I expected the suffix to get appended in that field as well. Maybe time for a small RFE / patch ;)

Joshua

Mehul Sanghvi

unread,
Sep 1, 2011, 3:11:09 PM9/1/11
to jenkins...@googlegroups.com
Yes I tried that out yesterday and got the same result.

The addresses in the Recipients field are not getting the default
email suffix added. If I
provide an explicit fqdn email address for the Recipients list, then
everything works fine.

We have not had an upgrade of our Exchange server. This used to work.
I'll try and track down
when I started seeing this to possibly narrow things down.

Joshua McKinnon

unread,
Sep 1, 2011, 3:27:54 PM9/1/11
to jenkins...@googlegroups.com
Interesting... in my case I have not changed my Jenkins/plugins environment in a long time (>6 months). I suppose I've upgraded Java though.

Is it possible your email server admin changed your email server configuration? Can you go back in your build history to a build where email *did* send without errors and show the log line of email addresses it sent to? e.g, "Sending emails to: user1 user2 user3"

If you don't see the @foo.com in the usernames there, then Jenkins was not appending the suffix when it was working either. We can both argue that it should be appending, but I don't think it has been for a long time. When it does, you will see the modified email address.

e.g. "Sending emails to us...@foo.com us...@foo.com us...@foo.com

In my case I have a line that looks as follows:
"Sending emails to user1 user2 us...@foo.com", where I specified 2 users in recipients list ("user1 user2"), and had 1 committer (that was user1). Committer received the email...got the smtp errors for "user1" "user2".

For reference, I am reproducing this behavior on both:
- Jenkins 1.397 with email-ext 2.6
- Jenkins 1.428 (latest), built in email (no email-ext) 


Joshua
Reply all
Reply to author
Forward
0 new messages