Andrew,
> I would like to program a script, which puts the sender IP adresses of
> positive spam mails or virsus mails temporally on a local RBL. This will
> save CPU time when the next mail will be sent by this spammer.
With 2.5.4 or 2.6.0 you can supply custom hooks and obtain
access to the collected information on each message.
Then do with it whatever is needed.
In amavisd.conf:
include_config_files('/etc/amavisd-custom.conf');
In /etc/amavisd-custom.conf :
package Amavis::Custom;
use strict;
BEGIN {
import Amavis::Conf qw(:platform :confvars c cr ca);
import Amavis::Util qw(do_log);
}
sub new {
my($class,$conn,$msginfo) = @_;
bless {}, $class;
}
sub before_send {
my($self,$conn,$msginfo) = @_;
# $self ... whatever was returned by new()
# $conn ... object with information about a SMTP connection
# $msginfo ... object with info. about a mail message being processed
# See methods in Amavis::In::Connection, Amavis::In::Message, and in
# Amavis::In::Message::PerRecip for the full set of available data.
# SMTP client's IP address as a string (IPv4 or IPv6)
my($client_ip) = $msginfo->client_addr;
do_log(2, "CUSTOM: client's IP address is [%s], sender: %s",
$client_ip, $msginfo->sender);
my($infected) = $msginfo->is_in_contents_category(CC_VIRUS);
my($banned) = $msginfo->is_in_contents_category(CC_BANNED);
my($at_tag2) = $msginfo->is_in_contents_category(CC_SPAMMY); # >= tag2_level
my($at_kill) = $msginfo->is_in_contents_category(CC_SPAM); # >= kill_level
do_log(2, "CUSTOM: infected:%s, banned:%s, spammy:%s, spam:%s",
$infected, $banned, $at_tag2, $at_kill);
};
1; # insure a defined return
Mark
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
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/