Skip to content

Commit

Permalink
#210: Fixed that session / connection timeout settings are also appli…
Browse files Browse the repository at this point in the history
…ed when sending synchronously (not in batch mode)
  • Loading branch information
bbottema committed May 24, 2019
1 parent cbe355e commit b54ae8f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ public MailSenderImpl(@Nonnull final Session session,
private void initSession(@Nonnull final Session session, @Nonnull OperationalConfig operationalConfig, @Nullable final TransportStrategy transportStrategy) {
session.setDebug(operationalConfig.isDebugLogging());
session.getProperties().putAll(operationalConfig.getProperties());

configureSessionWithTimeout(session, operationalConfig.getSessionTimeout());

if (transportStrategy != null) {
if (operationalConfig.isTrustAllSSLHost()) {
trustAllHosts(session, true, transportStrategy);
Expand Down Expand Up @@ -187,8 +190,6 @@ the proxy bridge server (or connection pool in async mode) while a non-async ema
if (executor == null) {
executor = new NonJvmBlockingThreadPoolExecutor(operationalConfig, "Simple Java Mail async mail sender");
}
configureSessionWithTimeout(session, operationalConfig.getSessionTimeout());

return AsyncOperationHelper.executeAsync(executor, "sendMail process", sendMailClosure);
}
}
Expand Down

0 comments on commit b54ae8f

Please sign in to comment.