Re: [exim] bypass dnslookup for specific local parts

Top Page
Delete this message
Reply to this message
Author: W B Hacker
Date:  
To: exim users
Subject: Re: [exim] bypass dnslookup for specific local parts
Paul LUNETTA wrote:

> Hi everybody,
>
> I would like to know how to bypass the dnslookup router in that condition :
>
> For the internal domain "i-example.com"
> I want that emails with the local parts listed in the file "/etc/exim/lst"
> have their destination domain not checked by the dnslookup router.
>
> I tried these ways :
> http://www.exim.org/mail-archives/exim-users/Week-of-Mon-20040906/msg00137.html
>
> **********
> *** in "acl" :
>
> verify = recipient
>
> **********
> *** in "routers" i tried this :
>
> skip_dnslookup:
>    driver = accept
>    domains = i-example.com
>    local_parts = lsearch;/etc/exim/lst
>    verify_only = yes

>
> *** but dnslookup still pass...
> *** or that :
>
> userlist_domains:
>    driver = redirect
>    allow_fail
>    domains = i-example.com
>    data =
> ${lookup{$local_part}lsearch{/etc/exim/lst}{$local_part@$domain}{:fail:
> Unknown user}}

>
> *** but it is just replying to the sender "unknown user". it seems to
> work but that's not what i would. I tried to mix both solutions but
> attributes are not compatibles.
> *********
>
> Actually, my aim is to use internal mailing lists with some external
> adresses. The other adresses of the domains are not allowed to send
> messages to outside.
>
> dnslookup:
>
> #remote_mail:
>    driver = dnslookup
>    condition = \
> "${if and {\
>          {match{$sender_address_domain}{i-example.com}}\
>          {!match{$domain}{other_domain.com}}\
>          }\
>          {yes}{no}}"
>    #domains = ! +local_domains
>    transport = not_permited_in

>
> If you have any idea...
>
> Thank you very much,
>
> Paul.
>
>


Something simpler may work for you:

===

   deny
      hosts     = /var/mail/IP-block



   deny
      condition = ${lookup {$sender_host_address} \
                lsearch{/var/mail/IP-block}{yes}{no}}



   deny
      condition = ${lookup {$sender_helo_name} \
                wildlsearch{/var/mail/REGEXP-block}{yes}{no}}


   deny
      condition = ${lookup {$sender_host_name}\
                wildlsearch{/var/mail/REGEXP-block}{yes}{no}}


===

Where:

- IP-block list is populated with IP numbers, one per line.

- REGEXP-block list has full and/or partial strings used by incorrigibles, also
one per line.

Have a care with my MUA line-wrapping & the continuation characters.

The 'production' versions I use have no such - just long lines.

HTH,

Bill