I'm using Mail::SpamAssassin as part of the tool chain for managing
dnswl.org data - basically to verify spam samples.

I would like to add trusted_networks configurations programmatically, ie
without having to write them to a config file first.

What I currently have (reduced to the bare minimum case, I believe):

my $spamtest = Mail::SpamAssassin->new( {
 'local_tests_only' => 1
});
# $someMessage contains a full message
my $mail = $spamtest->parse($someMessage);
my $status = $spamtest->check($mail);
my $stmsg = $status->get_message();

Now this works, and I can eg retrieve
$stmsg->{metadata}->{relays_untrusted} and so on for further analysis.

At which step and how could I configure trusted_networks from within the
code?

Thanks for any pointers.

-- Matthias

Reply via email to