Re: [exim] Allow user%domain auth

Top Page
Delete this message
Reply to this message
Author: Jakob Hirsch
Date:  
To: Konstantin Kletschke
CC: exim-users
Subject: Re: [exim] Allow user%domain auth
Konstantin Kletschke wrote:

> On my setup I have user/pass in the courier SQL database doupled, one
> user name with @, one with %
> Exim uses the same database to authenticate.
> Do you use SQL databases? This thing should be working with other
> password files also.
> But may be, there is a possibility to do this more elegant...


You should have user and domain in seperate fields, you can use
something like this:

   server_condition = ${if and { \
     {!eq {$2}{}} \
     {!eq {$3}{}} \
     {eq {\{plaintext\}$3} \
       {${lookup mysql { \
         select password_hash from popbox \
         where local_part = '${quote_mysql:${extract {1}{@%!}{$2}}}' \
         and  domain_name = '${quote_mysql:${extract {2}{@%!}{$2}}}' \
       }{$value}{*:*}}} \
   }}{1}{0}}


Password is stored as "{plaintext}users_password" as needed for
vmail-sql/tpop3d (if there are only plain text passwords in the db).
As you can see, we allow @, % and ! as user/domain separator.