Hello, list,

I tried to make the SASL SMTP authentication in roundcube works. I am using mysql to handle virtual user/domain.

So at first I set in the main.inc.php as following:
// SMTP username (if required) if you use %u as the username RoundCube
// will use the current username for login
$rcmail_config['smtp_user'] = '%u';

// SMTP password (if required) if you use %p as the password RoundCube
// will use the current user's password for login
$rcmail_config['smtp_pass'] = '%p';


Then the SASL failed. maillog shows:
Aug 23 13:32:25 gamma postfix/smtpd[3884]: warning: gamma.foo.com[127.0.0.1]: SASL LOGIN authentication failed: authentication failure

I went to check mysql query log and found that %u only pass the user portion to the query

After googling aroune  I changed this line to:
$rcmail_config['smtp_user'] = '%u@%d';

Now it seems works. mail log shows:
Aug 23 13:29:59 gamma postfix/smtpd[3838]: BB2B82D70088: client=gamma.foo.com[127.0.0.1], sasl_method=LOGIN, sasl_username=someuser@foo.com@%d

And this time mysql got correct query in the WHERE clause.

But why is there always a %d at the end in the maillog? Should I use other instead '%u@%d'?

Please help. Thanks.

 



--
Jian Gao