Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-11683

email-ext: user unknown ($PROJECT_DEFAULT_RECIPIENTS) exception

      According to https://issues.jenkins-ci.org/browse/JENKINS-11665, global recipients variable does no longer exist.
      But is still use in email-ext plugin, even if there is not present. $PROJECT_DEFAULT_RECIPIENTS is added to recipient list automatically.

      Stacktrace:
      Email was triggered for: Success
      Sending email for trigger: Success
      Sending email to: www.test@xxxxxxx.com $PROJECT_DEFAULT_RECIPIENTS
      ERROR: Could not send email as a part of the post-build publishers.
      com.sun.mail.smtp.SMTPSendFailedException: 250 2.0.0 pA99kJg2007424 Message accepted for delivery;
      nested exception is:
      com.sun.mail.smtp.SMTPAddressFailedException: 550 5.1.1 <$PROJECT_DEFAULT_RECIPIENTS>... user unknown
      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:99)
      at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:260)
      at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:243)
      at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:203)
      at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
      at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:695)
      at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:670)
      at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:648)
      at hudson.model.Build$RunnerImpl.cleanUp(Build.java:172)
      at hudson.model.Run.run(Run.java:1448)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:47)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:230)

          [JENKINS-11683] email-ext: user unknown ($PROJECT_DEFAULT_RECIPIENTS) exception

          stibbons added a comment -

          Also had to revert to 2.15 while waiting for this regression to be fixed

          stibbons added a comment - Also had to revert to 2.15 while waiting for this regression to be fixed

          jpschewe added a comment -

          I'm running Jenkins 1.448 and Jenkins Email Extension Plugin 2.16 and see this behavior as well. I did not see it happening with Jenkins 1.437 and Jenkins Email Extension Plugin 2.15.

          jpschewe added a comment - I'm running Jenkins 1.448 and Jenkins Email Extension Plugin 2.16 and see this behavior as well. I did not see it happening with Jenkins 1.437 and Jenkins Email Extension Plugin 2.15.

          jpschewe added a comment -

          I did find that if I remove the trigger and then add it back PROJECT_DEFAULT_RECIPIENTS is removed from my config.xml. So Perhaps all one needs to do is edit all config.xml files. It would probably be better if email-ext upgraded the settings itself though.

          jpschewe added a comment - I did find that if I remove the trigger and then add it back PROJECT_DEFAULT_RECIPIENTS is removed from my config.xml. So Perhaps all one needs to do is edit all config.xml files. It would probably be better if email-ext upgraded the settings itself though.

          jpschewe added a comment -

          Just editing config.xml and removing PROJECT_DEFAULT_RECIPIENTS didn't fix it. I restarted Jenkins and that left me with an empty recipient list message all of the time. I removed all of my triggers, saved the config, then added the triggers back and now it sends email properly. Hope this helps debug the issue.

          jpschewe added a comment - Just editing config.xml and removing PROJECT_DEFAULT_RECIPIENTS didn't fix it. I restarted Jenkins and that left me with an empty recipient list message all of the time. I removed all of my triggers, saved the config, then added the triggers back and now it sends email properly. Hope this helps debug the issue.

          Nils Probson added a comment -

          or try this
          find ./jobs -type f -name "*config.xml" | xargs grep -l "PROJECT_DEFAULT_RECIPIENTS" 2>/dev/null | xargs sed -i 's/PROJECT_DEFAULT_RECIPIENTS/DEFAULT_RECIPIENTS/'

          Nils Probson added a comment - or try this find ./jobs -type f -name "*config.xml" | xargs grep -l "PROJECT_DEFAULT_RECIPIENTS" 2>/dev/null | xargs sed -i 's/PROJECT_DEFAULT_RECIPIENTS/DEFAULT_RECIPIENTS/'

          jpschewe added a comment -

          No that doesn't work. That results in the error below. Something else needs to be modified in the setup.
          16:03:07 Recording test results
          16:03:08 Email was triggered for: Success
          16:03:08 Sending email for trigger: Success
          16:03:08 Sending email to: $DEFAULT_RECIPIENTS
          16:03:09 ERROR: Could not send email as a part of the post-build publishers.
          16:03:09 javax.mail.SendFailedException: Invalid Addresses;
          16:03:09 nested exception is:
          16:03:09 com.sun.mail.smtp.SMTPAddressFailedException: 501 <$DEFAULT_RECIPIENTS>: recipient address must contain a domain
          16:03:09
          16:03:09 at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1196)
          16:03:09 at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:584)
          16:03:09 at javax.mail.Transport.send0(Transport.java:169)
          16:03:09 at javax.mail.Transport.send(Transport.java:98)
          16:03:09 at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:263)
          16:03:09 at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:247)
          16:03:09 at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:207)
          16:03:09 at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
          16:03:09 at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:700)
          16:03:09 at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:675)
          16:03:09 at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:653)
          16:03:09 at hudson.model.Build$RunnerImpl.cleanUp(Build.java:171)
          16:03:09 at hudson.model.Run.run(Run.java:1453)
          16:03:09 at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
          16:03:09 at hudson.model.ResourceController.execute(ResourceController.java:88)
          16:03:09 at hudson.model.Executor.run(Executor.java:238)
          16:03:09 Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 501 <$DEFAULT_RECIPIENTS>: recipient address must contain a domain
          16:03:09
          16:03:09 at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1047)
          16:03:09 ... 15 more

          jpschewe added a comment - No that doesn't work. That results in the error below. Something else needs to be modified in the setup. 16:03:07 Recording test results 16:03:08 Email was triggered for: Success 16:03:08 Sending email for trigger: Success 16:03:08 Sending email to: $DEFAULT_RECIPIENTS 16:03:09 ERROR: Could not send email as a part of the post-build publishers. 16:03:09 javax.mail.SendFailedException: Invalid Addresses; 16:03:09 nested exception is: 16:03:09 com.sun.mail.smtp.SMTPAddressFailedException: 501 <$DEFAULT_RECIPIENTS>: recipient address must contain a domain 16:03:09 16:03:09 at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1196) 16:03:09 at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:584) 16:03:09 at javax.mail.Transport.send0(Transport.java:169) 16:03:09 at javax.mail.Transport.send(Transport.java:98) 16:03:09 at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:263) 16:03:09 at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:247) 16:03:09 at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:207) 16:03:09 at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36) 16:03:09 at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:700) 16:03:09 at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:675) 16:03:09 at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:653) 16:03:09 at hudson.model.Build$RunnerImpl.cleanUp(Build.java:171) 16:03:09 at hudson.model.Run.run(Run.java:1453) 16:03:09 at hudson.matrix.MatrixRun.run(MatrixRun.java:146) 16:03:09 at hudson.model.ResourceController.execute(ResourceController.java:88) 16:03:09 at hudson.model.Executor.run(Executor.java:238) 16:03:09 Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 501 <$DEFAULT_RECIPIENTS>: recipient address must contain a domain 16:03:09 16:03:09 at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1047) 16:03:09 ... 15 more

          Alex Earl added a comment -

          Working on a fix for this.

          Alex Earl added a comment - Working on a fix for this.

          Niels Wegner added a comment - - edited

          According to the value displayed in the Jenkins configuration it should be possible to use $DEFAULT_RECIPIENT_LIST instead

          Niels Wegner added a comment - - edited According to the value displayed in the Jenkins configuration it should be possible to use $DEFAULT_RECIPIENT_LIST instead

          Code changed in jenkins
          User: slide
          Path:
          src/main/java/hudson/plugins/emailext/EmailExtensionPlugin.java
          src/main/java/hudson/plugins/emailext/EmailRecepientUtils.java
          src/main/java/hudson/plugins/emailext/EmailType.java
          src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java
          src/main/java/hudson/plugins/emailext/ExtendedEmailPublisherDescriptor.java
          src/main/java/hudson/plugins/emailext/plugins/ContentBuilder.java
          src/main/resources/hudson/plugins/emailext/ExtendedEmailPublisher/config.jelly
          src/test/java/hudson/plugins/emailext/ExtendedEmailPublisherTest.java
          src/test/java/hudson/plugins/emailext/plugins/ContentBuilderTest.java
          http://jenkins-ci.org/commit/email-ext-plugin/09296a6d5e321ea6a553b0ff1de58a6b165d13c7
          Log:
          Merge pull request #27 from slide/master

          Fix JENKINS-11683, JENKINS-1144, JENKINS-11665

          Compare: https://github.com/jenkinsci/email-ext-plugin/compare/3789acf...09296a6

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: slide Path: src/main/java/hudson/plugins/emailext/EmailExtensionPlugin.java src/main/java/hudson/plugins/emailext/EmailRecepientUtils.java src/main/java/hudson/plugins/emailext/EmailType.java src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java src/main/java/hudson/plugins/emailext/ExtendedEmailPublisherDescriptor.java src/main/java/hudson/plugins/emailext/plugins/ContentBuilder.java src/main/resources/hudson/plugins/emailext/ExtendedEmailPublisher/config.jelly src/test/java/hudson/plugins/emailext/ExtendedEmailPublisherTest.java src/test/java/hudson/plugins/emailext/plugins/ContentBuilderTest.java http://jenkins-ci.org/commit/email-ext-plugin/09296a6d5e321ea6a553b0ff1de58a6b165d13c7 Log: Merge pull request #27 from slide/master Fix JENKINS-11683 , JENKINS-1144 , JENKINS-11665 Compare: https://github.com/jenkinsci/email-ext-plugin/compare/3789acf...09296a6

          Alex Earl added a comment -

          Fixed in 09296a6

          Alex Earl added a comment - Fixed in 09296a6

            slide_o_mix Alex Earl
            mbr Bruno Marti
            Votes:
            17 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved: