This is a discussion on Re: AW: [AMaViS-user] One more question regarding policy bank configuration: quarantine via smtp within the Amavis User forums, part of the Anti-Spam and Anti-Virus Related Forums category; Sven, > Ok, but my amavis version (2.2.1) complains about an unknown option > when I use spam_quarantine_to ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Sven,
> Ok, but my amavis version (2.2.1) complains about an unknown option > when I use spam_quarantine_to within the policy bank defintion (but > see my examples of what I tried below). The list of all policy bank keys is at the end of the amavisd.conf-default. The spam_quarantine_to by itself is not available, but the more general @spam_quarantine_to_maps is. > I've been trying to make sense of things, but so far the light hasn't > been seen. Maybe the policy banks contain one indirection too many for > me. :) I can understand the complex data structures can be hard to do right. The @spam_quarantine_to_maps is a list of lookup tables, i.e.: @spam_quarantine_to_maps = ( a, b, c ) and its policy bank counterpart (which must be a scalar, not a list), is then a ref lo a list: spam_quarantine_to_maps => [ a, b, c ] A lookup table can be (as in README.lookups): - a ref to a list (an ACL lookup table), e.g. ['addr1', 'addr2'] or its equivalent: [ qw(addr1 addr2) ] - a ref to a hash, e.g. { 'addr1'=>1, 'addr2'=>1 }, - a ref to an object created by new_RE, e.g. new_RE(...) Putting it all together as an entry in policy banks: spam_quarantine_to_maps => [ [qw(addr1 addr2)] ], or in your case: spam_quarantine_to_maps => [ [ 'spam@test.de'] ], > $spam_quarantine_to = new_RE( > [ qr'^(.*)@test\.de$'i => 'sr@baghus.net' ], > [ qr'^(.*)(@[^@]*)?$'i => 'virus-${1}${2}' ] ); > > $interface_policy{'10050'} = 'test.de'; > $policy_bank{'test.de'} = { > final_spam_destiny => D_DISCARD, > spam_quarantine_method => 'local:spam@test.de', > ... > }; > Result: Spam gets tagged, but forwarded to original recipient Don't confuse mail forwarding with sending quarantine to an email address. The D_DISCARD ensures recipients do not get mail above kill level. Also, whatever comes after 'local:...' is irrelevant if *_quarantine_to contains an email address containing an '@' character. > Variant 5: > $policy_bank{'test.de'} = { > spam_quarantine_to_maps => > [ new_RE( [ qr'^.*@test.de$'i => 'spam@test.de' ] ) ], > ... > }; This one is correct (apart from missing \ before a dot in qr'^.*@test.de$'i ) > Result: > Spam gets tagged, but forwarded to original recipient Forwarded or quarantined? The spam_quarantine_to_maps does not control mail forwarding, it only controls quarantining. Did the log report the policy bank 'test.de' was loaded? Was spam level above kill level? Mark ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ AMaViS-user mailing list AMaViS-user@lists.sourceforge.net https://lists.sourceforge.net/lists/...fo/amavis-user AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 AMaViS-HowTos:http://www.amavis.org/howto/ |