Add support to time out mail server connections

Description

Java Mail defines the properties:

  • mail.smtp.connectiontimeout - Socket connection timeout value in milliseconds. This timeout is implemented by java.net.Socket. Default is infinite timeout.

  • mail.smtp.timeout Socket read timeout value in milliseconds. This timeout is implemented by java.net.Socket. Default is infinite timeout.

To ensure a connection times out if is misconfigured, these properties should be set to reasonable values, e.g.

  • 20 seconds for mail.smtp.connectiontimeout

  • 60 seconds for mail.smtp.timeout

Environment

None

Status

Assignee

Tim Anderson

Reporter

Tim Anderson

Labels

None

Components

Fix versions

Priority

Minor