@@ -243,7 +243,7 @@ private void sendMailClosure(@Nonnull final Session session, @Nonnull final Emai
243243
244244 configureBounceToAddress (session , email );
245245
246- logSession (session );
246+ logSession (session , "mail" );
247247 message .saveChanges (); // some headers and id's will be set for this specific message
248248 //noinspection deprecation
249249 email .internalSetId (message .getMessageID ());
@@ -324,11 +324,11 @@ private synchronized void checkShutDownRunningProcesses() {
324324 /**
325325 * Simply logs host details, credentials used and whether authentication will take place and finally the transport protocol used.
326326 */
327- private static void logSession (final Session session ) {
327+ private static void logSession (final Session session , final String activity ) {
328328 final TransportStrategy transportStrategy = TransportStrategy .findStrategyForSession (session );
329329 final Properties properties = session .getProperties ();
330330 final String sessionDetails = (transportStrategy != null ) ? transportStrategy .toString (properties ) : properties .toString ();
331- LOGGER .debug ("starting mail with " + sessionDetails );
331+ LOGGER .debug ("starting {} with {}" , activity , sessionDetails );
332332 }
333333
334334 /**
@@ -369,7 +369,11 @@ private void trustHosts(@Nonnull final List<String> hosts) {
369369 */
370370 public synchronized void testConnection () {
371371 boolean proxyBridgeStartedForTestingConnection = false ;
372-
372+
373+ configureSessionWithTimeout (session , operationalConfig .getSessionTimeout ());
374+
375+ logSession (session , "connection test" );
376+
373377 try (Transport transport = session .getTransport ()) {
374378 //noinspection ConstantConditions
375379 if (needsAuthenticatedProxy () && !proxyServer .isRunning ()) {
0 commit comments