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
Jan-Frode Myklebust writes:> 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 ?I coundn't find any, so I wrote my own executable cron job that scans the index cache and checks if the corresponding mailbox exists. If not, it echo the commands to remove the stale indices. From there, you can review it, or pipe it into sh. I can post it if there's any interest, but it's not that hard to write. This is only necessary, of course, if you store the indices in a different place than the mail folder. Joseph Tam <jtam.home at gmail.com>
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.