Skip to Content.
Sympa Menu

public-l - [DENICpublic-l] Re: [exim] server_condition syntax help?

public-l AT

Subject: Public DENIC mailinglist

List archive

[DENICpublic-l] Re: [exim] server_condition syntax help?

Chronological Thread 
  • From: Jakob Hirsch <jh AT>
  • To: public-l AT
  • Subject: [DENICpublic-l] Re: [exim] server_condition syntax help?
  • Date: Fri, 12 Aug 2005 00:44:54 +0200

Joe Kocsis wrote:

> What Im trying to accomplish is something like this..
> server_condition = ${if eq{$1}{${lookup mysql{SELECT Account FROM
> UserSession WHERE (Account='$1' or Account='$1 AT') and
> Password='$2'}{$value}fail}}{1}{0}}
> I need to be able to authenticate if the domain is left off and would
> like to supply a default domain.. ex:

What you wrote above should work, I think, though you can simply it:

${lookup mysql{
SELECT 'yes' FROM UserSession
WHERE (Account='${quote_mysql:$1}'
OR Account='${quote_mysql:$1 AT}')
AND Password='${quote_mysql:$2}'}

You should really use quote_mysql for any remote-given input you send to

You can also use two different queries depending on if there is a '@' in
the username. Or oven put ${if !match {$1}{@} {}} in the
query. But I don't think it's worth this hassle.

BTW, I'd recommend to allow different separators (e.g. !#%) between
localpart and domain, since there are some MUAs that can't handle @ in
the username.

Archive powered by MHonArc 2.6.19.

Top of Page