RE: [exim] one more condition

Pàgina inicial
Delete this message
Reply to this message
Autor: Chris Knipe
Data:  
A: exim-users
Assumpte: RE: [exim] one more condition
Hi Marc,

Thanks for the input / help. The below will work yes, but will also fail.
I'm sitting with a bit of logical problem at the moment that I don't quite
know how to handle....

Domain abc.com has Recip Verify on
Domain cde.com has Recip Verify off

Using the conditions as discussed below... I do a couple of things on the
MySQL side...
- Select the local part from the table *IF* the domain is active, Recip
Verification is On, and the local part exist

Now, taken the example of the two domains above.... Exim (due to MySQL
Mainly), will ALWAYS return negative on either one of the two domains.

Cde.com:
- Recip Verification is off, MySQL won't ever return a result, Exim won't
match - and deny.

Abc.com
- Recip Verification is on, MySQL will return the local part, Exim might
match - and accept.

I need to rethink my logic here, but so far, all my attempts are failing :(

My latest attempt:
${if and {
    {eq {${lookup mysql{Query returns 'y' if Recip verification is on}}}
{y}}
    {eq {${lookup mysql{Query returns local_part}}} {y}}
}}


But even that, is failing. I need to write this in 'two steps' as far as I
can see...

If (Recip Verification == true && Local part == matched) Accept Message
Else If (Recip Verification == False) Accept Message
Else Deny Message

How to do that in Exim's logic, is a bit beyond me at this stage :(

If you, or anyone else on the light can give me some insight here, I would
appreciate it tremendously.

Thanks,
Chris.



> -----Original Message-----
> From: exim-users-bounces@???
> [mailto:exim-users-bounces@exim.org] On Behalf Of Marc Sherman
> Sent: 20 December 2005 14:36
> To: exim-users@???
> Subject: Re: [exim] one more condition
>
> Chris Knipe wrote:
> > Hi,
> >
> > Just one more quicky that's giving me grief. From the
> debug, it seems
> > the if eq refuses to match, and therefore doesn't return
> anything....
> >
> > Debug:
> >>>> processing "deny"
> >>>> check condition = ${if eq {${lookup mysql{SELECT LocalPart FROM 
> >>>> Exim_Recipient_Map LEFT JOIN Exim_DomainList ON 
> >>>> Exim_Recipient_Map.DomainID=Exim_DomainList.EntryID LEFT JOIN 
> >>>> Exim_ACLList ON 
> Exim_Recipient_Map.DomainID=Exim_ACLList.DomainID 
> >>>> WHERE Exim_DomainList.isActive='y' AND 
> >>>> Exim_ACLList.reqReciptVerify='y' AND 
> >>>> Exim_Recipient_Map.LocalPart='${quote_mysql:$local_part}' AND 
> >>>> Exim_DomainList.DomainName='${quote_mysql:$domain}' 
> LIMIT 1}}}{${local_part} {yes}{no}}
> >>>>                 =
> >>>> deny: condition test failed

>
> It looks like your bracketing is wrong. The last line should be:
>
> 1}}}{$localpart}{yes}{no}}
>
> However, there's two levels of redundancy in there: firstly,
> ${if}'s results default to {yes}{no}, so you don't need the
> final {yes}{no} there. Secondly, $localpart has if/else
> semantics itself, so you don't even need the ${if eq} in the
> first place. Just use:
>
> condition = ${lookup mysql{SELECT LocalPart ..... LIMIT 1}{yes}{no}}
>
> Or, even cleaner:
>
> condition = ${lookup mysql{SELECT COUNT(*) FROM
> Exim_Recipient_Map LEFT JOIN Exim_DomainList ON
> Exim_Recipient_Map.DomainID = Exim_DomainList.EntryID LEFT
> JOIN Exim_ACLList ON Exim_Recipient_Map.DomainID =
> Exim_ACLList.DomainID WHERE Exim_DomainList.isActive = 'y'
> AND Exim_ACLList.reqReciptVerify = 'y'
> AND Exim_Recipient_Map.LocalPart =
> '${quote_mysql:$local_part}' AND Exim_DomainList.DomainName =
> '${quote_mysql:$domain}'}}
>
> - Marc
>
>
>
> --
> ## List details at http://www.exim.org/mailman/listinfo/exim-users
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://www.exim.org/eximwiki/
>