Re: [Exim] Want soft failure when a file lookup fails

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Sheldon Hearn
CC: exim-users
Subject: Re: [Exim] Want soft failure when a file lookup fails
On Thu, 12 Jul 2001, Sheldon Hearn wrote:

> I have the following smtp_banner option in my main Exim configuration
> section for exim-3.31:
>
> smtp_banner = $primary_hostname ESMTP Exim \
>   ${lookup{$sender_host_address} \
>     lsearch* {/usr/local/etc/exim/bannerversion} \
>     {${expand:$value}}}

>
> The bannerversion file contains this line:
>
> *: [Test release]\r\nYou probably shouldn't be using this service.
>
> If the bannerversion file is absent (perhaps in some small window period
> during an update operation), the lookup fails and all incoming SMTP
> connections receive a 421 error as documented.


1. If you put the new version in place using rename (i.e. use mv), there
won't be a window when it doesn't exist.

> So, is there a way to ensure that a non-existent file for an lsearch is
> treated as if the lookup failed (in this case, null expansion)?


2. Non-existence of a file that you ask Exim to search is treated as a
serious error, so it fails the entire expansion. This is usually the
best thing to do.

3. At present, the use of "fail" in the expansion of smtp_banner is not
treated specially. I suppose I could make it carry on and use the
default banner. However, that doesn't help, because non-existence does
not behave the way you want.

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.