chibenwa commented on code in PR #1685:
URL: https://github.com/apache/james-project/pull/1685#discussion_r1296983855


##########
protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/SpamTrapHandler.java:
##########
@@ -42,13 +45,20 @@ public class SpamTrapHandler implements RcptHook {
     private static final Logger LOGGER = 
LoggerFactory.getLogger(SpamTrapHandler.class);
 
     /** Map which hold blockedIps and blockTime in memory */
-    private final Map<String,Long> blockedIps = new HashMap<>();
+    private final Map<String,Long> blockedIps;
+    private final Clock clock;
     
     private Collection<String> spamTrapRecips = new ArrayList<>();
     
     /** Default blocktime 12 hours */
     protected long blockTime = 4320000;
 
+    @Inject
+    public SpamTrapHandler(Clock clock) {

Review Comment:
   This would beak Spring injection.
   
   Please put two constructor: @Inject on a constructor with not arguments 
relying on system clock, and an other one to specify the clock in tests.



-- 
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

Reply via email to