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 javax.mail.MessagingException ; 24 25 40 public class CommandListservMatcher extends GenericRecipientMatcher { 41 42 private MailAddress listservAddress; 43 44 public void init() throws MessagingException { 45 listservAddress = new MailAddress(getCondition()); 46 } 47 48 54 public boolean matchRecipient(MailAddress recipient) { 55 if (recipient.getHost().equals(listservAddress.getHost())) { 56 if (recipient.getUser().startsWith(listservAddress.getUser() + "-")) { 57 return true; 58 } 59 } 60 return false; 61 } 62 } 63 | Popular Tags |