Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-1094

Add full support of JavaMail 1.5 for SMTPAppender

    Details

      Description

      SMTPAppender cannot be used to send mails using an SSL connection with the last two releases of JavaMail (1.5.3 and 1.5.4).

      When JavaMail 1.5.3 or 1.5.4 is used, the session isn't correctly built anymore and it results in JavaMail being unable to connect to the server:

      DEBUG: JavaMail version 1.5.4
      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,Oracle], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Oracle], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle]}
      DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Oracle], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Oracle], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle]}
      DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
      2015-08-14 14:35:33.104 ERROR   --- [est.Main.main()] fr.romainmoreau.test.Main                : Test
      DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle]
      DEBUG SMTP: need username and password for authentication
      DEBUG SMTP: useEhlo true, useAuth true
      DEBUG SMTP: trying to connect to host "smtp.gmail.com", port 465, isSSL false
      DEBUG SMTP: EOF: [EOF]
      DEBUG SMTP: could not connect to host "smtp.gmail.com", port: 465, response: -1

      A reproduction project based on Gmail can be found here: https://github.com/romainmoreau/logback-test/

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ceki Ceki Gülcü
                Reporter:
                romainmoreau Romain Moreau
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: