[Dovecot] Mapping usernames
Henry
henka at cityweb.co.za
Thu Feb 12 15:26:10 EET 2009
Greets,
We're using Dovecot 1.0.7 (which comes with CentOS 5.x).
I have successfully configured dovecot to change a username from abc at 123.com to realname1_abc for a machine which only has a single domain (using auth_username_format=realname1_%Ln).
However, I'm pulling my hair out trying to get dovecot to handle multiple domains (the machine has existing /etc/passwd /etc/shadow and /etc/mail/virtusertable users). On an older machine, I simply hacked the source code to perform a berkeley DB lookup in /etc/mail/virtusertable.db for the realname[a-z0-9]_xx. This time round, though, I'm trying to do this cleanly.
I've been reading the docs/wiki/etc but I now can't see the forest for the trees. This is what I've got so far:
In /etc/dovecot.conf:
...
auth default {
userdb passwd-file {
args = /etc/dovecot.passwd
}
passdb passwd-file {
args = /etc/shadow
#args = /etc/dovecot.passwd
}
}
/etc/dovecot.passwd contains:
realnamea_abc:{PLAIN-MD5}$1$Vjkfhaa....::::::userdb_user=abc at 123.com
I've been fiddling around blindly with all kinds of settings in userdb {} above, but I always get the error:
"passwd-file(abc at 123.com,::ffff:127.0.0.1): unknown user", amongst others.
In a nutshell, I want to allow a user to login with abc at 123.com, this name must be mapped to a real system user (eg, using /etc/dovecot.passwd), then authenticated against /etc/shadow or the MD5 password in /etc/dovecot.passwd
I would appreciate any kind of pointers or advise here. It would have been nice if vpopmail allowed me to call an external perl script where I could perform the username mapping, but alas, this is not possible.
Thanks
Henry
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.5 (GNU/Linux)
mOIESXlwDRECAOycneJPOwSkETRkjJZdArag8V2rKOR2IUwlDOydIZXv/ITDlWDU
dookzEdWh7Ektf1Jlh+YbPNEGoPpQunL8O8AoJbWmNkpoX7jP0Sw/5rDN2eKGHR7
Af9mxTqQ/j3C5LkrTRo9iCTt1TxoqPi6R/w0KkIAuTXBq6j+vIFJcOFgABlMQoXs
V2crh1BUCmXVsV1puRJsLWKbAf4uL0V+N8WF4rvWHmJiYjgDn6exv3XHS0F6NhRz
n1KVnV0XDWMDq/B/tmj4L2JYxEzWzeNulC5yQBOdx/dLU12XtCNIZW5yeSAoemVu
LmNvLnphKSA8aGVucnlAemVuLmNvLnphPohgBBMRAgAgBQJJeXANAhsjBgsJCAcD
AgQVAggDBBYCAwECHgECF4AACgkQCHhhdg2iQafVGACdEMtEuUGIW2XJyn9Fig7n
sX4qzb4An0PGStBZvAP2qtzYP3SGlzsllzLjuI0ESXlwDRACAMsi4nl8/Yar2m9F
ex4dFDgWylLgScQrEhhb2xN0Upcglm60nHQD7c1rP+63Iu+lU0eWvyr8o3JTCN4y
PpoGMOMAAwUCAIUnLDMW/tz+qsYaOPyoh7HdAYqcrvVar7t+eKpihNBqfP4CT2Py
aRVMN6cSJj9NKZDW6b0QQSCGgN7PpzrLqf6ISQQYEQIACQUCSXlwDQIbDAAKCRAI
eGF2DaJBpxeiAJ9cNiuaftSoWke75RT1pn7qoibFfgCdHl6BgP9f450/oziDwaMM
w49UeHQ=
=qgmL
-----END PGP PUBLIC KEY BLOCK-----
More information about the dovecot
mailing list