[Dovecot] Login with firstname.lastname instead of loginname
Some of our users use to login as firstname.lastname or firstname.lastname@charite.de instead of using the "correct" "flastname" login name.
In order to get this behaviour a long-gone co-worker wrote an authdaemon.pl, which speaks the courier-authdaemon protocol.
How can I emulate this behaviour with dovecot?
Basically, all I need is a usernamen mapping ala:
Ralf.Hildebrandt@charite.de rhilde Ralf.Hildebrandt rhilde for all my users -- I can generate this programatically using awk, but how can I make dovecot use that?
-- Ralf Hildebrandt (i.A. des IT-Zentrums) Ralf.Hildebrandt@charite.de Charite - Universitätsmedizin Berlin Tel. +49 (0)30-450 570-155 Gemeinsame Einrichtung von FU- und HU-Berlin Fax. +49 (0)30-450 570-962 IT-Zentrum Standort CBF send no mail to plonk@charite.de
On Wed, 2007-05-16 at 11:26 +0200, Ralf Hildebrandt wrote:
Some of our users use to login as firstname.lastname or firstname.lastname@charite.de instead of using the "correct" "flastname" login name.
In order to get this behaviour a long-gone co-worker wrote an authdaemon.pl, which speaks the courier-authdaemon protocol.
How can I emulate this behaviour with dovecot?
What passdb are you using? Dovecot supports aliases if you make the passdb return "user=the-real-user" field. http://wiki.dovecot.org/PasswordDatabase/ExtraFields
- Timo Sirainen <tss@iki.fi>:
What passdb are you using?
auth default: master_user_separator: * verbose: yes passdb: driver: passwd-file args: /usr/local/etc/dovecot.masterusers pass: yes master: yes passdb: driver: shadow passdb: driver: pam userdb: driver: passwd userdb: driver: passwd
Dovecot supports aliases if you make the passdb return "user=the-real-user" field. http://wiki.dovecot.org/PasswordDatabase/ExtraFields
Hmm, does this mean I add another dummy database containing:
ralf.hildebrandt:user=rhilde ralf.hildebrandt@charite.de:user=rhilde
for all users? How?
-- Ralf Hildebrandt (i.A. des IT-Zentrums) Ralf.Hildebrandt@charite.de Charite - Universitätsmedizin Berlin Tel. +49 (0)30-450 570-155 Gemeinsame Einrichtung von FU- und HU-Berlin Fax. +49 (0)30-450 570-962 IT-Zentrum Standort CBF send no mail to plonk@charite.de
On Wed, 2007-05-16 at 14:12 +0200, Ralf Hildebrandt wrote:
- Timo Sirainen <tss@iki.fi>:
What passdb are you using?
auth default: master_user_separator: * verbose: yes passdb: driver: passwd-file args: /usr/local/etc/dovecot.masterusers pass: yes master: yes passdb: driver: shadow passdb: driver: pam
Do you really have different users in shadow and in pam?
userdb: driver: passwd userdb: driver: passwd
There's no need to have this twice.
Dovecot supports aliases if you make the passdb return "user=the-real-user" field. http://wiki.dovecot.org/PasswordDatabase/ExtraFields
Hmm, does this mean I add another dummy database containing:
ralf.hildebrandt:user=rhilde ralf.hildebrandt@charite.de:user=rhilde
Well, shadow and pam don't support extra fields, so I don't think you can do anything about these unless you switch to another passdb. Currently Dovecot doesn't support these kind of "pass through passdbs".
PAM however does support internally changing the username, so it would be possible for you to create such a PAM module. But I can't help with that.
- Timo Sirainen <tss@iki.fi>:
Do you really have different users in shadow and in pam?
No, I don't.
Well, shadow and pam don't support extra fields, so I don't think you can do anything about these unless you switch to another passdb. Currently Dovecot doesn't support these kind of "pass through passdbs".
argh!
PAM however does support internally changing the username, so it would be possible for you to create such a PAM module. But I can't help with that.
Double-argh.
-- Ralf Hildebrandt (Ralf.Hildebrandt@charite.de) plonk@charite.de Postfix - Einrichtung, Betrieb und Wartung Tel. +49 (0)30-450 570-155 http://www.arschkrebs.de Men are from Mars. Women are from Venus. Computers are from hell.
- Ralf Hildebrandt <Ralf.Hildebrandt@charite.de>:
- Timo Sirainen <tss@iki.fi>:
What passdb are you using?
auth default: master_user_separator: * verbose: yes passdb: driver: passwd-file args: /usr/local/etc/dovecot.masterusers pass: yes master: yes passdb: driver: shadow passdb: driver: pam userdb: driver: passwd userdb: driver: passwd
So, am I getting this right, it should read:
passdb passwd-file { args = /usr/local/etc/dovecot.masterusers master = yes pass = yes } passdb shadow { }
# NEW passdb passwd-file { # Format should look like this: # firstname.lastname:password:uid:gid:(gecos):home:(shell):user=realloginname # firstname.lastname@charite.de:password:uid:gid:(gecos):home:(shell):user=realloginname args = /usr/local/etc/dovecot.login_via_email } # END NEW
userdb passwd { }
-- Ralf Hildebrandt (Ralf.Hildebrandt@charite.de) plonk@charite.de Postfix - Einrichtung, Betrieb und Wartung Tel. +49 (0)30-450 570-155 http://www.arschkrebs.de "Don't let your sense of morals prevent you from doing what is right." -- Asimov, "Foundation"
On Wed, 2007-05-16 at 14:38 +0200, Ralf Hildebrandt wrote:
# NEW passdb passwd-file { # Format should look like this: # firstname.lastname:password:uid:gid:(gecos):home:(shell):user=realloginname # firstname.lastname@charite.de:password:uid:gid:(gecos):home:(shell):user=realloginname args = /usr/local/etc/dovecot.login_via_email }
If you're only using it as a passdb, you don't need the uid/gid/home. So an example field would be:
firstname.lastname@charite.de:password::::::user=realloginname
participants (2)
-
Ralf Hildebrandt
-
Timo Sirainen