Jason,
> The general problem is that mail sent to forward addresses
> which are nonusers (ie: [EMAIL PROTECTED] -> [EMAIL PROTECTED])
> are not getting their X-Spam headers.
> All users are virtual users and are found in the mysql db 'vmail'
> table of 'users'.
> There is a separate 'virtual_domains' table.
> The issue is that when mail comes in it is checked against the
> 'users' table. The '[EMAIL PROTECTED]' is not in the db,
> so they are treated as tough they are not local and are not tagged.
All your domains should be listed as local. That includes virtual alias
domains, virtual mailbox, native local and relayed domains, i.e. domains
from all Postfix address classes.
> I am curious if there is a way to assign '%local_domains' or similar
> using a mysql query that is not the '$sql_select_policy'
> ie: %local_domains = lookup_sql('SELECT domain FROM virtual_domains');
> This is due to the way '$sql_select_policy' is currently set up.
If the $sql_select_policy does return a record and that record
does have a field named 'local':
- if that field is NULL (which is translated to undef), a lookup
falls back to statical lookup tables (@local_domains_maps), so
you could list your remaining local domains statically there;
- if that field is not NULL, its value (interpreted as a boolean)
tells whether a recipient is local or not, no fallback to statical
lookup tables occurs.
As a special case (see README.lookups), in case there is no field
named 'local' in a record as returned by $sql_select_policy, its value
is considered true for every record *except* when a field 'email' is
'@.' exactly, in which case a fallback to statical lookup tables happens.
It is not possible (without hacking the code) to do another SQL lookup
just to provide a value of some attribute such a 'local'. Either the
one-and-only $sql_select_policy provides a value, or it must be
provided by statical lookup tables.
> Also I currently have no way of doing 'JOIN' from 'users' to
> 'virtual_domains'
One possibility is to use 'SELECT... UNION SELECT...',
extending a set of records with another set, either synthesised
or collected from another table. What matters is that for each
local domain a record does exist, even though fields in a returned
record may all be NULL or nonexistent (if it is more convenient
to provide their values through statical lookups).
> $sql_select_policy =
> 'SELECT *,users.id'.
> ' FROM users LEFT JOIN wblist ON users.id=wblist.rid'.
> ' WHERE users.email IN (%k)'.
> ' ORDER BY users.id DESC';
I don't see a point in joining 'users' with 'wblist' for the
purpose of $sql_select_policy. There is no field in table 'wblist'
being of interest for a policy lookup (unless you changed a
schema considerably).
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/