Uploaded image for project: 'Magnolia Mail Module'
  1. Magnolia Mail Module
  2. MGNLMAIL-77

Add possibility for SMTP Session debugging

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Neutral Neutral
    • 5.5.5
    • 5.5.4
    • None
    • Yes
    • Maintenance 11
    • 0.5

      Hi

      I was tracking down an SMTP issue and missed the possibility to put the java mail Session into debug mode. I think it would be straight forward to implement a flag in the mail module config and using it when the session object is create in info.magnolia.module.mail.MailTemplate#initSession

      Just call session.setDebug() before returning.

      Example debug output:

      DEBUG: setDebug: JavaMail version 1.4.1ea-SNAPSHOT
      DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
      DEBUG SMTP: useEhlo true, useAuth false
      DEBUG SMTP: trying to connect to host "SOMEHOST", port 25, isSSL false
      220 smtp-relay.gmail.com ESMTP c202sm3300653wmd.2 - gsmtp
      DEBUG SMTP: connected to host "SOMEHOST", port: 25
      
      EHLO c13434.local
      250-smtp-relay.gmail.com at your service, [95.143.54.50]
      250-SIZE 157286400
      250-8BITMIME
      250-STARTTLS
      250-ENHANCEDSTATUSCODES
      250-PIPELINING
      250-CHUNKING
      250 SMTPUTF8
      DEBUG SMTP: Found extension "SIZE", arg "157286400"
      DEBUG SMTP: Found extension "8BITMIME", arg ""
      DEBUG SMTP: Found extension "STARTTLS", arg ""
      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: use8bit false
      MAIL FROM:<test@example.com>
      550-5.7.0 Mail relay denied [95.143.54.50]. Invalid credentials for relay for
      550-5.7.0 one of the domains in: example.com (as obtained from helo and
      550-5.7.0 mail-from).
      550-5.7.0 Email is being sent from a domain or IP address which isn't registered
      550-5.7.0 in Google Apps account. Please login to your Google Apps account and
      550-5.7.0 verify that your sending device IP address has been registered within
      550-5.7.0 Google Apps SMTP Relay Settings. For more information, please visit
      
      

        Acceptance criteria

              fgrilli Federico Grilli
              sbaur Stefan Baur
              Michael Rauch
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD