Skip to content

[JENKINS-3983] SMTP authentication not working #18896

Closed

Description

@jenkins-infra-bot

I've tried to use my Exchange 2007 server as an SMTP server for Hudson, which
requires SMTP authentication. I configured the standard authentication settings
which have been confirmed to work on Outlook, Outlook Express as well as our
office printer (which can sending scans by email). When sending a test email, or
having emails sent after a build, I get the following:

com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.1 Client was not
authenticated

See attachment for full stack trace.

It would appear the problem is related to the way JavaMail is called in Hudson.
The following FAQ entry describes the problem:

http://java.sun.com/products/javamail/FAQ.html#smtpauth

I checked hudson.tasks.Mailer in core/src/main/java/hudson/tasks and it seems
indeed that JavaMail is being called using Transport.send(msg) instead of the
method suggested in the FAQ above.


Originally reported by marcb, imported from: SMTP authentication not working
  • status: Resolved
  • priority: Major
  • component(s): core
  • resolution: Fixed
  • resolved: 2012-03-05T12:40:43+00:00
  • votes: 3
  • watchers: 2
  • imported: 2025-11-24
Raw content of original issue

I've tried to use my Exchange 2007 server as an SMTP server for Hudson, which requires SMTP authentication. I configured the standard authentication settings which have been confirmed to work on Outlook, Outlook Express as well as our office printer (which can sending scans by email). When sending a test email, or having emails sent after a build, I get the following:

com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.1 Client was not authenticated

See attachment for full stack trace.

It would appear the problem is related to the way JavaMail is called in Hudson. The following FAQ entry describes the problem:

http://java.sun.com/products/javamail/FAQ.html#smtpauth

I checked hudson.tasks.Mailer in core/src/main/java/hudson/tasks and it seems indeed that JavaMail is being called using Transport.send(msg) instead of the method suggested in the FAQ above.

  • environment: Platform: PC, OS: All
1 attachment

