1 17 18 package org.apache.james.transport.matchers; 19 20 import org.apache.mailet.GenericRecipientMatcher; 21 import org.apache.mailet.MailAddress; 22 23 import java.util.Collection ; 24 import java.util.StringTokenizer ; 25 26 29 public class RecipientIs extends GenericRecipientMatcher { 30 31 private Collection recipients; 32 33 public void init() throws javax.mail.MessagingException { 34 StringTokenizer st = new StringTokenizer (getCondition(), ", \t", false); 35 recipients = new java.util.HashSet (); 36 while (st.hasMoreTokens()) { 37 recipients.add(new MailAddress(st.nextToken())); 38 } 39 } 40 41 public boolean matchRecipient(MailAddress recipient) { 42 return recipients.contains(recipient); 43 } 44 } 45 | Popular Tags |