Re: [exim] help with the router setup

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Peter Bowyer
Date:  
À: exim-users
Sujet: Re: [exim] help with the router setup
Genady Perchenko <genady@???> wrote:
> I have 2 domains that are literally bombarded with email (at 1000s
> per day)
> to the random local parts from 100s of different ips. While all emails
> with non existent local parts are rejected, it does take a tall on
> the production mail server. I decided to redirect all traffic to
> those domains through the special designated mail hub that would
> filter all the mails
> with bed local parts and let the only valid once through. One of the
> ideas is not to use callout but have a local lists of local parts in
> plain text files (one per domain). I did get the hub itself to work
> but I am having trouble to
> setup the router to verify the local part. I have the following:
>
>     hubbed_hosts:
>   debug_print = "R: hubbed_hosts for $domain"
>   driver = manualroute
>   domains = "${if exists{CONFDIR/hubbed_hosts}\
>                    {partial-lsearch;CONFDIR/hubbed_hosts}\
>               fail}"
>   route_data = ${lookup{$domain}partial-lsearch{CONFDIR/hubbed_hosts}}
>   fail_verify_recipient =
>   ${lookup{$local_part}lsearch;{CONFDIR/$domain}} transport =
> remote_smtp

>
> But exim complains that fail_verify_recipient is not set correctly.
> What do I need to do to get my idea working?


A couple of things

- You have the syntax wrong in the fail_verify_recipient line - the ; is not
needed after the lsearch. That should fix your error I think.

- But.. what is the logic going on here? What you've done is effectively
specifiy a list of *invalid* localparts in the CONFDIR/$domain file. Is this
what you meant to do? I suspect not given your explanation above.

A more likely version where you specify a list of valid localparts would be

 hubbed_hosts:
  debug_print = "R: hubbed_hosts for $domain"
  driver = manualroute
  domains = "${if exists{CONFDIR/hubbed_hosts}\
                   {partial-lsearch;CONFDIR/hubbed_hosts}\
              fail}"
  local_parts = $lookup{$local_part}lsearch{CONFDIR/$domain}}
  route_data = ${lookup{$domain}partial-lsearch{CONFDIR/hubbed_hosts}}
  transport = remote_smtp


If the localpart being routed or verified isn't in the $domain file, the
router will pass - which, as long as you don't have any more routers which
would handle this domain, should produce the effect your want.

Peter