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


##########
server/mailet/mailets/src/main/java/org/apache/james/transport/matchers/IsMarkedAsSpam.java:
##########
@@ -51,9 +54,18 @@ public class IsMarkedAsSpam extends GenericMatcher {
 
     private static final String YES = "yes";
 
+    private String spamStatusHeader = 
SpamAssassinResult.STATUS_MAIL.asString();
+
     @Override
     public String getMatcherInfo() {
-        return "Has org.apache.james.spamassassin.status per recipient header 
with a Yes value";
+        return "Has " + spamStatusHeader + " per recipient header with a Yes 
value";
+    }
+
+    @Override
+    public void init() throws MessagingException {
+        spamStatusHeader = Optional.ofNullable(getCondition())
+            .filter(s -> !s.isEmpty())
+            .orElse(SpamAssassinResult.STATUS_MAIL.asString());
     }

Review Comment:
   > Your mean is do not use SpamAssassinResult.STATUS_MAIL by default?
   
   No that is not what I mean.
   
   I mean: the behavior of this mailet is changed. So its doc should change 
too. It should say `we allow configuring the spamStatusHeader value. Default 
value is X, allowed values are X and Y.`.
   
   > IMO, we should keep it, it won't make degrade the old configure when not 
provided status package
   
   +1 



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