|
|||||||||||
|
Re: [AMaViS-user] Amavis Plugin
From: Mark Martinec <Mark.Martinec+amavis(at)ijs.si>
Date: Fri Apr 18 2008 - 10:06:59 EDT
> I would like to program a script, which puts the sender IP adresses of 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;
BEGIN {
sub new {
sub before_send {
# $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 AMaViS-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amavis-user AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 AMaViS-HowTos:http://www.amavis.org/howto/ Received on Fri Apr 18 10:07:21 2008 This archive was generated by hypermail 2.1.8 : Tue Jul 29 2008 - 23:11:11 EDT |
||||||||||
|
|||||||||||