Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
I
ISPConfig 3
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 479
    • Issues 479
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 22
    • Merge Requests 22
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • ISPConfig
  • ISPConfig 3
  • Issues
  • #5361

Closed
Open
Opened Aug 02, 2019 by The Real Kinetix@realkinetix

Dovecot mail user deletion requires more actions prior to deleting user

If one has single instance storage enabled in dovecot, in particular a separate attachments dir, then if users mail isn't purged appropriately prior to deleting a mail user, their attachments will wind up orphaned in the attachments store.

A side discussion on this on the dovecot users lists can be found here: https://dovecot.org/list/dovecot/2015-February/099655.html

What it boils down to is simply running the following 2 commands prior to doing any mail user deletion:

doveadm expunge -d -u johndoe mailbox '*' all
doveadm -v purge -u johndoe 

The single instance storage is a wonderful feature and very simple to enable/utilize - all I did in my dovecot configuration was add in:

mail_attachment_dir = /var/vmail/attachments
mail_attachment_min_size = 128k
mail_attachment_fs = sis posix
mail_attachment_hash = %{sha256}

I am using mdbox for the rest of the mail storage format.

I have tested the expunge & purge commands above and they do work as advertised, mail and attachments were cleaned up & storage space returned.

I believe that, to implement a fix for this feature appropriately, the deletion portion of user_update would need to be fixed to incorporate this as well.

As an aside - if I were to hack the appropriate commands in locally (in 3.1.14p1 with p2 patch), I presume I might add them near the top of function user_delete in server/plugins-available/mail_plugin.inc.php? I am about to test with inserted lines 452 + 453:

exec("su -c 'doveadm expunge -d -u \"".$data["old"]["email"]."\" \'*\' all'");
exec("su -c 'doveadm -v purge -u \"".$data["old"]["email"]."\" '");

(This didn't work on my first test... I've added debug logging statements after each exec and those did show, so I have more testing to do...)

Edited Aug 02, 2019 by The Real Kinetix
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ispconfig/ispconfig3#5361