Activity

  1. jenkins-infra-bot commented on Jul 6, 2009

    @jenkins-infra-bot
    Author
    marcb:
    • Original comment link
    • Raw content of original comment:

      Created an attachment (id=772) stack trace

    Created an attachment (id=772)
    stack trace

  2. jenkins-infra-bot commented on Feb 10, 2011

    @jenkins-infra-bot
    Author
    mbaker000:
    • Original comment link
    • Raw content of original comment:

      Triage begin 2/9/2011

      Is this issue still affecting you? SMTP authentication works for me in 1.396.

    Triage begin 2/9/2011

    Is this issue still affecting you? SMTP authentication works for me in 1.396.

  3. jenkins-infra-bot commented on Feb 10, 2011

    @jenkins-infra-bot
    Author
    marc_boscher:
    • Original comment link
    • Raw content of original comment:

      We have since removed authentication requirements for internal emails, so we've worked around this issue.

      Not planning on re-testing this on the short term.

      Good luck with Jenkins!

    We have since removed authentication requirements for internal emails, so we've worked around this issue.

    Not planning on re-testing this on the short term.

    Good luck with Jenkins!

  4. jenkins-infra-bot commented on Feb 10, 2011

    @jenkins-infra-bot
    Author
    mbaker000:
    • Original comment link
    • Raw content of original comment:

      Thanks for the quick response. I'm confident that it's working now, but I'll test it out a little bit at work tomorrow too to see if I can break it.

    Thanks for the quick response. I'm confident that it's working now, but I'll test it out a little bit at work tomorrow too to see if I can break it.

  5. jenkins-infra-bot commented on Feb 12, 2011

    @jenkins-infra-bot
    Author
    mbaker000:
    • Original comment link
    • Raw content of original comment:

      I was able to get Jenkins to send me emails through a GoDaddy SMTP relay requiring authentication without any issues, so I'm comfortable closing this as fixed. Does anyone else care to verify it for themselves before I close it out?

    I was able to get Jenkins to send me emails through a GoDaddy SMTP relay requiring authentication without any issues, so I'm comfortable closing this as fixed. Does anyone else care to verify it for themselves before I close it out?

  6. jenkins-infra-bot commented on Sep 16, 2011

    @jenkins-infra-bot
    Author
    djchild:
    • Original comment link
    • Raw content of original comment:

      I can replicate the problem. My random comments are:

      1) I am running the standalone jenkins.war file 2) The JVM is looking in jre/lib/ext where it is not going to find anything interesting 3) The logs say isSSL false but in the Jenkins configuration I set it to true 4) I am trying to use a MicroSoft mail server, not GoDaddy. 5) The original reporter mentioned Transport.send(msg) which sounds like it could be relevant

      Here is the log output ...

      DEBUG: JavaMail version 1.4 DEBUG: java.io.FileNotFoundException: /usr/bin/jdk1.6.0_27/jre/lib/javamail.providers (No such file or directory) DEBUG: !anyLoaded DEBUG: not loading resource: /META-INF/javamail.providers DEBUG: successfully loaded resource: /META-INF/javamail.default.providers DEBUG: Tables of loaded providers DEBUG: Providers Listed By Class Name:

      {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}

      DEBUG: Providers Listed By Protocol:

      {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}

      DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map DEBUG: !anyLoaded DEBUG: not loading resource: /META-INF/javamail.address.map DEBUG: java.io.FileNotFoundException: /usr/bin/jdk1.6.0_27/jre/lib/javamail.address.map (No such file or directory) DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc] DEBUG SMTP: useEhlo true, useAuth true DEBUG SMTP: useEhlo true, useAuth true DEBUG SMTP: trying to connect to host "Smtp.mail.microsoftonline.com", port 587, isSSL false DEBUG SMTP: exception reading response: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

      Let me know if I can help test anything more.

    I can replicate the problem. My random comments are:

    1) I am running the standalone jenkins.war file
    2) The JVM is looking in jre/lib/ext where it is not going to find anything interesting
    3) The logs say isSSL false but in the Jenkins configuration I set it to true
    4) I am trying to use a MicroSoft mail server, not GoDaddy.
    5) The original reporter mentioned Transport.send(msg) which sounds like it could be relevant

    Here is the log output ...

    DEBUG: JavaMail version 1.4
    DEBUG: java.io.FileNotFoundException: /usr/bin/jdk1.6.0_27/jre/lib/javamail.providers (No such file or directory)
    DEBUG: !anyLoaded
    DEBUG: not loading resource: /META-INF/javamail.providers
    DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
    DEBUG: Tables of loaded providers
    DEBUG: Providers Listed By Class Name:

    {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}

    DEBUG: Providers Listed By Protocol:

    {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}

    DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
    DEBUG: !anyLoaded
    DEBUG: not loading resource: /META-INF/javamail.address.map
    DEBUG: java.io.FileNotFoundException: /usr/bin/jdk1.6.0_27/jre/lib/javamail.address.map (No such file or directory)
    DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
    DEBUG SMTP: useEhlo true, useAuth true
    DEBUG SMTP: useEhlo true, useAuth true
    DEBUG SMTP: trying to connect to host "Smtp.mail.microsoftonline.com", port 587, isSSL false
    DEBUG SMTP: exception reading response: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

    Let me know if I can help test anything more.

  7. jenkins-infra-bot commented on Oct 24, 2011

    @jenkins-infra-bot
    Author
    xusun:
    • Original comment link
    • Raw content of original comment:

      +1

      It seems only repros on Microsoft Exchange, not on other mail systems.

      In my environment, if I set to smtp.gmail.com, it just works fine, but not with any exchange servers.

    +1

    It seems only repros on Microsoft Exchange, not on other mail systems.

    In my environment, if I set to smtp.gmail.com, it just works fine, but not with any exchange servers.

  8. jenkins-infra-bot commented on Dec 5, 2011

    @jenkins-infra-bot
    Author
    djchild:
    • Original comment link
    • Raw content of original comment:

      My colleague Alexander figured this out. The problem we had connecting to the MS server was resolved by setting -Dmail.smtp.starttls.enable="true" in the startup script.

    My colleague Alexander figured this out. The problem we had connecting to the MS server was resolved by setting -Dmail.smtp.starttls.enable="true" in the startup script.

  9. jenkins-infra-bot commented on Mar 5, 2012

    @jenkins-infra-bot
    Author
    kutzi:

    Seems to be fixed in JavaMail 1.4.3
    http://www.oracle.com/technetwork/java/javamail/javamail143-243221.html

  10. jenkins-infra-bot commented on Mar 5, 2012

    @jenkins-infra-bot
    Author
    scm_issue_link:

    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

  11. jenkins-infra-bot commented on Mar 5, 2012

    @jenkins-infra-bot
    Author
    scm_issue_link:

    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

  12. jenkins-infra-bot commented on May 23, 2012

    @jenkins-infra-bot
    Author
    scm_issue_link:

    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 4afaf0b)

  13. jenkins-infra-bot commented on May 23, 2012

    @jenkins-infra-bot
    Author
    scm_issue_link:

    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 c4dd892)

    Conflicts:

    changelog.html

  14. jenkins-infra-bot commented on Nov 24, 2025

    @jenkins-infra-bot
    Author

    [Original is_duplicated_by from Jira: JENKINS-7426]

  15. removed
    bugFor changelog: Minor bug. Will be listed after features
    on Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions