Re: [exim] Want to fail a manualroute

Top Page
Delete this message
Reply to this message
Author: Dean Brooks
Date:  
To: exim-users
CC: Alain Williams
Subject: Re: [exim] Want to fail a manualroute
On Fri, Aug 21, 2009 at 11:22:42AM +0100, Alain Williams wrote:
> schoolAdmin:
> driver = manualroute
> domains = some.school
> condition = ${lookup{$local_part@$domain}lsearch{/etc/exim/admin_users}{1}fail}
> transport = remote_smtp
> route_list = * admin.exchange.box
> no_more
>
> The 'no_more' seems to do nothing.
>
> How do I get the bounce for domain some.school if the user is not in
> the file ?


The no_more setting is only used if all the precondition tests are true,
which is not be the case if the $local_part isn't one of your
admin users. From the documentation on the generic "more" router
condition:

   "Also, the setting of more does not affect the behaviour if one of the
    precondition tests fails. In that case, the address is always passed
    to the next router."


So, first thing is to remove the no_more from the schoolAdmin router.

Then, you can simply add another router right below your schoolAdmin
router that reads:

schoolAdminFail:
driver = redirect
domains = some.school
allow_fail
data = :fail: unknown user
no_more

The redirect router is usually used for forwarding an email address to
another, but you can also redirect to a special address called :fail:
that will bounce the message. Anything following :fail: will be
included in the bounce message.

Because the preconditions on this router will *always* match someone
at that school, it will always fail any address that made it through
your schoolAdmin router. The no_more isn't really needed here since
it will always fail any remaining address at that domain, but it's
good for readability.

--
Dean Brooks
dean@???