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

email-ext cannot send emails when global recepient list is empty

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: email-ext-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      Use case:
      Create a new job, choose to use email-ext, and do not enter anything for the
      global list. Then for the "Success" emails enter a recepient list (locally only
      for success notification) and choose the checkbox "send to recipients". Message
      notification is never send.
      Problem analysis:
      There is bug in the code, that never checks if the global recepients list is
      empty. Then it silently fails with an error message in the console log, but
      don't even print the stacktrace of the exception

        Attachments

          Activity

          thexman thexman created issue -
          Hide
          thexman thexman added a comment -

          Created an attachment (id=216)
          This is a fixed version of the email publisher. The changes are on line 204 (adding the check for empty list) and line 183(printing the exception, otherwise the user will never understand what the problem is)

          Show
          thexman thexman added a comment - Created an attachment (id=216) This is a fixed version of the email publisher. The changes are on line 204 (adding the check for empty list) and line 183(printing the exception, otherwise the user will never understand what the problem is)
          mindless Alan Harder made changes -
          Field Original Value New Value
          Component/s email-ext [ 15538 ]
          Component/s mail [ 15493 ]
          Hide
          mindless Alan Harder added a comment -

          Is this old issue still a problem?

          Show
          mindless Alan Harder added a comment - Is this old issue still a problem?
          Hide
          mindless Alan Harder added a comment -

          Will close soon without further input, thanks.

          Show
          mindless Alan Harder added a comment - Will close soon without further input, thanks.
          Hide
          thexman thexman added a comment - - edited

          Hi
          Sorry for the latest reply. The issue is still a problem.
          In order to reproduce it, you need to configure an empty job with extended email configuration and to enter email address in the success recipient list (but leave the global recipient list empty).

          Here is the exception that appears in the console output of the job:

          Email was triggered for: Success
          There are 1 triggered emails.
          Sending email for trigger: Success
          ERROR: Could not send email as a part of the post-build publishers.
          javax.mail.internet.AddressException: Illegal address in string ``''
          at javax.mail.internet.InternetAddress.<init>(InternetAddress.java:94)
          at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:287)
          at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:249)
          at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:241)
          at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:199)
          at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
          at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:541)
          at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:527)
          at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:515)
          at hudson.model.Build$RunnerImpl.cleanUp(Build.java:158)
          at hudson.model.Run.run(Run.java:1218)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:123)

          P.S. I forget to mention that no email has been sent

          Show
          thexman thexman added a comment - - edited Hi Sorry for the latest reply. The issue is still a problem. In order to reproduce it, you need to configure an empty job with extended email configuration and to enter email address in the success recipient list (but leave the global recipient list empty). Here is the exception that appears in the console output of the job: Email was triggered for: Success There are 1 triggered emails. Sending email for trigger: Success ERROR: Could not send email as a part of the post-build publishers. javax.mail.internet.AddressException: Illegal address in string ``'' at javax.mail.internet.InternetAddress.<init>(InternetAddress.java:94) at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:287) at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:249) at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:241) at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:199) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:541) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:527) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:515) at hudson.model.Build$RunnerImpl.cleanUp(Build.java:158) at hudson.model.Run.run(Run.java:1218) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:123) P.S. I forget to mention that no email has been sent
          mindless Alan Harder made changes -
          Assignee mindless [ mindless ]
          mindless Alan Harder made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          mindless Alan Harder added a comment -

          I'll take a look, but there's an easy workaround: uncheck the "send to recipients" checkbox if the global recipients list is empty.

          Show
          mindless Alan Harder added a comment - I'll take a look, but there's an easy workaround: uncheck the "send to recipients" checkbox if the global recipients list is empty.
          Hide
          mindless Alan Harder added a comment -

          This was fixed by againjj in r15195.
          There are many unreleased changes in email-ext, including this fix.. I'll look into putting out a new release.

          Show
          mindless Alan Harder added a comment - This was fixed by againjj in r15195. There are many unreleased changes in email-ext, including this fix.. I'll look into putting out a new release.
          mindless Alan Harder made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Assignee mindless [ mindless ]
          Resolution Fixed [ 1 ]
          abayer Andrew Bayer made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 131602 ] JNJira + In-Review [ 200793 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              thexman thexman
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: