Re: [exim] one more condition

Pàgina inicial
Delete this message
Reply to this message
Autor: Jakob Hirsch
Data:  
A: Chris Knipe
CC: exim-users
Assumpte: Re: [exim] one more condition
Chris Knipe wrote:

>>>> check condition = ${if eq {${lookup mysql{SELECT LocalPart FROM

...
>>>> 1}}}{${local_part} {yes}{no}}


The first rule of Exim Expansion Club is - check the braces
The second rule of Exim Expansion Club is - CHECK the braces

Right now, you compare the result to {${local_part} {yes}{no}}, and the
closing brace of ${if is missing.

Use {$local_part} {yes}{no}} and it should do what you want.
(btw, {no}{yes} if it's used in a deny stanza)


but considering the third rule (don't use ${if } if you don't have to),
you should check if you can simplify the condition, like:

${lookup mysql{SELECT...} {yes}{no}}

I.e., if the lookup succeeds, the condition is true.

(Or use the recipients condition, but that's a matter of taste.)

> Basic idea... Verify recipient address from a mysql database.... It's
> supposed to be for recipient address maps on domains I intend to *relay*
> mail for (and therefore, I believe I cannot use verify = recipient)...


Actually, you _can_ use recipient verification. If you have a special
router for the hosts you relay for, move the condition there. Just make
sure no other router handles that mail (i.e. add "!+relay_domains" to the
domains condition of your dnslookup router)