Hi, I'm about getting to know dovecot in details, I am about the command "doveadm user". The man page shows this example: userdb: jane uid : 8001 gid : 8001 home : /home/jane mail : sdbox:~/sdbox plugins : sieve quota_rule: *:storage=150M It seems to be nice, however I never got this only: ~# doveadm user lgb at office userdb: lgb at office That's all. The dovecot test configuration works otherwise via IMAP/POP3/LMTP nicely. What I guess that the lack of extra information (which would be needed by some scripts of mine, eg for getting user's home easily from shell scripts, as it's hash based, etc) is caused because I don't pass home (and/or other settings) back from userdb and/or passdb. However I do have these in global scope: mail_home = /mailstorage/%Ld/%Ln (yes, this is not hashed at all at the momement but it will be soon) mail_location = maildir:~/Maildir mail_uid = vmail mail_gid = vmail (... and also some global quota stuffs configured in plugin section) Now, I am a bit confused: even with passdb/userdb does not return with user home or GID/UID, dovecot knows these in case of pop3/imap/lmtp access, since these information can be "composed" from those settings. But then, wouldn't it possible so "doveadm user" shows those as well, like lmtp/pop3/imap can resolve those too? Honestly, it's a bit redundant to put needed information into user and pass attrs in every dbs (I have some) when dovecot knows those otherwise ... If I interpret "doveadm user"'s goal wrong (it's just for userdb/passdb query tool nothing more), is there any tool which works in this config, displaying extra information (at least user's home), or should I create some script which just repeats the functionality of dovecot's configured mail_home resolution? Thanks.
On Wed, Sep 12, 2012 at 04:40:00PM +0200, G?bor L?n?rt wrote:> If I interpret "doveadm user"'s goal wrong (it's just for userdb/passdb > query tool nothing more), is there any tool which works in this config, > displaying extra information (at least user's home), or should I create some > script which just repeats the functionality of dovecot's configured > mail_home resolution?Arghhh, never mind, it seems switch -m does this :) However this is not documented in the man page, I just discovered because "doveadm user" (without user name) lists that, and I tried out what it does ...
Steffen Kaiser
2013-Jan-09 09:30 UTC
[Dovecot] How to get effective user information (was Re: question on "doveadm user" and pass/userdb)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wed, 12 Sep 2012, G?bor L?n?rt wrote: Below, there is a similiar question, with identical prerequisites. Is there a way to get the "effective" information about an user with all default values? For instance, I get: # /usr/local/dovecot-2.1.12/bin/doveadm user dvtest1 userdb: dvtest1 home : /home/dvtest1 quota_rule: *:bytes=7721225472 quota_rule2: Trash:bytes=+7745728 # /usr/local/dovecot-2.1.12/bin/doveadm user dvtest2 userdb: dvtest2 home : /home/dvtest2 quota_rule: *:bytes=307200 quota_rule2: Trash:bytes=+30720 # /usr/local/dovecot-2.1.12/bin/doveadm user -m dvtest1 field value uid vmail gid vmail home /home/dvtest1 mail dvtest1 has quota_rule and quota_rule2 in LDAP, dvtest2 has not, but defaults are shown. Neither of them shows the default mail_location in "user -m", but the default uid/gid vmail/vmail. Using IMAP a.s.o. both users work correctly. Is there a "user -m" variant on the userdb socket? Via socket I get: USER 1 dvtest1 home=/home/dvtest1 quota_rule=*:bytes=7721225472 quota_rule2=Trash:bytes=+7745728 Looking into doveadm-auth.c, the paths of "user" and "user -m" are quite different, so I guess not. ==========> I'm about getting to know dovecot in details, I am about the command > "doveadm user". The man page shows this example: > > userdb: jane > uid : 8001 > gid : 8001 > home : /home/jane > mail : sdbox:~/sdbox > plugins : sieve > quota_rule: *:storage=150M > > What I guess that the lack of extra information (which would be needed by > some scripts of mine, eg for getting user's home easily from shell scripts, > as it's hash based, etc) is caused because I don't pass home (and/or other > settings) back from userdb and/or passdb. > > However I do have these in global scope: > > mail_home = /mailstorage/%Ld/%Ln > (yes, this is not hashed at all at the momement but it will be soon) > mail_location = maildir:~/Maildir > mail_uid = vmail > mail_gid = vmail > (... and also some global quota stuffs configured in plugin section) > > Now, I am a bit confused: even with passdb/userdb does not return with user > home or GID/UID, dovecot knows these in case of pop3/imap/lmtp access, since > these information can be "composed" from those settings. > > But then, wouldn't it possible so "doveadm user" shows those as well, like > lmtp/pop3/imap can resolve those too? > > If I interpret "doveadm user"'s goal wrong (it's just for userdb/passdb > query tool nothing more), is there any tool which works in this config, > displaying extra information (at least user's home), or should I create some > script which just repeats the functionality of dovecot's configured > mail_home resolution?- -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEVAwUBUO04pmoxLS8a3A9mAQKswQf8DWfTg76rmpRUXu9LvlvBDWakZGPYol+N LM/6Hk2Nms5oXTe+qVB3l0Mr/1JKP0iDQESMHyZqI/ARdUO8siaiqxRT7tkMP0ID S6omoKcrRB6eAEMPiDM6nKnwx0oPaJkX4dJrwUYTuxQE92li2wvQJoQa4YycwEWI mRmRbwd6FRzq3fQO/9pKHHxR0hBkt6HWDk14HrxLzGag2oKye2FaqThJ1tTFvV0G 2/Ci9lkWkM4+7qShIz4THmlij39wZfwqzKQkYRcNO21y2jxD4UV4BoqMjRvmvf/V nRcJv770lWrV2aJ5lpE/uLX8TnrHO4fpvYek5Usucg523faSdLNIRA==gwtk -----END PGP SIGNATURE-----
Timo Sirainen
2013-Jan-09 09:35 UTC
[Dovecot] How to get effective user information (was Re: question on "doveadm user" and pass/userdb)
On 9.1.2013, at 11.30, Steffen Kaiser <skdovecot at smail.inf.fh-brs.de> wrote:> Is there a way to get the "effective" information about an user with all default values? For instance, I get: > > # /usr/local/dovecot-2.1.12/bin/doveadm user dvtest1 > userdb: dvtest1 > home : /home/dvtest1 > quota_rule: *:bytes=7721225472 > quota_rule2: Trash:bytes=+7745728 > # /usr/local/dovecot-2.1.12/bin/doveadm user -m dvtest1 > field value > uid vmail > gid vmail > home /home/dvtest1 > mail > > dvtest1 has quota_rule and quota_rule2 in LDAP, dvtest2 has not, but defaults are shown. Neither of them shows the default mail_location in "user -m", but the default uid/gid vmail/vmail. Using IMAP a.s.o. both users work correctly.v2.2 does it by default: # doveadm user tss field value uid 1000 gid 1000 home /home/tss mail mdbox:~/mdbox mail_replica ssh:foo
Steffen Kaiser
2013-Jan-09 15:06 UTC
[Dovecot] How to get effective user information (was Re: question on "doveadm user" and pass/userdb)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wed, 9 Jan 2013, Timo Sirainen wrote:>> Is there a way to get the "effective" information about an user with all default values? For instance, I get: >> >> # /usr/local/dovecot-2.1.12/bin/doveadm user dvtest1 >> userdb: dvtest1 >> home : /home/dvtest1 >> quota_rule: *:bytes=7721225472 >> quota_rule2: Trash:bytes=+7745728 >> # /usr/local/dovecot-2.1.12/bin/doveadm user -m dvtest1 >> field value >> uid vmail >> gid vmail >> home /home/dvtest1 >> mail >> >> dvtest1 has quota_rule and quota_rule2 in LDAP, dvtest2 has not, but defaults are shown. Neither of them shows the default mail_location in "user -m", but the default uid/gid vmail/vmail. Using IMAP a.s.o. both users work correctly. > > v2.2 does it by default: > > # doveadm user tss > field value > uid 1000 > gid 1000 > home /home/tss > mail mdbox:~/mdbox > mail_replica ssh:fooAh, that works. The doveadm server socket does not provide the "user" command neiter in Dovecot v2.1 nor v2.2, does it? Is it only because, doveadm_register_auth_commands() is never called, or would the "user" command not work in the doveadm server, but in the doveadm program only? I already query the doveadm socket for the quota information and it would make the script easier to get the user information the same way. - -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEVAwUBUO2HamoxLS8a3A9mAQLd/gf7B/cqFDUslt1skhvPhTYbh0vUgqNfFRPH B9dvlKS6o0mH83Jfmoghq74IxCG6zB2dq0lCFQUVpMb+X2HLHVnPAye2AYBYGxji S+YnWaU8i45ooiXoJyY3C19/o/YENRDC5IjLZgFIBMLbWkSbMPIOgE0Tk2H1r3hv vf1kr7QSUs5fMPNlWLi99MQcG/yHByU8BC/51nvy52Twc0O+dWKDvqPzyiETKXut BA3qTtqTyJdpILJ9QFTbfZIxeoB9sqb9fODyWa3NQQeebKyG8wAYnO4hsFtZT6Sg d/1ZOGgeE73DOvjtTQ1pHSfxp2/evOe5V2q+AKYasIF0iNVF57KenQ==7qv2 -----END PGP SIGNATURE-----
Timo Sirainen
2013-Jan-22 12:11 UTC
[Dovecot] How to get effective user information (was Re: question on "doveadm user" and pass/userdb)
On 9.1.2013, at 17.06, Steffen Kaiser <skdovecot at smail.inf.fh-brs.de> wrote:> The doveadm server socket does not provide the "user" command neiter in > Dovecot v2.1 nor v2.2, does it? > > Is it only because, doveadm_register_auth_commands() is never called, or would the "user" command not work in the doveadm server, but in the doveadm program only? I already query the doveadm socket for the quota information and it would make the script easier to get the user information the same way.Currently doveadm-server works only for "mail" commands (since those are the ones that often need to support automatic proxying to another server). I guess it could be extended for other commands also, but that would require some work..