FileDocCategorySizeDatePackage
FetchedFrom.javaAPI DocApache James 2.3.12244Fri Jan 12 12:56:32 GMT 2007org.apache.james.transport.matchers

FetchedFrom

public class FetchedFrom extends org.apache.mailet.GenericMatcher
Matches mail with a header set by Fetchpop X-fetched-from
fetchpop sets X-fetched-by to the "name" of the fetchpop fetch task.
This is used to match all mail fetched from a specific pop account. Once the condition is met the header is stripped from the message to prevent looping if the mail is re-inserted into the spool. $Id: FetchedFrom.java 494012 2007-01-08 10:23:58Z norman $

Fields Summary
Constructors Summary
Methods Summary
public java.util.Collectionmatch(org.apache.mailet.Mail mail)

        MimeMessage message = mail.getMessage();
        String fetch = message.getHeader("X-fetched-from", null);
        if (fetch != null && fetch.equals(getCondition())) {
            mail.getMessage().removeHeader("X-fetched-from");
            return mail.getRecipients();
        }
        return null;