Re: [Exim] dnslookup blocking for an addresslist

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Andreas J Mueller
Ημερομηνία:  
Προς: Jonathan Vanasco
Υ/ο: exim-users
Αντικείμενο: Re: [Exim] dnslookup blocking for an addresslist
Hi Jonathan!

> addresslist myaddresses = lsearch;/path/to/file
> dnslookup
>         driver = dnslookup
>         domains = ! +local_domains
>  >      local_parts = ! +myaddresses
>         transport = remote_smtp
>         no_more


> problem is, i can only figure out how to do it with local_parts -- is
> the entire address even supported? can't find anything in the exim4
> specification or book


Entire addresses are not directly supported in router preconditions.
However, since the domains precondition is checked before local_parts,
and local_parts is expanded, you can base your lookup on the $domain
variable:

local_parts = ! lsearch;/path/to/local_parts_dir/$domain

You could then put all the local parts belonging to, e.g. the aol.com
domain, in file /path/to/local_parts_dir/aol.com.

Please also note, that a failed precondition will just cause the
router to be skipped, not to be "failed". Exim will simply go on to
the next router in the list, even if no_more is set. What you seem to
want is something like this, just before the dnslookup router:

fail_dnslookup:
driver = redirect
domains = dsearch;/path/to/local_parts_dir
local_parts = lsearch;/path/to/local_parts_dir/$domain
data = :fail:
allow_fail
no_more

Or, if your Exim doesn't have support for dsearch compiled in:

fail_dnslookup2:
  driver = redirect
  condition = ${lookup{$local_part@$domain}lsearch{/path/to/fail_addresses}\
                {yes}{no}}
  data = :fail:
  allow_fail
  no_more


Andy

--
Andreas J Mueller                             email: <andy@???>