我希望为Apache创建一些复杂程度不同的过滤器。我的问题是: James jSieve有多有用?使用它有什么好处?它有多流行/有多活跃?
我已经看过标准的matcher & mailets了。我试过并喜欢定制的匹配,例如:
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;
}
}
}我很想知道上述代码的jSieve类推是什么。
发布于 2013-10-01 18:33:56
在这一点上,我认为jSieve只是用于Java应用程序的筛子脚本的解释器(处理器),特别是James。筛网脚本的优点是它们不依赖于平台或工具,可以被各种邮件服务器使用。
https://stackoverflow.com/questions/19121068
复制相似问题