Yves Thommes wrote:
> I'm having some trouble with router conditions under exim4
>
> I want to offer the amavis anti-virus service to all of my users hosted
> on my mailserver, but I still want to be able to enabled/disable the
> service on a per-user basis. So I tried with the following condition:
>
>
> condition = "${if and { \
> {eq {$received_protocol}{scanned-ok} {0}{1}} \
Should be:
{eq {$received_protocol}{scanned-ok}}
> {eq {${lookup mysql{SELECT checkvirus FROM users WHERE
> checkvirus='yes' AND username='$local_part' AND
> domain='$domain'}}{1}{0}} \
This is not correct either. See below for more.
> }{yes}{no}}"
>
>
> But it doesn't work. Can please somebody help me out with this
> condition. Amavis should only scan the mail if the user has
> checkvirus='yes' and if the mail hasn't already been scanned. Or if at
> least somebody could point me to a page with some documentation/examples
> regarding conditions under exim4.
A condition that might work (I haven't tested it):
condition = ${if and {\
{eq\
{$received_protocol}\
{scanned-ok}}\
{eq\
{${lookup mysql{SELECT checkvirus FROM users \
WHERE checkvirus='yes' AND username='$local_part' \
AND domain='$domain'}}}\
{yes}}
}{yes}{no}}
--
Kirill Miazine, Stud.Jur.
Faculty of Law, University of Oslo