Navigation Menu

Skip to content

Commit

Permalink
0005334: Server not trusted when sending email
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Jun 10, 2022
1 parent 03ce3e9 commit 7eba59d
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -222,11 +222,11 @@ protected Properties getJavaMailProperties(TypedProperties typedProp) {
prop.setProperty(JAVAMAIL_USE_AUTH, String.valueOf(typedProp.is(ParameterConstants.SMTP_USE_AUTH, false)));
prop.setProperty(JAVAMAIL_TRUST_HOST, typedProp.is(ParameterConstants.SMTP_ALLOW_UNTRUSTED_CERT, false) ? "*" : "");
prop.setProperty(JAVAMAIL_TRUST_HOST_SSL, typedProp.is(ParameterConstants.SMTP_ALLOW_UNTRUSTED_CERT, false) ? "*" : "");
if (StringUtils.isNotBlank(parameterService.getString(ParameterConstants.SMTP_SOCKET_FACTORY_CLASS))) {
prop.setProperty(JAVAMAIL_SOCKET_FACTORY_CLASS, parameterService.getString(ParameterConstants.SMTP_SOCKET_FACTORY_CLASS));
if (StringUtils.isNotBlank(typedProp.get(ParameterConstants.SMTP_SOCKET_FACTORY_CLASS))) {
prop.setProperty(JAVAMAIL_SOCKET_FACTORY_CLASS, typedProp.get(ParameterConstants.SMTP_SOCKET_FACTORY_CLASS));
}
if (StringUtils.isNotBlank(parameterService.getString(ParameterConstants.SMTP_SSL_PROTOCOLS))) {
prop.setProperty(JAVAMAIL_SSL_PROTOCOLS, parameterService.getString(ParameterConstants.SMTP_SSL_PROTOCOLS));
if (StringUtils.isNotBlank(typedProp.get(ParameterConstants.SMTP_SSL_PROTOCOLS))) {
prop.setProperty(JAVAMAIL_SSL_PROTOCOLS, typedProp.get(ParameterConstants.SMTP_SOCKET_FACTORY_CLASS));
}
return prop;
}
Expand Down

0 comments on commit 7eba59d

Please sign in to comment.