You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2022/12/28 02:08:50 UTC

[GitHub] [james-project] chibenwa commented on a diff in pull request #1363: SMTP AuthCmdHandler support doDelegation method

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-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org