> Is there some more documentation on the SQL look ups side of things? README.lookups, search for "SQL".
The SQL clause is user-configurable, the default for $sql_clause{sel_policy} is a: SELECT *,users.id'. FROM users LEFT JOIN policy ON users.policy_id=policy.id WHERE users.email IN (%k) ORDER BY users.priority DESC as stated in amavisd.conf-default, but can be changed to will. > In particular it would be nice to see a diagram making the relationship > between tables clear. 'users' and 'policy' tables are usually joined on users.policy_id=policy.id . 'msgs' and 'msgrcpt' are to be joined on both the 'partition_tag' and 'mail_id' fields. The 'quarantine' and 'msgs' are to be joined on both the 'partition_tag' and 'mail_id' fields. Sender and recipient addresses are stored in table 'maddr', referred to its 'id' by msgs.sid (sender) and msgrcpt.rid (recipient). > Also, when an email is quaranteened in sql, are the "to" addresses > stored in a way that can be easily look up? The 'To' addresses from a header section are not stored to SQL, these are irrelevant for message delivery. The envelope recipient address is stored in msgrcpt.rid / maddr.id. Mark ------------------------------------------------------------------------------ _______________________________________________ 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/