Re: [Exim] help with exim syntax

Top Page
Delete this message
Reply to this message
Author: Alexey Promokhov
Date:  
To: Marc MERLIN
CC: exim-users
Subject: Re: [Exim] help with exim syntax
Hello Marc!

Marc MERLIN wrote:

MM> While I indeed had to make that change, I still seem to have a syntax
MM> problem, but I can't pinpoint it (I checked that the braces match)


MM> server_condition = "${if or {{eq{lookup{lc:$1}lsearch{/etc/mail/smtpauthdb}{$value}{fail}}{$2}}{pam{${lc:$1}:$2}}}{1}{0}}"
MM> gives:
MM> 435 Unable to authenticate at present: missing 2nd string in {} after "eq"


Hard but nice exercise. :)

server_condition = "${if or {{eq{${lookup{lc:$1}lsearch{/etc/mail/smtpauthdb}{$value}{fail}}}{$2}}{pam{${lc:$1}:$2}}}{1}{0}}"

Note syntax of ${lookup}, don't forget about dollar sign.

Also note security bug. Looking for username that does not listed in
/etc/mail/smtpauthdb will result string "fail". So intruder can enter
"fail" as password and will be validated. Replace it with something
else, like "rirhjuiuiehjqeyhgryug" ;)

Btw, message

435 Unable to authenticate at present: missing 2nd string in {} after "eq"

is produced in strings like

${if or {{eq {1}}{eq {2}{3}}}}

where eq have only one operand. Maybe this info will be useful for
somebody.


--
Alexey Promokhov <ayp(at)ayp.msk.ru>, 2:5020/2388.1513@fidonet