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 <[email protected]>
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to