[Exim] How to only run CRAM authenticator when certain file …

Top Page
Delete this message
Reply to this message
Author: Ralf G. R. Bergs
Date:  
To: exim-users
Subject: [Exim] How to only run CRAM authenticator when certain file exists?
Hi there,

I have the following in my exim.conf file (Exim version is 4.22):

lookup_cram:
   driver = cram_md5
   public_name = CRAM-MD5
   server_secret = \
     ${if \
       exists{/etc/exim/virtual/${lc:${domain:$1}}/passwd.cram}\
       {${lookup\
          {${lc:${local_part:$1}}}\
          lsearch\
           {/etc/exim/virtual/${lc:${domain:$1}}/passwd.cram}\
           {$value}\
           fail\
         }\
       }\
       fail\
      }
   server_set_id = $1


This doesn't exactly do what I want. If the passwd.cram file doesn't
exist, this authenticator (obviously) fails. What I want is that it is
simply skipped in this case. I expected to be able to use

condition = ${if exists{}{yes}fail}

but obviously this can't statement can't be used with authenticators.

I'm sure I'm overlooking something, can someone help?

Thanks,

Ralf