Is it possible to set the communication for sending mail to TLS 1.2 only?

 
[Handling methods]

If you are using 2018 Summer (tiffany) or later, you can set SSL protocol settings below.

http://www.intra-mart.jp/document/library/iap/public/configuration/im_configuration_reference/texts/im_javamail/javamail-config/index.html#javamail-config_protocol
Add protocol to WEB-INF/conf/javamail-config/javamail-config.xml as follows.

<smtps enable="true" starttls="false">
  <protocols>
    <protocol>TLSv1.2</protocol>
  </protocols>
</smtps>


If you are using 2018 Spring (Skylark) or earlier, it is possible by setting the following listener.

It is possible by setting the following listener.

https://www.intra-mart.jp/document/library/iap/public/configuration/im_configuration_reference/texts/im_javamail/javamail-config/index.html#%E3%83%AA%E3%82%B9%E3%83%8A%E8%A8%AD%E5%AE%9A
(After transitting the page above, please select "英語" from the select box on the bottom right.)

Examples

1. Add the listener-class to WEB-INF/conf/javamail-config/javamail-config.xml as follows.

  <listener> 
    <listener-class>jp.co.intra_mart.foundation.mail.javamail.listener.impl.HalfKanaTransrateListener</listener-class> 
    <listener-class>jp.co.intra_mart.example.ExampleJavaMailListener</listener-class> <!-- added --> 
  </listener> 


2. Implement the listener.


package jp.co.intra_mart.example;

import java.util.Properties;

import javax.mail.Session;

import jp.co.intra_mart.foundation.mail.MailSenderException;
import jp.co.intra_mart.foundation.mail.javamail.listener.MailSendEvent;
import jp.co.intra_mart.foundation.mail.javamail.listener.MailSendListener;

public class ExampleJavaMailListener implements MailSendListener {
    @Override
    public int onSendMail(final MailSendEvent event) throws MailSenderException {
        final Session session = event.getSession();
        final Properties properties = session.getProperties();


        properties.put ("mail.smtp.ssl.protocols" , "TLSv 1.2");// Use TLS 1.2 only. If TLS 1.2 cannot be used for communication, an error occurs. You can specify multiple protocols separated by spaces, such as "TLSv 1.1 TLSv 1.2 ". (Protocol is used in order from the leftmost. If the first is not available, the second protocol is used.)

        return MailSendListener.CONTINUE;
    }
}

-- Target ------------------------------------------------------------------------
iAP/Accel Platform
--------------------------------------------------------------------------------


FAQID:681
Was this article helpful?
0 out of 0 found this helpful
Powered by Zendesk