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

Invalid Illegal email address exception

    Details

    • Similar Issues:

      Description

      The email address I have configured are very simple, just 4 email addresses:
      email1@gmail.com email2@gmail.com email3@gmail.com
      like that. It used to work, however now I'm seeing this. At the least it appears to be a bug in javax.mail as the the error is nearly useless (as usual). But perhaps email-ext to sanitise the addresses first and give a more helpful error?

      23/07/2010 11:03:06 PM hudson.plugins.emailext.ExtendedEmailPublisher addAddress
      WARNING: Could not create email address.
      javax.mail.internet.AddressException: Illegal address in string ``''
              at javax.mail.internet.InternetAddress.<init>(InternetAddress.java:94)
              at hudson.plugins.emailext.ExtendedEmailPublisher.addAddress(ExtendedEmailPublisher.java:353)
              at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:277)
              at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:227)
              at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:219)
              at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:180)
              at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
              at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:601)
              at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:580)
              at hudson.maven.MavenModuleSetBuild$RunnerImpl.cleanUp(MavenModuleSetBuild.java:640)
              at hudson.model.Run.run(Run.java:1299)
              at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:318)
              at hudson.model.ResourceController.execute(ResourceController.java:88)
              at hudson.model.Executor.run(Executor.java:129)
      

        Attachments

          Activity

          Hide
          mindless Alan Harder added a comment -

          does it work if separate the addresses with commas (and optional space after comma)?

          Show
          mindless Alan Harder added a comment - does it work if separate the addresses with commas (and optional space after comma)?
          Hide
          ashlux ashlux added a comment -

          I reproduced this by having an unnecessary space at the beginning of the list.

          " email1@server.com email2@server.com" <= silently fails
          "email1@gmail.com email2@gmail.com " <= works as expected
          "email1@gmail.com email2@gmail.com" <= works as expected

          I don't have time to fix this tonight but the problem is related to the regular expression used to parse the addresses:

          public static final String COMMA_SEPARATED_SPLIT_REGEXP = "[,\\s]+";

          Show
          ashlux ashlux added a comment - I reproduced this by having an unnecessary space at the beginning of the list. " email1@server.com email2@server.com" <= silently fails "email1@gmail.com email2@gmail.com " <= works as expected "email1@gmail.com email2@gmail.com" <= works as expected I don't have time to fix this tonight but the problem is related to the regular expression used to parse the addresses: public static final String COMMA_SEPARATED_SPLIT_REGEXP = " [,\\s] +";
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : ashlux
          Path:
          trunk/hudson/plugins/email-ext/src/main/java/hudson/plugins/emailext/EmailRecepientUtils.java
          trunk/hudson/plugins/email-ext/src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java
          trunk/hudson/plugins/email-ext/src/test/java/hudson/plugins/emailext/EmailRecepientUtilsTest.java
          http://jenkins-ci.org/commit/34161
          Log:
          [FIXED JENKINS-7057] Invalid Illegal email address exception. Also improved error message when validating email recipient list.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : ashlux Path: trunk/hudson/plugins/email-ext/src/main/java/hudson/plugins/emailext/EmailRecepientUtils.java trunk/hudson/plugins/email-ext/src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java trunk/hudson/plugins/email-ext/src/test/java/hudson/plugins/emailext/EmailRecepientUtilsTest.java http://jenkins-ci.org/commit/34161 Log: [FIXED JENKINS-7057] Invalid Illegal email address exception. Also improved error message when validating email recipient list.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : ashlux
          Path:
          trunk/hudson/plugins/email-ext/src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java
          http://jenkins-ci.org/commit/34162
          Log:
          [FIXED JENKINS-7057] Invalid Illegal email address exception. Also improved error message when validating email recipient list.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : ashlux Path: trunk/hudson/plugins/email-ext/src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java http://jenkins-ci.org/commit/34162 Log: [FIXED JENKINS-7057] Invalid Illegal email address exception. Also improved error message when validating email recipient list.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : ashlux
          Path:
          trunk/hudson/plugins/email-ext/src/test/java/hudson/plugins/emailext/ExtendedEmailPublisherTest.java
          http://jenkins-ci.org/commit/34164
          Log:
          [FIXED JENKINS-7057] Invalid Illegal email address exception. Also improved error message when validating email recipient list.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : ashlux Path: trunk/hudson/plugins/email-ext/src/test/java/hudson/plugins/emailext/ExtendedEmailPublisherTest.java http://jenkins-ci.org/commit/34164 Log: [FIXED JENKINS-7057] Invalid Illegal email address exception. Also improved error message when validating email recipient list.

            People

            • Assignee:
              ashlux ashlux
              Reporter:
              antonystubbs antonystubbs
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: