mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 14:07:55 +01:00
Added support for TLS & STARTTLS for SMTP connections. If port 465 is configured, TLS will be assumed. If port 587 is used, STARTTLS is assumed. (#478)
Closes #353: Added support for TLS & STARTTLS for SMTP connections
This commit is contained in:
parent
5b2833350c
commit
b6ec5e108b
@ -99,11 +99,16 @@ public class EmailUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Port
|
// Port
|
||||||
|
int port = ConfigUtil.getConfigIntegerValue(ConfigType.SMTP_PORT);
|
||||||
String envPort = System.getenv(Constants.SMTP_PORT_ENV);
|
String envPort = System.getenv(Constants.SMTP_PORT_ENV);
|
||||||
if (envPort == null) {
|
if (envPort != null) {
|
||||||
email.setSmtpPort(ConfigUtil.getConfigIntegerValue(ConfigType.SMTP_PORT));
|
port = Integer.valueOf(envPort);
|
||||||
} else {
|
}
|
||||||
email.setSmtpPort(Integer.valueOf(envPort));
|
email.setSmtpPort(port);
|
||||||
|
if (port == 465) {
|
||||||
|
email.setSSLOnConnect(true);
|
||||||
|
} else if (port == 587) {
|
||||||
|
email.setStartTLSRequired(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Username and password
|
// Username and password
|
||||||
|
Loading…
Reference in New Issue
Block a user