more info about deleting users

Michael Orlitzky michael at orlitzky.com
Mon May 2 16:44:13 UTC 2016


On 05/02/2016 03:19 AM, Steffen Kaiser wrote:
> On Mon, 2 May 2016, Tom Sommer wrote:
>> On 2016-04-29 16:25, Matteo Gaito Test Account wrote:
> 
> 
> In fact, I would like to have:
> 
> + full user backup
> + full user removal
> + restore of backup'ed user
> 
> incl. all data, Dovecot creates / maintains by itself, such as Quota, 
> ACLs (of deleted user to other mailboxes), messages and all settings of 
> mailboxes, indexes etc.pp.
> 

You also need to delete any aliases that are associated with that user
in your MTA. And any contacts associated with that address in your
webmail/CardDAV system. And any calendars associated with it in your
CalDAV system. And so on.

Moreover, unless you plan to give root CLI access to your support
people, there needs to be a way to figure out who was removed from SQL
and then perform the necessary cleanup (as root) later on.

I solved this for my own exact use case with mailshears:

  http://michael.orlitzky.com/code/mailshears.php

If you use Dovecot with the PostfixAdmin schema in PostgreSQL, and your
filesystem layout is <domain>/<user>, then it will work for you
out-of-the-box. It also supports Roundcube, AgenDAV, and DAViCal.

Any user accounts for Dovecot, Postfix, AgenDAV, DAViCal, or Roundcube
can be,

  * Pruned (cleaned up after someone removes them from PostfixAdmin).
  * Removed directly.
  * And even renamed! Yes, this works:

    # mailshears mv michael at orlitzky.com mjo at orlitzky.com

There are examples of everything in the man page.

Like I said, right now it's tailored exactly for my mail system. But,
everything is well-designed and implemented by plugins. If you want to
support LDAP or anything else, it can probably be done with a plugin.

I would also happily accept patches for MySQL support, or to make the
filesystem layout configurable, or anything like that.


More information about the dovecot mailing list