On Tue, Dec 06, 2005 at 09:14:57AM +0000, Philip Hazel wrote:
> > No matter what I did, I could not get the match_domain statement to
> > properly read the $1, $2 or $3 variables. I'm not sure if the
> > match_domain statement has problems reading variables, or perhaps it
> > simply overwrites the $1/$2/$3 variables during the matching process.
>
> If you post the expansion you were trying to make work, I might be able
> to comment.
Here is what I was working with. The purpose is that I have a file in
DBDIR/authentication that contains either fully qualified addresses or
contains local_parts that are assumed to be in one of my local domains
which all share common realm/name space. An MD5-hashed password is
stored as the data value in the database.
So, I authenticate if either $2 is found on its own, or, if $2 is in
one of my local domains, I'll look up the local part of $2 by itself
and see if its in the database.
The lookups into the dbm files worked fine. However, match_domain
would *never* match one of my local domains no matter what I did,
but works fine on the same +localdomains list everywhere else in
the configuration.
I almost got to the point where it seemed like Exim (v4.60) was
clobbering the contents of $2 in some manner, which affected the second
lookup, but I can't prove that and I wasn't able to get much out
of "debug +expand".
driver = plaintext
public_name = PLAIN
server_prompts = :
server_condition = \
"${if or { {eq {${lookup{${lc:$2}} dbm{DBDIR/authentication} {$value} {*NP*}}} {${md5:$3}}} \
{and{{match_domain {${domain:$2}}{+localdomains}} \
{eq {${lookup{${local_part:${lc:$2}}} dbm{DBDIR/authentication} {$value} {*NP*}}} {${md5:$3}}}}} \
} {yes}{no}}"
server_set_id = $2
--
Dean Brooks
dean@???