Question

I am looking to create some filters of different complexity for Apache James. My question is: How useful is James jSieve? What are benefits of using it? How current/actively-developed it is?

I already looked at the standard matcher & mailets. I tried and liked the custom matchers, e.g.:

import org.apache.mailet.GenericMatcher; 
import org.apache.mailet.Mail; 
import javax.mail.MessagingException; 
import java.util.Collection; 

public class oooMatcher extends GenericMatcher{


 public void init() throws javax.mail.MessagingException { }
 private String outOfOffice     = "out of office";
 private String autoReply   = "autoreply";

 @SuppressWarnings("rawtypes")
 public Collection match(Mail mail) {   
    try {           
        String subj = mail.getMessage().getSubject().toLowerCase();
        if (subj.contains(outOfOffice)||subj.contains(autoReply)){
            return mail.getRecipients();         
        } else {       
            return null;     
        }
    } catch (MessagingException e) {            
        e.printStackTrace();
        return null;
    }
  }
}

I am curious to know What would be jSieve analogy of the above code.

Was it helpful?

Solution

At this point I think jSieve is just an interpreter (processor) of Sieve scripts for Java applications, James in particular. The advantage of Sieve scripts is that they are not platform or tool dependent and can be used by variety of mail servers.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top