SYNOPSIS

 use Mail::Filter;
    
 my $filter = Mail::Filter->new( \&filter1, \&filter2 );
    
 my $mail   = Mail::Internet->new( [<>] );
 my $mail   = $filter->filter($mail);

 my $folder = Mail::Folder->new( .... );
 my $filter->filter($folder);

DESCRIPTION

Mail::Filter provides an interface to filtering Email through multiple subroutines.

Mail::Filter filters mail by calling each filter subroutine in turn. Each filter subroutine is called with two arguments, the first is the filter object and the second is the mail or folder object being filtered.

The result from each filter sub is passed to the next filter as the mail object. If a filter subroutine returns undef, then Mail::Filter will abort and return immediately.

The function returns the result from the last subroutine to operate on the mail object.