Mailfetch::Rule::Recipient - match recipients
my $blacklisted_recipient = Mailfetch::Rule::Recipient->new(
blacklist => 'header-to-blacklist.txt',
rule_name => 'blacklisted recipient',
action => 'Delete',
);
...
if ($blacklisted_recipient->applies($mail)) {
$blacklisted_recipient->action->execute($mail);
# adios muchacho
};
This module matches against the to, cc, bcc and x-envelope-to headers.