Search code examples
jakarta-mailpostfix-mta

JavaMail to MTA security layer


I want to use JavaMail (web app on Tomcat or JBoss) to compose and send mail through an externally hosted MTA and I want to learn more about the data security between the MTA and the Java API itself. I'm guessing there is some sort of transport layer security? I'm having a hard time finding anything, I don't seem to know what keywords to look for.


Solution

  • There are two approaches:

    1. Use SSL/TLS to make the initial connection.
    2. Use a plain text connection and then use the STARTTLS command to switch to SSL/TLS.

    JavaMail supports both. See the properties for the various protocol providers and the SSLNOTES.txt file.