Hi all.
I'm running amavis 2.5.2 and I've written a custom hook for the
checks() subroutine. My hook is analysing the headers of the message
and the sender/recipient domains and, based on a local policy, I might
need to quarantine a message. However I'm not sure what I'm supposed
to do to make this happen. I've had a look at the example in
amavisd-custom.conf, but its quarantining code seems to be taking a
copy of the message and letting the original continue on its merry
way.
Is there a simple way to tag the message as banned, and let the
regular behaviour for a banned attachment take over?
Can I do the same per-recipient if I wanted to?
I'm doing something like this:
sub checks() {
...
if ($need_to_ban_message) {
$msginfo->add_contents_category(CC_BANNED,0);
for my $r (@{$msginfo->per_recip_data}) {
$r->recip_done(1);
}
}
}
but I get errors in my like like:
(!!)TROUBLE in check_mail: delivery-notificaton FAILED: Assert
failed: 0, 1, at ...
It would seem I have a few other things to set in order to correctly
change the status of the message. Am I on the right track?
Can I choose to not quarantine a message in some cases, but send a
notificaton as if I had?
Also, I realise that I'm trying to tag a message as banned, which is
normally associated with an attachment. However, I still want to ban
messages by my policy even when there's no attachment. Am I going to
fall foul of anything by overloading the "banned" status? Should I be
setting a message to "badh" instead?
Cheers
Jeremy
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/