Repository: james-project Updated Branches: refs/heads/master 7eb1c5245 -> 369b35fc9
JAMES-2064 Consider IMAP self delegation as normal login Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/369b35fc Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/369b35fc Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/369b35fc Branch: refs/heads/master Commit: 369b35fc9664bf0ec8927bfa9213be83f5e58ec6 Parents: 7eb1c52 Author: benwa <btell...@linagora.com> Authored: Thu Jun 22 16:51:49 2017 +0700 Committer: benwa <btell...@linagora.com> Committed: Thu Jun 22 16:51:49 2017 +0700 ---------------------------------------------------------------------- .../james/imap/scripts/AuthenticatePlain.test | 19 +++++++++++++++++++ .../imap/processor/AbstractAuthProcessor.java | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/369b35fc/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/AuthenticatePlain.test ---------------------------------------------------------------------- diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/AuthenticatePlain.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/AuthenticatePlain.test index 50fa93d..6bdf831 100644 --- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/AuthenticatePlain.test +++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/AuthenticatePlain.test @@ -56,6 +56,25 @@ S: \* OK \[HIGHESTMODSEQ .*\] Highest S: \* OK \[UIDNEXT .*\] Predicted next UID } S: 0004 OK \[READ-WRITE\] SELECT completed\. +REINIT + +# Correct user with correct password can authenticate with empty delegation part +C: A002 AUTHENTICATE PLAIN aW1hcHVzZXIAaW1hcHVzZXIAcGFzc3dvcmQ= +# \0imapuser\0imapuser\0password +S: A002 OK AUTHENTICATE completed. + +# Ensure we are imapuser +C: 0004 SELECT imapuser +SUB { +S: \* FLAGS .* +S: \* .* EXISTS +S: \* .* RECENT +S: \* OK \[UIDVALIDITY .*\] UIDs valid +S: \* OK \[PERMANENTFLAGS .*\] Limited +S: \* OK \[HIGHESTMODSEQ .*\] Highest +S: \* OK \[UIDNEXT .*\] Predicted next UID +} +S: 0004 OK \[READ-WRITE\] SELECT completed\. REINIT http://git-wip-us.apache.org/repos/asf/james-project/blob/369b35fc/protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractAuthProcessor.java ---------------------------------------------------------------------- diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractAuthProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractAuthProcessor.java index fe7cbaa..54b5d4f 100644 --- a/protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractAuthProcessor.java +++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractAuthProcessor.java @@ -185,7 +185,7 @@ public abstract class AbstractAuthProcessor<M extends ImapRequest> extends Abstr } public boolean isDelegation() { - return delegateUserName.isPresent(); + return delegateUserName.isPresent() && !delegateUserName.get().equals(authenticationId); } public Optional<String> getDelegateUserName() { --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org