Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2548

SMTP TLS support request

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.11.0
    • 2.11.0
    • Appenders
    • None
    • Linux server-2 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

    Description

      For various reasons I am trying to use Gmail as my SMTP server for outgoing messages. I ran into two issues which I am reporting separately. The first issue was that the only I could use a gmail account for such a server is if I used port 587 with TLS. I tried port 465 with SSL but couldn't connect, but, the former combination does work. This means being able to add the properties:

      props.put("mail.smtp.auth", "true");
      props.put("mail.smtp.starttls.enable", "true");

      to the javamail session initiator. 

      I wound up writing a custom appender based on SMTP appender and manager that provided this feature. I am dropping in this code for reference only. It is intended for Gmail only and is not production worthy.

      Attachments

        1. GmailManager.java
          12 kB
          John Scott Brown
        2. GmailAppender.java
          7 kB
          John Scott Brown

        Activity

          People

            Unassigned Unassigned
            jsbrown51@gmail.com John Scott Brown
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: