Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-33377

Upgrade JavaMail from 1.5.6 to 1.6.0

    Details

    • 12 status:
      Resolved
    • Test Plan:
      Hide
      1. You need to build a local instance of Sakai (Or use one where you can change the properties.
      2. Enable an SMTP server modifying these properties (This are for GMAIL).

      smtp@org.sakaiproject.email.api.EmailService=smtp.gmail.com
      smtpPort@org.sakaiproject.email.api.EmailService=465
      smtpUser@org.sakaiproject.email.api.EmailService=xxx@gmail.com
      smtpPassword@org.sakaiproject.email.api.EmailService=xxx
      smtpUseSSL@org.sakaiproject.email.api.EmailService=true
      smtpDebug@org.sakaiproject.email.api.EmailService=true
      smtpFrom@org.sakaiproject.email.api.EmailService=xxx@gmail.com
      portal.error.email=xxx@gmail.com
      setup.request=xxx@gmail.com

      1. Send a private message to any user with a valid email address (You can use a mailinator.com virtual inbox).
      2. Check the inbox, you should receive an email
      3. Check the debug logs and confirm the email has been sent successfully.

       DEBUG: JavaMail version 1.6.0
      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
      DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Oracle]
      DEBUG SMTP: useEhlo true, useAuth false
      DEBUG SMTP: trying to connect to host "smtp.gmail.com", port 465, isSSL true
      220 smtp.gmail.com ESMTP l15sm10334604wrl.47 - gsmtp
      DEBUG SMTP: connected to host "smtp.gmail.com", port: 465

      EHLO mpellicer-msi
      250-smtp.gmail.com at your service, [188.85.41.117]
      250-SIZE 35882577
      250-8BITMIME
      250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
      250-ENHANCEDSTATUSCODES
      250-PIPELINING
      250-CHUNKING
      250 SMTPUTF8
      DEBUG SMTP: Found extension "SIZE", arg "35882577"
      DEBUG SMTP: Found extension "8BITMIME", arg ""
      DEBUG SMTP: Found extension "AUTH", arg "LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH"
      DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
      DEBUG SMTP: Found extension "PIPELINING", arg ""
      DEBUG SMTP: Found extension "CHUNKING", arg ""
      DEBUG SMTP: Found extension "SMTPUTF8", arg ""
      DEBUG SMTP: protocolConnect login, host=smtp.gmail.com, user=noreply@entornosdeformacion.com, password=<non-null>
      DEBUG SMTP: Attempt to authenticate using mechanisms: LOGIN PLAIN DIGEST-MD5 NTLM XOAUTH2
      DEBUG SMTP: Using mechanism LOGIN
      DEBUG SMTP: AUTH LOGIN command trace suppressed
      DEBUG SMTP: AUTH LOGIN succeeded
      DEBUG SMTP: use8bit false
      MAIL FROM:<postmaster@localhost>
      250 2.1.0 OK l15sm10334604wrl.47 - gsmtp
      RCPT TO:<mpellicer@entornosdeformacion.com>
      250 2.1.5 OK l15sm10334604wrl.47 - gsmtp
      DEBUG SMTP: Verified Addresses
      DEBUG SMTP: mpellicer@entornosdeformacion.com
      DATA
      354 Go ahead l15sm10334604wrl.47 - gsmtp
      Date: Tue, 19 Sep 2017 11:56:48 +0200 (CEST)
      From: "noreply@entornosdeformacion.com" <postmaster@localhost>
      Reply-To: noreply@entornosdeformacion.com
      Message-ID: <466319536.0.1505815009094@mpellicer-msi>
      Subject: ghhhhgg
      MIME-Version: 1.0
      Content-Transfer-Encoding: 7bit
      Content-Type: text/html; charset=utf-8

      <p>----------------------<br>This forwarded message was sent via Sakai Messages from the "TEST" site.
      To reply to this message click this link to access Messages for this site: <a href="http://localhost:8080/portal/site/92ca8e9d-9ceb-4ed2-9183-efbd823adb12/tool/2b2e2595-7b02-431a-9cf7-8305051d1260/privateMsg/pvtMsgDirectAccess?current_msg_detail=6">TEST</a><br>----------------------</p><p>To: Bond, James (mm)<p/><p>From: Sakai Administrator (admin) - mpellicer@entornosdeformacion.com</p><p>ffsfssfsfs</p>
      .
      250 2.0.0 OK 1505815009 l15sm10334604wrl.47 - gsmtp
      DEBUG SMTP: message successfully delivered to mail server
      QUIT
      221 2.0.0 closing connection l15sm10334604wrl.47 - gsmtp
      19-sep-2017 11:56:52.095 INFO [http-apr-8080-exec-3] org.sakaiproject.email.impl.BasicEmailService.transportMessage transportMessage: headers[ Content-Type: text/html; charset=utf-8 From: noreply@entornosdeformacion.com Subject: ghhhhgg] to[ mpellicer@entornosdeformacion.com]

       

      Show
      You need to build a local instance of Sakai (Or use one where you can change the properties. Enable an SMTP server modifying these properties (This are for GMAIL). smtp@org.sakaiproject.email.api.EmailService=smtp.gmail.com smtpPort@org.sakaiproject.email.api.EmailService=465 smtpUser@org.sakaiproject.email.api.EmailService=xxx@gmail.com smtpPassword@org.sakaiproject.email.api.EmailService=xxx smtpUseSSL@org.sakaiproject.email.api.EmailService=true smtpDebug@org.sakaiproject.email.api.EmailService=true smtpFrom@org.sakaiproject.email.api.EmailService=xxx@gmail.com portal.error.email=xxx@gmail.com setup.request=xxx@gmail.com Send a private message to any user with a valid email address (You can use a mailinator.com virtual inbox). Check the inbox, you should receive an email Check the debug logs and confirm the email has been sent successfully.  DEBUG: JavaMail version 1.6.0 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 DEBUG: getProvider() returning javax.mail.Provider [TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Oracle] DEBUG SMTP: useEhlo true, useAuth false DEBUG SMTP: trying to connect to host "smtp.gmail.com", port 465, isSSL true 220 smtp.gmail.com ESMTP l15sm10334604wrl.47 - gsmtp DEBUG SMTP: connected to host "smtp.gmail.com", port: 465 EHLO mpellicer-msi 250-smtp.gmail.com at your service, [188.85.41.117] 250-SIZE 35882577 250-8BITMIME 250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING 250 SMTPUTF8 DEBUG SMTP: Found extension "SIZE", arg "35882577" DEBUG SMTP: Found extension "8BITMIME", arg "" DEBUG SMTP: Found extension "AUTH", arg "LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH" DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg "" DEBUG SMTP: Found extension "PIPELINING", arg "" DEBUG SMTP: Found extension "CHUNKING", arg "" DEBUG SMTP: Found extension "SMTPUTF8", arg "" DEBUG SMTP: protocolConnect login, host=smtp.gmail.com, user=noreply@entornosdeformacion.com, password=<non-null> DEBUG SMTP: Attempt to authenticate using mechanisms: LOGIN PLAIN DIGEST-MD5 NTLM XOAUTH2 DEBUG SMTP: Using mechanism LOGIN DEBUG SMTP: AUTH LOGIN command trace suppressed DEBUG SMTP: AUTH LOGIN succeeded DEBUG SMTP: use8bit false MAIL FROM:<postmaster@localhost> 250 2.1.0 OK l15sm10334604wrl.47 - gsmtp RCPT TO:<mpellicer@entornosdeformacion.com> 250 2.1.5 OK l15sm10334604wrl.47 - gsmtp DEBUG SMTP: Verified Addresses DEBUG SMTP: mpellicer@entornosdeformacion.com DATA 354 Go ahead l15sm10334604wrl.47 - gsmtp Date: Tue, 19 Sep 2017 11:56:48 +0200 (CEST) From: "noreply@entornosdeformacion.com" <postmaster@localhost> Reply-To: noreply@entornosdeformacion.com Message-ID: <466319536.0.1505815009094@mpellicer-msi> Subject: ghhhhgg MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=utf-8 <p>----------------------<br>This forwarded message was sent via Sakai Messages from the "TEST" site. To reply to this message click this link to access Messages for this site: <a href="http://localhost:8080/portal/site/92ca8e9d-9ceb-4ed2-9183-efbd823adb12/tool/2b2e2595-7b02-431a-9cf7-8305051d1260/privateMsg/pvtMsgDirectAccess?current_msg_detail=6">TEST</a><br>----------------------</p><p>To: Bond, James (mm)<p/><p>From: Sakai Administrator (admin) - mpellicer@entornosdeformacion.com</p><p>ffsfssfsfs</p> . 250 2.0.0 OK 1505815009 l15sm10334604wrl.47 - gsmtp DEBUG SMTP: message successfully delivered to mail server QUIT 221 2.0.0 closing connection l15sm10334604wrl.47 - gsmtp 19-sep-2017 11:56:52.095 INFO [http-apr-8080-exec-3] org.sakaiproject.email.impl.BasicEmailService.transportMessage transportMessage: headers[ Content-Type: text/html; charset=utf-8 From: noreply@entornosdeformacion.com Subject: ghhhhgg] to[ mpellicer@entornosdeformacion.com]  

      Description

      Java mail has been moved to GitHub and released the 1.6.0 version.

      https://javaee.github.io/javamail/

      The 1.6.0 release contains API improvements, bug fixes, and enhancements, including the following significant changes:

      • Use of Java generics in most APIs
      • Support for internationalized email addresses (RFC 6530/6531/6532)
      • Support for SMTP CHUNKING (RFC 3030)
      • Support for connecting through web proxy servers

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                farreri Miguel Pellicer
                Reporter:
                farreri Miguel Pellicer
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Git Source Code