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 31 public class CommandForListserv extends GenericRecipientMatcher { 32 33 private MailAddress listservAddress; 34 35 public void init() throws MessagingException { 36 listservAddress = new MailAddress(getCondition()); 37 } 38 39 public boolean matchRecipient(MailAddress recipient) { 40 if (recipient.getHost().equals(listservAddress.getHost())) { 41 if (recipient.getUser().equals(listservAddress.getUser() + "-on") 42 || recipient.getUser().equals(listservAddress.getUser() + "-off")) { 43 return true; 44 } 45 } 46 return false; 47 } 48 } 49 | Popular Tags |