I have been experimenting with allowing any of a users email aliases to be used to login. Using the login hook, I look up the address in our database and return the appropriate user. Dovecot then does the authentication.
Unfortunately, I am now getting multiple local users for the same imap mailbox. Is there anyway I can specify that local user so that I don’t get a bunch of split personalities ?
Thanks.
Glen Eustace, GodZone Internet Services, a division of AGRE Enterprises Ltd., P.O. Box 8020, Palmerston North, New Zealand 4446 Ph +64 6 357 8168 Fax +64 6 357 8165 Mob +64 27 542 4015
“Specialising in providing low-cost professional Internet since 1997"
On 15-03-05 10:20 AM, Glen Eustace wrote:
I have been experimenting with allowing any of a users email aliases to be used to login. Using the login hook, I look up the address in our database and return the appropriate user. Dovecot then does the authentication.
Unfortunately, I am now getting multiple local users for the same imap mailbox. Is there anyway I can specify that local user so that I don’t get a bunch of split personalities ?
try using the email2user hook:
function init() { if ($rcmail->task == 'login') { $this->add_hook('email2user',array($this, 'email2user')); // rewrite user as true username (if logged in as alias) } }
function email2user($p) { $realuser = alias_lookup($p['email']); $p['user'] = $aaa['account']; if ($p['email'] !== $realuser) { $p['email'] = $realuser; rcube::write_log('email2user', 'rewrote alias '.$p['email'].' to true account '.$p['user']); } return($p); }
function alias_lookup($email) { // make $email the true address return $email; }