[Dovecot] doveadm delete-user ?
IMHO it would be great if we could both provision and un-provision users without having the provisioning system mess with files in the filesystem. Provisioning new users works fine since dovecot will create all files/directories on first login, but I haven´t found the tools to un-provison them. I see "doveadm mailbox delete" can delete individual mailboxes, but what about indexes, sieve-scripts and home-directories? Are there any tools to clean out these ?
-jf
On Wed, 2011-11-02 at 09:57 +0100, Jan-Frode Myklebust wrote:
IMHO it would be great if we could both provision and un-provision users without having the provisioning system mess with files in the filesystem. Provisioning new users works fine since dovecot will create all files/directories on first login, but I haven´t found the tools to un-provison them. I see "doveadm mailbox delete" can delete individual mailboxes, but what about indexes, sieve-scripts and home-directories? Are there any tools to clean out these ?
Do you have all of those files in separate directories? Normally I'd think everything is under home dir, so you can just:
rm -rf doveadm user -f home $username
For deleting indexes and other dirs that are not under home.. well.. I guess you'll need some more scripting.
Anyway, I don't think there's any good and safe way to just go delete user's directories. Especially home dir.
On Fri, Nov 04, 2011 at 10:41:26PM +0200, Timo Sirainen wrote:
On Wed, 2011-11-02 at 09:57 +0100, Jan-Frode Myklebust wrote:
IMHO it would be great if we could both provision and un-provision users without having the provisioning system mess with files in the filesystem. Provisioning new users works fine since dovecot will create all files/directories on first login, but I haven´t found the tools to un-provison them. I see "doveadm mailbox delete" can delete individual mailboxes, but what about indexes, sieve-scripts and home-directories? Are there any tools to clean out these ?
Do you have all of those files in separate directories? Normally I'd think everything is under home dir, so you can just:
Unfortunately, for historical reasons, yes. The users doesn't have a home-directory, or the inbox is directly in their home.. so I don't think sieve fits there, and indexes are kept elsewhere for performance reasons.
rm -rf
doveadm user -f home $username
Ah, great. Looking up the home dir via doveadm helps.
For deleting indexes and other dirs that are not under home.. well.. I guess you'll need some more scripting.
What happens to the indexes when we delete the mailboxes via "doveadm mailbox delete" ? Will that clean up the indexes ?
-jf
On Fri, 2011-11-04 at 22:19 +0100, Jan-Frode Myklebust wrote:
For deleting indexes and other dirs that are not under home.. well.. I guess you'll need some more scripting.
What happens to the indexes when we delete the mailboxes via "doveadm mailbox delete" ? Will that clean up the indexes ?
Yes. So you could create a script that lists all mailboxes, deletes them and then rmdirs the index root dir.
participants (2)
-
Jan-Frode Myklebust
-
Timo Sirainen