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-----
On Thu, 2009-02-12 at 15:26 +0200, Henry wrote:> /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.passwdThen you're doing it the wrong way. Should be: abc at 123.com:....:user=realnamea_abc -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20090212/86cf2c2a/attachment-0002.bin>
On Thu 12/02/09 18:36 , Timo Sirainen tss at iki.fi sent:> abc at 123.com:. > ...:user=realnamea_abcThanks Timo, Unfortunately this is still not working. Any further comments would be appreciated. I've tried it two ways:- ATTEMPT 1 ---------------- /etc/dovecot.conf: auth default { userdb passwd-file { args = /etc/dovecot.passwd } passdb passwd-file { args = scheme=plain-md5 username_format=%u /etc/dovecot.passwd } } /etc/dovecot.passwd: bob at vh1.com:$1$Vh6a...::::::userdb_user=vh1_bob Error: auth(default): passwd-file(bob at vh1.com,::ffff:127.0.0.1): no passwd file: scheme=plain-md5 username_format=bob at vh1.com /etc/dovecot.passwd ATTEMPT 2 ---------------- /etc/dovecot.conf: auth default { userdb passwd-file { args = /etc/dovecot.passwd } passdb passwd-file { args = /etc/dovecot.passwd } } /etc/dovecot.passwd: bob at vh1.com:{PLAIN-MD5}$1$Vh6a...::::::userdb_user=vh1_bob Error: auth(default): passwd-file(bob at vh1.com,::ffff:127.0.0.1): unknown user I'm missing something obvious, I'm sure of it. Any pointers appreciated. Thanks -----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-----