Skip to content

Commit 41d179e

Browse files
committed
fix issue #611 - 5019 error during change password when no email server configuerd
1 parent f9dc8af commit 41d179e

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

server/src/main/java/password/pwm/svc/email/EmailService.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import jakarta.mail.Message;
2424
import jakarta.mail.MessagingException;
2525
import jakarta.mail.Transport;
26-
2726
import password.pwm.PwmApplication;
2827
import password.pwm.PwmApplicationMode;
2928
import password.pwm.bean.EmailItemBean;
@@ -358,7 +357,11 @@ private void submitEmailImpl(
358357
return;
359358
}
360359

361-
checkIfServiceIsOpen();
360+
if ( status != STATUS.OPEN )
361+
{
362+
LOGGER.trace( () -> "email service is closed, discarding email job: " + emailItem.toDebugString() );
363+
return;
364+
}
362365

363366
submitLock.lock();
364367
try
@@ -413,15 +416,6 @@ private void submitEmailImpl(
413416
statsLogger.conditionallyExecuteTask();
414417
}
415418

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-
425419
public static void sendEmailSynchronous(
426420
final EmailServer emailServer,
427421
final Configuration configuration,

0 commit comments

Comments
 (0)