|
@@ -23,7 +23,6 @@ package password.pwm.svc.email;
|
|
|
import jakarta.mail.Message;
|
|
|
import jakarta.mail.MessagingException;
|
|
|
import jakarta.mail.Transport;
|
|
|
-
|
|
|
import password.pwm.PwmApplication;
|
|
|
import password.pwm.PwmApplicationMode;
|
|
|
import password.pwm.bean.EmailItemBean;
|
|
@@ -358,7 +357,11 @@ public class EmailService implements PwmService
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- checkIfServiceIsOpen();
|
|
|
+ if ( status != STATUS.OPEN )
|
|
|
+ {
|
|
|
+ LOGGER.trace( () -> "email service is closed, discarding email job: " + emailItem.toDebugString() );
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
submitLock.lock();
|
|
|
try
|
|
@@ -413,15 +416,6 @@ public class EmailService implements PwmService
|
|
|
statsLogger.conditionallyExecuteTask();
|
|
|
}
|
|
|
|
|
|
- private void checkIfServiceIsOpen()
|
|
|
- throws PwmUnrecoverableException
|
|
|
- {
|
|
|
- if ( !STATUS.OPEN.equals( status ) )
|
|
|
- {
|
|
|
- throw new PwmUnrecoverableException( PwmError.ERROR_SERVICE_NOT_AVAILABLE, "email service is closed and will not accent new jobs" );
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
public static void sendEmailSynchronous(
|
|
|
final EmailServer emailServer,
|
|
|
final Configuration configuration,
|