Configuring timeouts for SMTP connections
Configure timeouts for SMTP connections by indicating specific parameters. By not configuring timeouts, the thread can wait indefinitely for an SMTP server to respond, leading to a hang in the WebSphere Commerce JVM.
Procedure
- Create a file named JCAEmailConnectionRequestInfo.properties in the WAS_installdir/lib directory.
-
Include the following parameters in the
JCAEmailConnectionRequestInfo.properties file (make sure that you select values
that are appropriate for your configuration):
- mail.smtp.connectiontimeout int Socket connection timeout value in
milliseconds. Default is infinite timeout. Recommended value is 180000 (180 seconds) or
bigger.Note: The connection timeout must be longer than the unused timeout on the WebSphere Application Server connection pool.
- mail.smtp.timeout int Socket I/O timeout value in milliseconds. Default is infinite timeout. Recommended value is 180000 (180 seconds) or bigger.
For a list of possible JavaMail configuration parameters, see the package description of com.sun.mail.smtp: Package com.sun.mail.smtp
- mail.smtp.connectiontimeout int Socket connection timeout value in
milliseconds. Default is infinite timeout. Recommended value is 180000 (180 seconds) or
bigger.
- Restart the WebSphere Commerce JVM for the changes to take effect.