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.