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

Mail server rejecting emails from hudson

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Component/s: mailer-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:
      Show 5 results

      Description

      When sending emails from hudson, my mail server (postfix, but I'm sure others
      will behave similarly too) rejects the message because the smtp HELO message
      isn't being sent.

      This is because the system property mail.smtp.localhost hasn't been set before
      sending the email. This is described in the javadocs for com.sun.mail.smtp.

      See also: http://forum.java.sun.com/thread.jspa?threadID=482673&messageID=2252508.

      The solution is to add some code in hudson.tasks.Mailer.createSession() like:

      props.put("mail.smtp.localhost", localServerName);

      I guess some code to pull the localServerName out of config would be needed to.

      In theory, a work around might be setting a system property when running hudson,
      but I've not been able to make this work yet.

        Attachments

          Activity

          Hide
          typerlc typerlc added a comment -

          Just a quick comment to say the following workaround is successful (if you are
          running hudson stand-alone):

          java -Dmail.smtp.localhost=REPLACE_THIS_WITH_YOUR_HOSTNAME -jar hudson.war

          Show
          typerlc typerlc added a comment - Just a quick comment to say the following workaround is successful (if you are running hudson stand-alone): java -Dmail.smtp.localhost=REPLACE_THIS_WITH_YOUR_HOSTNAME -jar hudson.war
          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          This is a bug in SMTPTransport class in JavaMail. It has the following code to
          send HELO command, but RFC-2821 doesn't allow HELO command without argument.

          private void helo(String domain) throws MessagingException

          { if (domain != null) issueCommand("HELO " + domain, 250); else issueCommand("HELO", 250); }

          Since I work in the Java EE group, let me see if I could fix this bug, rather
          than spend time working around this issue in Hudson...

          Show
          kohsuke Kohsuke Kawaguchi added a comment - This is a bug in SMTPTransport class in JavaMail. It has the following code to send HELO command, but RFC-2821 doesn't allow HELO command without argument. private void helo(String domain) throws MessagingException { if (domain != null) issueCommand("HELO " + domain, 250); else issueCommand("HELO", 250); } Since I work in the Java EE group, let me see if I could fix this bug, rather than spend time working around this issue in Hudson...
          Hide
          kohsuke Kohsuke Kawaguchi added a comment -
          Show
          kohsuke Kohsuke Kawaguchi added a comment - I finally posted this issue at https://glassfish.dev.java.net/issues/show_bug.cgi?id=9941
          Hide
          evernat evernat added a comment -

          The javamail issue has been "fixed" in javamail v1.4.3.

          Show
          evernat evernat added a comment - The javamail issue has been "fixed" in javamail v1.4.3.
          Hide
          evernat evernat added a comment -

          it seems that Jenkins still uses javamail 1.4
          https://github.com/jenkinsci/jenkins/blob/master/core/pom.xml

          Show
          evernat evernat added a comment - it seems that Jenkins still uses javamail 1.4 https://github.com/jenkinsci/jenkins/blob/master/core/pom.xml
          Hide
          kutzi kutzi added a comment -

          Since January, there's a JavaMail 1.4.4 already.
          I can see no reason, why we shouldn't update to that one.

          Show
          kutzi kutzi added a comment - Since January, there's a JavaMail 1.4.4 already. I can see no reason, why we shouldn't update to that one.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          core/pom.xml
          http://jenkins-ci.org/commit/jenkins/4afaf0bbc2c9f7298c45dc527269fb5c81cc710d
          Log:
          Update JavaMail dependency to 1.4.4. Should fix JENKINS-1152 and JENKINS-3983

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: core/pom.xml http://jenkins-ci.org/commit/jenkins/4afaf0bbc2c9f7298c45dc527269fb5c81cc710d Log: Update JavaMail dependency to 1.4.4. Should fix JENKINS-1152 and JENKINS-3983
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/c4dd892ea3067be942d4a89778029ed1522512ff
          Log:
          Changelog for JENKINS-1152 and JENKINS-3983

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: changelog.html http://jenkins-ci.org/commit/jenkins/c4dd892ea3067be942d4a89778029ed1522512ff Log: Changelog for JENKINS-1152 and JENKINS-3983
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          core/pom.xml
          http://jenkins-ci.org/commit/jenkins/efce00a177bd4d6ac64cad481544729e90144358
          Log:
          Update JavaMail dependency to 1.4.4. Should fix JENKINS-1152 and JENKINS-3983(cherry picked from commit 4afaf0bbc2c9f7298c45dc527269fb5c81cc710d)

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: core/pom.xml http://jenkins-ci.org/commit/jenkins/efce00a177bd4d6ac64cad481544729e90144358 Log: Update JavaMail dependency to 1.4.4. Should fix JENKINS-1152 and JENKINS-3983 (cherry picked from commit 4afaf0bbc2c9f7298c45dc527269fb5c81cc710d)
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/f481b1971d32141219e33aad5f449b45463a8e7c
          Log:
          Changelog for JENKINS-1152 and JENKINS-3983
          (cherry picked from commit c4dd892ea3067be942d4a89778029ed1522512ff)

          Conflicts:

          changelog.html

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: changelog.html http://jenkins-ci.org/commit/jenkins/f481b1971d32141219e33aad5f449b45463a8e7c Log: Changelog for JENKINS-1152 and JENKINS-3983 (cherry picked from commit c4dd892ea3067be942d4a89778029ed1522512ff) Conflicts: changelog.html

            People

            • Assignee:
              kutzi kutzi
              Reporter:
              typerlc typerlc
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: