1 17 18 package org.apache.james.transport.matchers; 19 20 import org.apache.mailet.GenericMatcher; 21 import org.apache.mailet.Mail; 22 23 import javax.mail.internet.MimeMessage ; 24 import java.util.Collection ; 25 26 34 35 public class FetchedFrom extends GenericMatcher { 36 public Collection match(Mail mail) throws javax.mail.MessagingException { 37 MimeMessage message = mail.getMessage(); 38 String fetch = message.getHeader("X-fetched-from", null); 39 if (fetch != null && fetch.equals(getCondition())) { 40 mail.getMessage().removeHeader("X-fetched-from"); 41 return mail.getRecipients(); 42 } 43 return null; 44 } 45 } 46 | Popular Tags |