quantranhong1999 commented on code in PR #1093:
URL: https://github.com/apache/james-project/pull/1093#discussion_r931788754
##########
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:
E.g:
```java
.attribute(Attribute.convertToAttribute("custom.package", "Yes,
actions=reject score=14.225 requiredScore=14.0 desiredRewriteSubject="))
```
--
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]