1 17 18 package org.apache.james.transport.matchers; 19 20 21 import org.apache.mailet.GenericMatcher; 22 import org.apache.mailet.Mail; 23 import org.apache.mailet.MatcherConfig; 24 import java.util.Collection ; 25 import javax.mail.MessagingException ; 26 27 38 public class HasMailAttribute extends GenericMatcher 39 { 40 41 private String attributeName; 42 43 48 public String getMatcherInfo() { 49 return "Has Mail Attribute Matcher"; 50 } 51 52 public void init (MatcherConfig conf) throws MessagingException 53 { 54 attributeName = conf.getCondition(); 55 } 56 57 63 public Collection match (Mail mail) throws MessagingException 64 { 65 if (mail.getAttribute (attributeName) != null) { 66 return mail.getRecipients(); 67 } 68 return null; 69 } 70 71 } 72 | Popular Tags |