[exim] Checking against two LOGIN mecanisms in one instance …

Top Pagina
Delete this message
Reply to this message
Auteur: lacrimal
Datum:  
Aan: exim-users
Onderwerp: [exim] Checking against two LOGIN mecanisms in one instance of exim ??
Hello
I need to authenticate two kinds of users (I think so) with LOGIN authenticator(s)
- first for real mailboxes authenticated via saslauthd
- second for virtual mailboxes created with mysql database

I have them separated and they works fine but I don't know how to split them to work together with one instance of exim, because public_name cannot be the same for two AUTH's. I think that could be done with some 'or' statement but realy I don't have any ideas how to set it up. Of course also I don't think that this is best solution to do it. Perhaps I should run second exim server with virtual-only access??

My configuration for AUTH this:

######################################################################
#                       ACL CONFIGURATION                            #
#         Specifies access control lists for incoming SMTP mail      #
######################################################################


begin acl

acl_check_auth:
accept encrypted = *
accept hosts = *
accept condition = ${if eq {${substr_0_8:$smtp_command_argument}}{LOGIN}{yes}{no}}

######################################################################
#                   AUTHENTICATION CONFIGURATION                     #
######################################################################


begin authenticators
login:
driver = plaintext
public_name = LOGIN
server_prompts = "Username:: : Password::"
server_condition = ${if saslauthd{{$1}{$2}}{1}{0}}
server_set_id = $1
sql_login:
  driver = plaintext
  public_name = LOGIN
  server_prompts = "Username:: : Password::"
  server_condition = "${if and { \
                    {!eq{$1}{}} \
                    {!eq{$2}{}} \
                    {crypteq{$2}{\{md5\\}${lookup mysql{SELECT password FROM boxes \
                    WHERE user_name='$1'}{$value}fail}}} \
                  } {yes}{no}}"
server_set_id = $1


Well anybody help, any ideas??
Thanks

Jarek