File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed
server/src/main/java/password/pwm/svc/email Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change 23
23
import jakarta .mail .Message ;
24
24
import jakarta .mail .MessagingException ;
25
25
import jakarta .mail .Transport ;
26
-
27
26
import password .pwm .PwmApplication ;
28
27
import password .pwm .PwmApplicationMode ;
29
28
import password .pwm .bean .EmailItemBean ;
@@ -358,7 +357,11 @@ private void submitEmailImpl(
358
357
return ;
359
358
}
360
359
361
- checkIfServiceIsOpen ();
360
+ if ( status != STATUS .OPEN )
361
+ {
362
+ LOGGER .trace ( () -> "email service is closed, discarding email job: " + emailItem .toDebugString () );
363
+ return ;
364
+ }
362
365
363
366
submitLock .lock ();
364
367
try
@@ -413,15 +416,6 @@ private void submitEmailImpl(
413
416
statsLogger .conditionallyExecuteTask ();
414
417
}
415
418
416
- private void checkIfServiceIsOpen ()
417
- throws PwmUnrecoverableException
418
- {
419
- if ( !STATUS .OPEN .equals ( status ) )
420
- {
421
- throw new PwmUnrecoverableException ( PwmError .ERROR_SERVICE_NOT_AVAILABLE , "email service is closed and will not accent new jobs" );
422
- }
423
- }
424
-
425
419
public static void sendEmailSynchronous (
426
420
final EmailServer emailServer ,
427
421
final Configuration configuration ,
You can’t perform that action at this time.
0 commit comments