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

Jenkins mailer plugin breaks with two or more emails set in "Reply-To Address"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: mailer-plugin
    • Labels:
      None
    • Environment:
      Jenkins 1.642
    • Similar Issues:

      Description

      Hello,

      If there are two or more addresses set in the "Reply-To Address" (separated by a comma), then builds fail due to the following error (I would like to be able to have more than one email specified as there are more than one person managing Jenkins):

      ERROR: Unable to send to address: fxxxxxxh@cxxxxxxt.com,CxxxxxxK@hxxxxxxxxs.com
      javax.mail.internet.AddressException: Illegal address in string ``fxxxxxxh@cxxxxxxt.com,CxxxxxxK@hxxxxxxxxs.com''
      at javax.mail.internet.InternetAddress.<init>(InternetAddress.java:114)
      at hudson.tasks.Mailer.stringToAddress(Mailer.java:206)
      at jenkins.plugins.mailer.tasks.MimeMessageBuilder.toNormalizedAddress(MimeMessageBuilder.java:262)
      at jenkins.plugins.mailer.tasks.MimeMessageBuilder.buildMimeMessage(MimeMessageBuilder.java:179)
      at hudson.tasks.MailSender.createEmptyMail(MailSender.java:399)
      at hudson.tasks.MailSender.createUnstableMail(MailSender.java:223)
      at hudson.tasks.MailSender.createMail(MailSender.java:185)
      at hudson.tasks.MailSender.run(MailSender.java:109)
      at hudson.tasks.MailSender.execute(MailSender.java:103)
      at hudson.maven.reporters.MavenMailer.end(MavenMailer.java:74)
      at hudson.maven.AbstractMavenBuilder.end(AbstractMavenBuilder.java:104)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:859)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      at hudson.model.Run.execute(Run.java:1738)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:410)
      ERROR: Processing failed due to a bug in the code. Please report this to jenkinsci-users@googlegroups.com
      java.lang.NullPointerException
      at javax.mail.internet.InternetAddress.toString(InternetAddress.java:461)
      at javax.mail.internet.InternetAddress.toString(InternetAddress.java:426)
      at javax.mail.internet.MimeMessage.setAddressHeader(MimeMessage.java:707)
      at javax.mail.internet.MimeMessage.setReplyTo(MimeMessage.java:694)
      at jenkins.plugins.mailer.tasks.MimeMessageBuilder.buildMimeMessage(MimeMessageBuilder.java:179)
      at hudson.tasks.MailSender.createEmptyMail(MailSender.java:399)
      at hudson.tasks.MailSender.createUnstableMail(MailSender.java:223)
      at hudson.tasks.MailSender.createMail(MailSender.java:185)
      at hudson.tasks.MailSender.run(MailSender.java:109)
      at hudson.tasks.MailSender.execute(MailSender.java:103)
      at hudson.maven.reporters.MavenMailer.end(MavenMailer.java:74)
      at hudson.maven.AbstractMavenBuilder.end(AbstractMavenBuilder.java:104)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:859)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      at hudson.model.Run.execute(Run.java:1738)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:410)
      project=hudson.maven.MavenModuleSet@7a591988[iot-core.master-event-source-service]
      project.getModules()=[hudson.maven.MavenModule@553e3d5[iot-core.master-event-source-service/com.cxxxxxxt.platform.eventsource:eventsource-parent][iot-core.master-event-source-service/com.cxxxxxxt.platform.eventsource:eventsource-parent][relativePath:], hudson.maven.MavenModule@1e9d5aed[iot-core.master-event-source-service/com.cxxxxxxt.platform.eventsource.client:eventsource-client][iot-core.master-event-source-service/com.cxxxxxxt.platform.eventsource.client:eventsource-client][relativePath:client], hudson.maven.MavenModule@2e2d3108[iot-core.master-event-source-service/com.cxxxxxxt.platform.eventsource.core:eventsource-core][iot-core.master-event-source-service/com.cxxxxxxt.platform.eventsource.core:eventsource-core][relativePath:core], hudson.maven.MavenModule@5a9fb7fe[iot-core.master-event-source-service/com.cxxxxxxt.platform.eventsource.protobuf:eventsource-protobuf][iot-core.master-event-source-service/com.cxxxxxxt.platform.eventsource.protobuf:eventsource-protobuf][relativePath:protobuf], hudson.maven.MavenModule@786a74c5[iot-core.master-event-source-service/com.cxxxxxxt.platform.eventsource.server:eventsource-server][iot-core.master-event-source-service/com.cxxxxxxt.platform.eventsource.server:eventsource-server][relativePath:server], hudson.maven.MavenModule@7fbb0361[iot-core.master-event-source-service/com.cxxxxxxt.platform.eventsource.webapp:eventsource-webapp][iot-core.master-event-source-service/com.cxxxxxxt.platform.eventsource.webapp:eventsource-webapp][relativePath:webapp]]
      project.getRootModule()=hudson.maven.MavenModule@553e3d5[iot-core.master-event-source-service/com.cxxxxxxt.platform.eventsource:eventsource-parent][iot-core.master-event-source-service/com.cxxxxxxt.platform.eventsource:eventsource-parent][relativePath:]
      FATAL: null
      java.lang.NullPointerException
      at javax.mail.internet.InternetAddress.toString(InternetAddress.java:461)
      at javax.mail.internet.InternetAddress.toString(InternetAddress.java:426)
      at javax.mail.internet.MimeMessage.setAddressHeader(MimeMessage.java:707)
      at javax.mail.internet.MimeMessage.setReplyTo(MimeMessage.java:694)
      at jenkins.plugins.mailer.tasks.MimeMessageBuilder.buildMimeMessage(MimeMessageBuilder.java:179)
      at hudson.tasks.MailSender.createEmptyMail(MailSender.java:399)
      at hudson.tasks.MailSender.createUnstableMail(MailSender.java:223)
      at hudson.tasks.MailSender.createMail(MailSender.java:185)
      at hudson.tasks.MailSender.run(MailSender.java:109)
      at hudson.tasks.MailSender.execute(MailSender.java:103)
      at hudson.maven.reporters.MavenMailer.end(MavenMailer.java:74)
      at hudson.maven.AbstractMavenBuilder.end(AbstractMavenBuilder.java:104)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:859)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      at hudson.model.Run.execute(Run.java:1738)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:410)
      Skipping sonar analysis due to bad build status FAILURE
      ERROR: Unable to send to address: fxxxxxxh@cxxxxxxt.com,CxxxxxxK@hxxxxxxxxs.com
      javax.mail.internet.AddressException: Illegal address in string ``fxxxxxxh@cxxxxxxt.com,CxxxxxxK@hxxxxxxxxs.com''
      at javax.mail.internet.InternetAddress.<init>(InternetAddress.java:114)
      at hudson.tasks.Mailer.stringToAddress(Mailer.java:206)
      at jenkins.plugins.mailer.tasks.MimeMessageBuilder.toNormalizedAddress(MimeMessageBuilder.java:262)
      at jenkins.plugins.mailer.tasks.MimeMessageBuilder.buildMimeMessage(MimeMessageBuilder.java:179)
      at hudson.tasks.MailSender.createEmptyMail(MailSender.java:399)
      at hudson.tasks.MailSender.createFailureMail(MailSender.java:262)
      at hudson.tasks.MailSender.createMail(MailSender.java:180)
      at hudson.tasks.MailSender.run(MailSender.java:109)
      at hudson.tasks.MailSender.execute(MailSender.java:103)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.cleanUp(MavenModuleSetBuild.java:1065)
      at hudson.model.Run.execute(Run.java:1785)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:410)
      FATAL: null
      java.lang.NullPointerException
      at javax.mail.internet.InternetAddress.toString(InternetAddress.java:461)
      at javax.mail.internet.InternetAddress.toString(InternetAddress.java:426)
      at javax.mail.internet.MimeMessage.setAddressHeader(MimeMessage.java:707)
      at javax.mail.internet.MimeMessage.setReplyTo(MimeMessage.java:694)
      at jenkins.plugins.mailer.tasks.MimeMessageBuilder.buildMimeMessage(MimeMessageBuilder.java:179)
      at hudson.tasks.MailSender.createEmptyMail(MailSender.java:399)
      at hudson.tasks.MailSender.createFailureMail(MailSender.java:262)
      at hudson.tasks.MailSender.createMail(MailSender.java:180)
      at hudson.tasks.MailSender.run(MailSender.java:109)
      at hudson.tasks.MailSender.execute(MailSender.java:103)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.cleanUp(MavenModuleSetBuild.java:1065)
      at hudson.model.Run.execute(Run.java:1785)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:410)

        Attachments

          Issue Links

            Activity

            Hide
            andresrc Andres Rodriguez added a comment -

            Released as 1.17

            Show
            andresrc Andres Rodriguez added a comment - Released as 1.17
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andres Rodriguez
            Path:
            src/main/java/jenkins/plugins/mailer/tasks/MimeMessageBuilder.java
            src/test/java/jenkins/plugins/mailer/tasks/MimeMessageBuilderTest.java
            http://jenkins-ci.org/commit/mailer-plugin/97f8508bd1d08313335d6d59af8ec91c559877a1
            Log:
            Merge pull request #26 from andresrc/JENKINS-32301

            JENKINS-32301 Support more than one Reply-To Address

            Compare: https://github.com/jenkinsci/mailer-plugin/compare/9a487a964495...97f8508bd1d0

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andres Rodriguez Path: src/main/java/jenkins/plugins/mailer/tasks/MimeMessageBuilder.java src/test/java/jenkins/plugins/mailer/tasks/MimeMessageBuilderTest.java http://jenkins-ci.org/commit/mailer-plugin/97f8508bd1d08313335d6d59af8ec91c559877a1 Log: Merge pull request #26 from andresrc/ JENKINS-32301 JENKINS-32301 Support more than one Reply-To Address Compare: https://github.com/jenkinsci/mailer-plugin/compare/9a487a964495...97f8508bd1d0
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andres Rodriguez
            Path:
            src/main/java/jenkins/plugins/mailer/tasks/MimeMessageBuilder.java
            http://jenkins-ci.org/commit/mailer-plugin/5aebf600ca1383febde187adcd2b06b0b6f3356c
            Log:
            JENKINS-32301 Document that MimeMessageBuilder is not thread-safe.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andres Rodriguez Path: src/main/java/jenkins/plugins/mailer/tasks/MimeMessageBuilder.java http://jenkins-ci.org/commit/mailer-plugin/5aebf600ca1383febde187adcd2b06b0b6f3356c Log: JENKINS-32301 Document that MimeMessageBuilder is not thread-safe.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andres Rodriguez
            Path:
            src/main/java/jenkins/plugins/mailer/tasks/MimeMessageBuilder.java
            src/test/java/jenkins/plugins/mailer/tasks/MimeMessageBuilderTest.java
            http://jenkins-ci.org/commit/mailer-plugin/b619a503f87d8e7c45dd3274f73c50486f5cb5d8
            Log:
            JENKINS-32301 Support more than one Reply-To Address

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andres Rodriguez Path: src/main/java/jenkins/plugins/mailer/tasks/MimeMessageBuilder.java src/test/java/jenkins/plugins/mailer/tasks/MimeMessageBuilderTest.java http://jenkins-ci.org/commit/mailer-plugin/b619a503f87d8e7c45dd3274f73c50486f5cb5d8 Log: JENKINS-32301 Support more than one Reply-To Address

              People

              • Assignee:
                andresrc Andres Rodriguez
                Reporter:
                farahfa Fadi Farah
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: