Hi,

I have it working now, but an extra issue came up.

We found out that more mta's put the "X-Spam-Flag" in their header, so i 
want to use the amavisd-custom.conf , only if the message comes from our 
isp.

I have found a solution, I use :

   my($subj) = $msginfo->get_header_field_body('X-Spam-Flag',0);
   my($from) = $msginfo->get_header_field_body('Received',0);

and then

   if ($subj =~ /^[ \t]YES/) {
   if ($from =~ /ourisp.com/) {

This works great, but i was wondering, is it possible to create an if 
statement, or something that looks like a policy bank in amavisd.conf, 
like the following :

@myisp = qw ( 10.20.0.0/16 64.20.10.0/16 );
$policy_bank{'MYISP'} = {
include_config_files('/etc/amavisd-custom.conf');
};

Maybe a policy bank is not the answer, but something like that.
So if an IP number from our isp sends the message to our MTA, only then 
I do the quarantaine trick.

Is something like this possible, or should i keep using the 
amavisd-custom.conf the way i use it know.

Greetings.... Richard

Mark Martinec wrote:
> Richard,
> 
>> Sometimes the arriving messages from our ISP have multiple X-Spam-Flag
>> lines from multiple MTA's it has been rerouted through. [...]
>> I have looked at the sub get_header_field.
>> If i want to select the first X-Spam-Flag. (top one - last MTA)
>> I use : get_header_field_body('X-Spam-Flag',0)
> 
> Yes, the get_header_field_body('X-Spam-Flag',0) would provide
> the topmost header field X-Spam-Flag.
> 
>> But what if I don't specify the : '0'
>> If i understand the sub get_header_field, it uses default the 0 ?
> 
> No, if the index is not specified it defaults to undef, which for
> this subroutine is made equivalent to -1, i.e. the most bottom
> header field. I chose this default because it is consistent
> with how DKIM verification algorithm searches for header
> fields: bottom-up.
> 
>> So default it uses the first X-Spam-Flag line it finds from the top to
>> bottom ? Am i correct ?
> 
> Explicitly specify a 0 if you want the topmost header field.
> 
>   Mark
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> 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/

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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/

Reply via email to