chibenwa commented on code in PR #1363: URL: https://github.com/apache/james-project/pull/1363#discussion_r1058014421
########## protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/AuthCmdHandler.java: ########## @@ -339,6 +342,31 @@ private Response doLoginAuthPassCheck(SMTPSession session, Username username, St return doAuthTest(session, username, pass, "LOGIN"); } + protected Response doDelegation(SMTPSession session, Username username) { + Response res = null; + + List<AuthHook> hooks = Optional.ofNullable(getHooks()) + .orElse(List.of()); + + for (AuthHook rawHook : hooks) { + rawHook.doDelegation(session, username); + res = executeHook(session, rawHook, hook -> rawHook.doDelegation(session, username)); + + if (res != null) { + if (SMTPRetCode.AUTH_FAILED.equals(res.getRetCode())) { + LOGGER.warn("DELEGATE failed from {}", username); + } else if (SMTPRetCode.AUTH_OK.equals(res.getRetCode())) { + LOGGER.debug("DELEGATE succeed from {}", username); Review Comment: It would be nice to know who we did delegate to... -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org For additional commands, e-mail: notifications-h...@james.apache.org