[Dovecot] How to get effective user information (was Re: question on "doveadm user" and pass/userdb)

Steffen Kaiser skdovecot at smail.inf.fh-brs.de
Wed Jan 9 11:30:13 EET 2013


-----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-----


More information about the dovecot mailing list