This is an automated email from the ASF dual-hosted git repository. rcordier pushed a commit to branch 3.7.x in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 1a5b87767c032bd9156848e998429d3fb3de2979 Author: Benoit TELLIER <btell...@linagora.com> AuthorDate: Tue Jan 2 09:52:38 2024 +0100 [FIX] Close connection after DATA errors --- .../org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java b/server/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java index 44d15b2fbc..35a1b94bf4 100644 --- a/server/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java +++ b/server/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/DataLineJamesMessageHookHandler.java @@ -150,11 +150,15 @@ public class DataLineJamesMessageHookHandler implements DataLineFilter, Extensib } catch (IOException e) { LifecycleUtil.dispose(mmiss); SMTPResponse response = new SMTPResponse(SMTPRetCode.LOCAL_ERROR, DSNStatus.getStatus(DSNStatus.TRANSIENT, DSNStatus.UNDEFINED_STATUS) + " Error processing message: " + e.getMessage()); + response.setEndSession(true); + session.popLineHandler(); LOGGER.error("Unknown error occurred while processing DATA.", e); return response; } catch (CommandInjectionDetectedException e) { LifecycleUtil.dispose(mmiss); SMTPResponse response = new SMTPResponse(SMTPRetCode.SYNTAX_ERROR_COMMAND_UNRECOGNIZED, DSNStatus.getStatus(DSNStatus.PERMANENT, DSNStatus.UNDEFINED_STATUS) + " line delimiter must be CRLF"); + response.setEndSession(true); + session.popLineHandler(); LOGGER.info("Use of CRLF, which might indicate SMTP smuggling attempt"); return response; --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org For additional commands, e-mail: notifications-h...@james.apache.org