[Dovecot] Change mail_location for one user?
Hello, I'm running the latest version of dovecot on Linux with mbox mailboxes. Everything works fine. So in my dovecot config I have mail_location = mbox:~/mail:INBOX=/var/mail/%u
I would like to now change the mail_location for one user in an attempt to slowly migrate to Maildir format. I'm confused how to do this. I'm running shadow passwords:
$: doveconf -n passdb passdb { driver = shadow }
Testing any given user gives: $: dovecot user sarah field value uid 1478 gid 116 home /home/sarah mail mbox:~/mail:INBOX=/var/mail/sarah system_groups_user sarah
What would I have to do to make only sarah's mail_location ~/Maildir now? My userdb is: $: doveconf -n userdb userdb { driver = passwd }
I tried following the wiki's but its confusing. Thanks for any help or tips.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thu, 12 Sep 2013, Scott Galambos wrote:
Testing any given user gives: $: dovecot user sarah field value uid 1478 gid 116 home /home/sarah mail mbox:~/mail:INBOX=/var/mail/sarah system_groups_user sarah
What would I have to do to make only sarah's mail_location ~/Maildir now? My userdb is: $: doveconf -n userdb userdb { driver = passwd }
I tried following the wiki's but its confusing. Thanks for any help or tips.
you need to pass "Extra Fields" to Dovecot, see last example in: http://wiki2.dovecot.org/UserDatabase/ExtraFields
"passwd-file" is similiar to "passwd", but I don't know, if you break something (outside Dovecot), if you add the last field to /etc/passwd.
Because Dovecot supports multiple userdb's, you could add a passwd-file userdb _before_ passwd userdb, copy the line of sarah from /etc/passwd into that new file and add the extra fields there. See http://wiki2.dovecot.org/AuthDatabase/PasswdFile
userdb { driver = passwd-file args = username_format=%n /etc/dovecot/imap.passwd } userdb { driver = passwd }
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUjKzbV3r2wJMiz2NAQLvFAgAt7qRAZjJOoIUI2hDOKmjGHFnWZECTwDB W6bFT9PMw7rwcBSIWAzUkYO1lJeOuuOQrlSyw21g1AA+WQJ3Vb9Ti+T8HNJJb4A3 COZ14e0HXBEn2WFftmYVeLS6Okp70tuJ8g8dUYSnd+e+OFTy9iPYbk08+IOk9j+v lSPLcrGiKewuzoSBqHzQmY5iL2rb1AZaUHFH2geNUF2AvvRvnvnjvKQ1oJBHHLXz rbCZdIVhG1Q+9WfMsxvAX9VZsJ+lcDmpHPCEciU30frfCJQdaxjsam+iBGyHSIo5 ZxkGsDGQ/Ta6CBdSX5Ii01IXQ0C6ZRpZheYPBPITdHjD+ZuO5McZrA== =qG6G -----END PGP SIGNATURE-----
I tried something similar already.
passdb { driver = shadow }
userdb { driver = passwd-file args = username_format=%n /path/to/passwd }
With only the one sarah user defined in /path/to/passwd. But then all other users cannot log in anymore. Thunderbird says "Sending of password did not succeed". Does anyone know if specifying a userdb stops passdb/shadow from being used? Do I need to copy all users from the passdb/shadow system to /path/to/passwd? Was hoping to just specify single users I wanted to override in /path/to/passwd.
On 9/13/2013 2:40 AM, Steffen Kaiser wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thu, 12 Sep 2013, Scott Galambos wrote:
Testing any given user gives: $: dovecot user sarah field value uid 1478 gid 116 home /home/sarah mail mbox:~/mail:INBOX=/var/mail/sarah system_groups_user sarah
What would I have to do to make only sarah's mail_location ~/Maildir now? My userdb is: $: doveconf -n userdb userdb { driver = passwd }
I tried following the wiki's but its confusing. Thanks for any help or tips.
you need to pass "Extra Fields" to Dovecot, see last example in: http://wiki2.dovecot.org/UserDatabase/ExtraFields
"passwd-file" is similiar to "passwd", but I don't know, if you break something (outside Dovecot), if you add the last field to /etc/passwd.
Because Dovecot supports multiple userdb's, you could add a passwd-file userdb _before_ passwd userdb, copy the line of sarah from /etc/passwd into that new file and add the extra fields there. See http://wiki2.dovecot.org/AuthDatabase/PasswdFile
userdb { driver = passwd-file args = username_format=%n /etc/dovecot/imap.passwd } userdb { driver = passwd }
- -- Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUjKzbV3r2wJMiz2NAQLvFAgAt7qRAZjJOoIUI2hDOKmjGHFnWZECTwDB W6bFT9PMw7rwcBSIWAzUkYO1lJeOuuOQrlSyw21g1AA+WQJ3Vb9Ti+T8HNJJb4A3 COZ14e0HXBEn2WFftmYVeLS6Okp70tuJ8g8dUYSnd+e+OFTy9iPYbk08+IOk9j+v lSPLcrGiKewuzoSBqHzQmY5iL2rb1AZaUHFH2geNUF2AvvRvnvnjvKQ1oJBHHLXz rbCZdIVhG1Q+9WfMsxvAX9VZsJ+lcDmpHPCEciU30frfCJQdaxjsam+iBGyHSIo5 ZxkGsDGQ/Ta6CBdSX5Ii01IXQ0C6ZRpZheYPBPITdHjD+ZuO5McZrA== =qG6G -----END PGP SIGNATURE-----
Top-posting fixed. On Fri, Sep 13, 2013 at 03:15:15AM -0400, Scott Galambos wrote:
On 9/13/2013 2:40 AM, Steffen Kaiser wrote:
On Thu, 12 Sep 2013, Scott Galambos wrote:
What would I have to do to make only sarah's mail_location ~/Maildir now? My userdb is: $: doveconf -n userdb userdb { driver = passwd }
you need to pass "Extra Fields" to Dovecot, see last example in: http://wiki2.dovecot.org/UserDatabase/ExtraFields
"passwd-file" is similiar to "passwd", but I don't know, if you break something (outside Dovecot), if you add the last field to /etc/passwd.
Because Dovecot supports multiple userdb's, you could add a
Reread that: _multiple_ means "more than one."
passwd-file userdb _before_ passwd userdb, copy the line of sarah from /etc/passwd into that new file and add the extra fields there. See http://wiki2.dovecot.org/AuthDatabase/PasswdFile
userdb { driver = passwd-file args = username_format=%n /etc/dovecot/imap.passwd } userdb { driver = passwd }
I tried something similar already.
Close, but not the same. Look back at Steffen's post. There are TWO userdb definitions. Do it that way and all is well. He answered you completely.
passdb { driver = shadow }
userdb { driver = passwd-file args = username_format=%n /path/to/passwd }
With only the one sarah user defined in /path/to/passwd. But then all other users cannot log in anymore.
Only one user had a userdb entry. If you specify a userdb, the built-in defaults do not apply.
Thunderbird says "Sending of password did not succeed". Does anyone know if specifying a userdb stops passdb/shadow from being used? Do I need to copy all users from the passdb/shadow system to /path/to/passwd? Was hoping to just specify single users I wanted to override in /path/to/passwd.
http://rob0.nodns4.us/ -- system administration and consulting Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:
On 2013-09-13 2:40 AM, Steffen Kaiser <skdovecot@smail.inf.fh-brs.de> wrote:
Because Dovecot supports multiple userdb's, you could add a passwd-file userdb _before_ passwd userdb, copy the line of sarah from /etc/passwd into that new file and add the extra fields there. See http://wiki2.dovecot.org/AuthDatabase/PasswdFile
userdb { driver = passwd-file args = username_format=%n /etc/dovecot/imap.passwd } userdb { driver = passwd }
This looks very interesting to me...
I've been contemplating slowly converting users (one at a time) over to SIS storage - looks like this would work for doing that too?
The main thing holding me back is/was the MySQL DB I use for userdb doesn't natively/easily support extra fields - so, with this method, I could add a passwd-file userdb with the extra field(s) *before* my passwd userdb, then add the users to convert one by one, then once all are converted, change the main config and eliminate the temporary userdb... ?
Thanks!
--
Best regards,
*/Charles/*
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Charles Marcus wrote:
On 2013-09-13 2:40 AM, Steffen Kaiser <skdovecot@smail.inf.fh-brs.de> wrote:
Because Dovecot supports multiple userdb's, you could add a passwd-file userdb _before_ passwd userdb, copy the line of sarah from /etc/passwd into that new file and add the extra fields there. See http://wiki2.dovecot.org/AuthDatabase/PasswdFile
userdb { driver = passwd-file args = username_format=%n /etc/dovecot/imap.passwd } userdb { driver = passwd }
This looks very interesting to me...
I've been contemplating slowly converting users (one at a time) over to SIS storage - looks like this would work for doing that too?
The main thing holding me back is/was the MySQL DB I use for userdb doesn't natively/easily support extra fields - so, with this method, I could add a passwd-file userdb with the extra field(s) *before* my passwd userdb, then add the users to convert one by one, then once all are converted, change the main config and eliminate the temporary userdb... ?
You can do so. Dovecot really does not care where the user data comes from.
But, I wonder why you would need the extra DB with mySQL.
a) You can add new fields to the DB on the fly at runtime and adjust the query in Dovecot and reload.
b) http://wiki2.dovecot.org/UserDatabase/ExtraFields; make use of "userdb_import" - generic field with <TAB> delimited settings.
Steffen -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) Comment: Using GnuPG with undefined - http://www.enigmail.net/
iQEVAwUBUjNptV3r2wJMiz2NAQJkhwf+N/nOtUb+9UtwvtF4evMvnHkfv1Ciw6c8 QLKgJV/+QoOpUiM+YVbzFCAWfofL4sTOqoV+G/s9c5RKDbCwDn/MbgP1hQ+TRx0h vE+lL0RbTTdkRGUCoOkuA6BIggPdfp4VmNZLlOsXldfjnhZ8r76NNKko5wzRdp7K oSdt3XEE2wg9+hrCq4IYLSG2rN8rnklaY0v1A38oO75Xx0i3XDxQnkxvtlsvFJ8k X4L829hIrZ7+MIo4M6qFd01Ef7xP/oBYFEMW7ByEZs92ERJiM8WrB2h31U5VhFEY iBYwiabjcXAhNheK98RZvKiIH7DYzOZXvfd7GGLdGEsZ1qfcLOt8Aw== =oRmK -----END PGP SIGNATURE-----
On 9/13/2013 2:40 AM, Steffen Kaiser wrote:
-----BEGIN PGP SIGNED MESSAGE----- "passwd-file" is similiar to "passwd", but I don't know, if you break something (outside Dovecot), if you add the last field to /etc/passwd.
Because Dovecot supports multiple userdb's, you could add a passwd-file userdb _before_ passwd userdb, copy the line of sarah from /etc/passwd into that new file and add the extra fields there. See http://wiki2.dovecot.org/AuthDatabase/PasswdFile
userdb { driver = passwd-file args = username_format=%n /etc/dovecot/imap.passwd } userdb { driver = passwd }
This works. But I noticed when I do use it to override mail_location dovecot doesn't report system_groups_user anymore. Not sure if that matters....
$: dovecot user sarah field value uid 1403 gid 101 home /home/sarah mail mbox:~/mail:INBOX=/var/mail/sarah system_groups_user sarah
Now I add to imap.passwd: sarah::1403:101::/home/sarah::userdb_mail=maildir:~/Maildir
$: dovecot user sarah field value uid 1403 gid 101 home /home/sarah mail maildir:~/Maildir $:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Scott Galambos wrote:
On 9/13/2013 2:40 AM, Steffen Kaiser wrote:
-----BEGIN PGP SIGNED MESSAGE----- "passwd-file" is similiar to "passwd", but I don't know, if you break something (outside Dovecot), if you add the last field to /etc/passwd.
Because Dovecot supports multiple userdb's, you could add a passwd-file userdb _before_ passwd userdb, copy the line of sarah from /etc/passwd into that new file and add the extra fields there. See http://wiki2.dovecot.org/AuthDatabase/PasswdFile
userdb { driver = passwd-file args = username_format=%n /etc/dovecot/imap.passwd } userdb { driver = passwd }
This works. But I noticed when I do use it to override mail_location dovecot doesn't report system_groups_user anymore. Not sure if that matters....
$: dovecot user sarah field value uid 1403 gid 101 home /home/sarah mail mbox:~/mail:INBOX=/var/mail/sarah system_groups_user sarah
Now I add to imap.passwd: sarah::1403:101::/home/sarah::userdb_mail=maildir:~/Maildir
$: dovecot user sarah field value uid 1403 gid 101 home /home/sarah mail maildir:~/Maildir $:
see http://wiki2.dovecot.org/UserDatabase/ExtraFields first section "A user database lookup typically returns uid, gid, home and mail fields. Other possibilities are:"
/etc/groups won't be queried now, because of the different driver.
Steffen -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) Comment: Using GnuPG with undefined - http://www.enigmail.net/
iQEVAwUBUja7eF3r2wJMiz2NAQIU6Af7BIyZauXNgdFTO0lr899d+8AftQF4pEi8 J11k3Zw2Bn74IPYymbD//ORcboRqUxBK6BJjtcJoGf67KarOd+1Bi5CsOtbLZe/2 a4+f0jRjbsdTahkCBeVIpdEQhb92YMQHfq8XGbfpYaSfWN/Nq3fIyvrmB66OohRg yt2QSm2uwP4YormgGQ/0Yi/T4opP2dLrV86HN92gvb3NRhEEfWpSKoWScw0HRMMR uS3WIPoWC930YNeL6TB5sSTO6jJmPS7W2V/T1XbicCSO+gAlosm0y+WNuaz3EPx6 g2Ih3tmzayCWtlCobLVf8wAkdqrEEUoYeclbTvyeDK90sUwuqdTvxA== =COLU -----END PGP SIGNATURE-----
participants (5)
-
/dev/rob0
-
Charles Marcus
-
Scott Galambos
-
Steffen
-
Steffen Kaiser