[Exim] SMTP AUTH with MySQL, nearly working

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Dan Evans
Ημερομηνία:  
Προς: exim
Αντικείμενο: [Exim] SMTP AUTH with MySQL, nearly working
Hi,

I've got a 4.14 machine that I am trying to get SMTP AUTH running on with
MySQL.

The database has a table for each domain, and the users are already using
SMTP AUTH with the existing SMTP server, with usernames in the format
$user@$domain

I need to be able to split the username to get the domain so the correct
table can be checked.

I've got it working with a named table and sending mail as a user in that
domain, so I know I've got it set up correctly

login:
        driver = plaintext
        public_name = LOGIN
        server_prompts = Username:: : Password::
        server_condition = ${lookup mysql{select if(count(*), "1","0") from
**table** where MAILADDR = '${quote_mysql:$1}' and PASSWORD =
'${quote_mysql:$2}'}}
        server_set_id = $1


I've tried "${tr {$domain}{.}{_}}" in place of **table**, dots are replaced
with underscores in the tablenames for the obvious reason, but with no joy -
as expected, and I can't seem to find anything about splitting usernames in
string expansion in the online docs, my Exim 3 (I know) book, or Google. Am
I just using the wrong search terms and keywords? I can't beleive I'm the
first to come across this problem.

Many thanks for any input.

Dan