This appears to be working
sub handle_potential_faraway
{
my $mail = shift(@_);
$spamtest->init(1);
my $msg = Mail::SpamAssassin::PerMsgStatus->new($spamtest, $mail);
if ($msg->check_for_faraway_charset())
{
ignore_mail($mail);
} elsif ($msg->check_for_faraway_charset_in_headers())
{
ignore_mail($mail);
} elsif ($msg->html_charset_faraway())
{
ignore_mail($mail);
} elsif ($msg->check_for_mime('mime_faraway_charset'))
{
ignore_mail($mail);
}
}
On Feb 10, 2007, at 6:50 PM, Theo Van Dinter wrote:
On Sat, Feb 10, 2007 at 06:30:50PM -0600, Robert Nicholson wrote:
I'd like to programatically call the methods SA uses to check for
8bit charsets and the like but I personally do not care to make use
of the rules engine at all. Do I need an instance of PerMsgStatus
fully setup before I can call eval: methods programatically?
Generally speaking, yes.
I'm looking to call things like check_for_faraway_charset,
check_for_faraway_charset_in_headers
If you look at the code, those functions clearly want a PMS object.
--
Randomly Selected Tagline:
Check book: a book with a unhappy ending.