You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by rc...@apache.org on 2021/12/22 04:11:09 UTC

[james-project] 03/10: JAMES-3680 SMTPServer: Refactor isAuthRequired

This is an automated email from the ASF dual-hosted git repository.

rcordier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 9f896a77b02b90e36dadf934fa0926a5ce71ae14
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon Dec 6 16:11:09 2021 +0700

    JAMES-3680 SMTPServer: Refactor isAuthRequired
---
 .../main/java/org/apache/james/smtpserver/netty/SMTPServer.java    | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/server/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/netty/SMTPServer.java b/server/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/netty/SMTPServer.java
index ff966f5..b2f5b38 100644
--- a/server/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/netty/SMTPServer.java
+++ b/server/protocols/protocols-smtp/src/main/java/org/apache/james/smtpserver/netty/SMTPServer.java
@@ -257,11 +257,10 @@ public class SMTPServer extends AbstractProtocolAsyncServer implements SMTPServe
             if (SMTPServer.this.authRequired == ANNOUNCE) {
                 return true;
             }
-            boolean authRequired = SMTPServer.this.authRequired != DISABLED;
-            if (authorizedNetworks != null) {
-                authRequired = authRequired && !SMTPServer.this.authorizedNetworks.matchInetNetwork(remoteIP);
+            if (SMTPServer.this.authRequired == DISABLED) {
+                return false;
             }
-            return authRequired;
+            return !SMTPServer.this.authorizedNetworks.matchInetNetwork(remoteIP);
         }
 
         /**

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