quantranhong1999 commented on code in PR #1093:
URL: https://github.com/apache/james-project/pull/1093#discussion_r931778948


##########
server/mailet/mailets/pom.xml:
##########
@@ -171,6 +177,12 @@
             <artifactId>james-server-queue-memory</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>${james.groupId}</groupId>
+            <artifactId>james-server-rate-limiter-redis</artifactId>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>

Review Comment:
   Why do we need to add rate limiter here?



##########
server/mailet/mailets/src/test/java/org/apache/james/transport/matchers/IsMarkedAsSpamTest.java:
##########
@@ -151,4 +152,29 @@ void 
isMarkedAsSpamShouldMatchWhenHeaderAndYesValueInOtherCase() throws Exceptio
         Collection<MailAddress> matches = matcher.match(mail);
         assertThat(matches).contains(new MailAddress("[email protected]"));
     }
+
+    @Test
+    void isMarkedAsSpamShouldAcceptDynamicSpamStatusPackageHeader() throws 
Exception {
+        FakeMatcherConfig matcherConfig = FakeMatcherConfig.builder()
+            .matcherName("IsMarkedAsSpam")
+            .condition("custom.package")
+            .build();
+
+        matcher.init(matcherConfig);
+
+        FakeMail mail = FakeMail.builder()
+            .name("name")
+            .sender("[email protected]")
+            .recipient("[email protected]")
+            .addHeaderForRecipient(PerRecipientHeaders.Header.builder()
+                    .name("custom.package")
+                    .value("Yes, hits=6.8 required=5.0")
+                    .build(),
+                new MailAddress("[email protected]"))
+            .attribute(Attribute.convertToAttribute("custom.package", "Yes, 
hits=6.8 required=5.0"))

Review Comment:
   maybe modify the attribute value diff away from SpamAssassin value one to be 
more representative.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to