
cyborg2 at benderirc
Jan 11, 2012, 9:11 AM
Post #6 of 6
(275 views)
Permalink
|
Am 11.01.2012 15:46, schrieb SCHNEIDER Benoit: > Hi > > tank's for you answer, > If in understand the line: "and whiteliste not regexp > '${quote_mysql:$header_from}'' > It's mean about every mail who come from all local domain will be accepted ? > > But I want to setup a list of distant domain, or email, for this i was > thinking about two line: > "and whiteliste not regexp '$whitelisteemail'' > "and whiteliste not regexp '$whitelistedomain'' > > where $whitelisteemail and $whitelistedomain will be like: > > $whitelisteemail = user1 [at] distdomaine : user2 [at] distdomaine2 > $whitelistedomain = distdomaine3.com : distdomaine4.com > > I'm in the right way ? no, i think not. You can't mix SQL Statements with EXIM lists as you did. This SQL Statement : ... and whiteliste not regexp '$matchagainst' .. compares the regexpression inside the databasefield 'whiteliste' with '$matchagainst' which should the be the sender email. your code : 1. ditch_spam: 2. driver = redirect 3. allow_fail 4. data = :blackhole: 5. condition = ${if >{$spam_score_int}{${lookup mysql{select users.sa_refuse * 10 from users,domains \ 6. where localpart = '${quote_mysql:$local_part}' \ 7. and domain = '${quote_mysql:$domain}' \ 8. and users.on_spamassassin = '1' \ 9. and users.domain_id=domains.domain_id \ 10. and users.sa_refuse > 0 }{$value}fail}} {yes}{no}} 11. local_part_suffix = -* 12. local_part_suffix_optional 13. retry_use_local_part the mail will be redirected to :blackhole: is the "condition" is true. Example: ... and whiteliste not regexp 'test [at] domain' .. IF the entry for 'whiteliste' in your database is ".*@domain.de" it will not match .. which results in a FALSE for the condition. The Result is, it's not redirected to :blackhole: Example 2: ... and whiteliste not regexp 'test [at] demo' .. IF the entry for 'whiteliste' in your database is ".*@(domain|demo)\.de" it will not match => condition is false IF the entry for 'whiteliste' in your database is ".*@doesnotwork\.de" it will match => condition is TRUE, it gets redirected to :blackhole: Remember, you want it blackholed if the senderdomain is NOT in the whitelist. That's why it's NOT REGEXP if you wanne match an entire address, no problem. In this case, 'whiteliste' has to be "username [at] domai\.de". Simple, ain't it ? :) It's possible that the SQL must be the other way around: ... and 'test [at] domain' not regexp whiteliste .. check the mysql docs for the exact syntax. -- ## List details at https://lists.exim.org/mailman/listinfo/exim-users ## Exim details at http://www.exim.org/ ## Please use the Wiki with this list - http://wiki.exim.org/
|