Skip to content

Commit e5fc50b

Browse files
committed
#229 always apply connection properties
1 parent 9332ba6 commit e5fc50b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/simplejavamail/mailer/internal/mailsender/MailSender.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ private static AnonymousSocks5Server configureSessionWithProxy(@Nonnull final Pr
190190
* @see Executors#newFixedThreadPool(int)
191191
*/
192192
public final synchronized void send(final Email email, final boolean async) {
193+
configureSessionWithTimeout(session, operationalConfig.getSessionTimeout());
194+
193195
/*
194196
we need to track even non-async emails to prevent async emails from shutting down
195197
the proxy bridge server (or connection pool in async mode) while a non-async email is still being processed
@@ -204,7 +206,6 @@ the proxy bridge server (or connection pool in async mode) while a non-async ema
204206
if (executor == null || executor.isShutdown()) {
205207
executor = Executors.newFixedThreadPool(operationalConfig.getThreadPoolSize());
206208
}
207-
configureSessionWithTimeout(session, operationalConfig.getSessionTimeout());
208209
executor.execute(new NamedRunnable("sendMail process") {
209210
@Override
210211
public void run() {

0 commit comments

Comments
 (0)