On 9/16/2009 5:46 AM, Roman Naumenko wrote:
>> > I'd like to ask amavis guru if possible to have list of email for
>> > sa_tag2_level_deflt in external file?
>> > It shouldn't be db, just a simple file shared over nfs between email
>> nodes.
>> >
>> > $sa_tag2_level_deflt =
>> > {
>> > list of emails
>> > };
>> >
> Thanks Mike, but I'm afraid learning curve for that example is too steep.
>
I'm not sure If I clear about an aspected of your question. Do you want
to assign a list of emails to the default tag2 level? Or do you wish to
assign different tag2 levels to a list of emails (eg. create a
per-recipient mapping of tag2 levels to email addresses).
If you want to assign a list of emails to the default tag2 level, what
would other emails tag2 levels default to?
It sounds like you don't want to change $sa_tag2_level_deflt, as it is a
single, default value (although it is a member of a policy_bank), but
instead want per-recipient tag2 levels.
You can read values into a maps array via read_array() (or into a hash
with read_hash()). If believe this is the (unchecked/untested) syntax:
/etc/amavisd.conf:
@spam_tag2_level_maps = (read_array('/var/amavis/tag2_maps.dat'));
/var/amavis/tag2_maps.dat:
{ '[email protected]' => 8.0, '.example.com' => 6.0 }
\$sa_tag2_level_deflt
one array entry per line. Note the first line is an anonymous hash ref,
containing two mappings. Since we are mapping address to value, a hash
is used. The second line here contains the fallback default mapping.
No hash required since the bare value (reference to
$sa_tag2_level_deflt) is used for everything else.
> If anybody can give me an example of policy loaded from external file?
>
You place the \...@spam_tag2_level_maps assignment above inside, or
outside, a policy bank.
Alternatively, in my previous email, I meant to imply that you could
define the entire policy bank, or other variable or mapping in an
external file, included by the /etc/amavisd.conf file.
--
Mike
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
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/