문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top