Christophe,
> I think my problem is that I don't know How to say :
> - my LDAP users ( 90% of my users) are spam lovers.
> and - my /etc/aliases and canonical relocated users are non spam lovers ..
> > So you either have a $final_spam_destiny=D_PASS,
> > or you have all recipients declared as spam lovers.
> $final_spam_destiny = D_DISCARD;
> and no declaration for spam_lovers, is this means all my users are
> spam_lovers by default ?
No, they are not.
(only the D_PASS setting is equivalent to all recipints being *_lovers)
> So How to say only users in my /etc/aliases and /etc/canonical files are
> non spam lovers ?
You need to list them explicitly as such, i.e. recipients in aliases file
need to be listed explicitly as NON-spam-lovers (to block spam for them),
and all the rest (a catchall default) could be declared as spam lovers
(to be able to receive tagged spam),
> > The $final_spam_destiny can be set to D_DISCARD (or D_BOUNCE),
> > and all your recipients EXPECT THE RELOCATED ONES should be
> > listed as spam lovers.
>
> what is RELOCATED ONES, is it users who have adresses forwarded by
> /etc/aliases ?
Yes, that is what I had in mind.
> > You can use any of the following lookup tables:
> > %spam_lovers, or @spam_lovers_acl, or $spam_lovers_re.
> >
> > If you have only a few relocated users, use the _acl, e.g.:
> > @spam_lovers_acl = qw( [EMAIL PROTECTED] [EMAIL PROTECTED] . );
> > (the '!' makes the listed users NOT spam lovers, the final dot makes
> > all the rest spam lovers - README.lookups).
> >
> > If you have many such users, it is better to use a hash lookup, e.g.:
> >
> > %spam_lovers = (
> > '[EMAIL PROTECTED]' => 0,
> > '[EMAIL PROTECTED]' => 0,
> > '.' => 1,
> > );
> > (keep addresses in lower case)
> >
> > A function read_hash() can be called from amavisd.conf to read
> > the %spam_lovers from a file, if desired. See RELEASE_NOTES.
This gave you some examples, if static lookup tables constructed in
amavisd.conf suffice. If you prefer to read a list from a file,
you could call a read_hash(), e.g.
@spam_lovers_maps = ( read_hash('/etc/spam-lovers.txt') );
/etc/spam-lovers.txt :
[EMAIL PROTECTED] 0
[EMAIL PROTECTED] 0
.
Note the final line with a dot, it provides a value of true for
any recipient which is not listed explicitly in the rest of the file.
The syntax of a file that a read_hash is able to read
is described where the subroutine is defined in file amavisd:
# read a lookup associative array (Perl hash) from a file - may be called
# from amavisd.conf
#
# Format: one key per line, anything from '#' to the end of line
# is considered a comment, but '#' within correctly quoted rfc2821
# addresses is not treated as a comment (e.g. a hash sign within
# "strange # \"foo\" address"@example.com is part of the string).
# Lines may contain a pair: key value, separated by whitespace, or key only,
# in which case a value 1 is implied. Trailing whitespace is discarded,
# empty lines (containing only whitespace and comment) are ignored.
# Addresses (lefthand-side) are converted from rfc2821-quoted form
# into internal (raw) form and inserted as keys into a given hash.
# NOTE: the format is partly compatible with Postfix maps (not aliases):
# no continuation lines are honoured, Postfix maps do not allow
# rfc2821-quoted addresses containing whitespace, Postfix only allows
# comments starting at the beginning of a line.
I understand you have your relocated users already listed in aliases file.
As the syntax is slightly different (aliases have a colon after an address),
and the boolean sense is reversed (listed users => false, everybody else
true), you'd need to either prepare a customized file from your existing
aliases file, or write a small Perl subroutine (in place or read_hash),
which could read your existing aliases file and construct a perl associative
array (a hash) from it.
Mark
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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/