Is there a way to trigger a mailbox snapshot when a user account is deleted (Linux installation)?
Question asked by Craig Edmonds - 3/4/2026 at 1:59 PM
Unanswered
Hello everyone,

We are currently running SmarterMail on a Linux server and have recently completed a migration from another hosted mail provider (Rackspace).

Our infrastructure includes a daily off-server backup system that snapshots the entire SmarterMail data directory (/var/lib/smartermail) using rsync to a remote storage server. This works well for general recovery scenarios and we created a GREAT little bash script for historical restores.

However, one feature we previously relied on with another provider was the ability to restore a mailbox that had been deleted accidentally. In practice this meant that when an account was removed, the system retained a recoverable copy of the mailbox for a period of time (14 days).

What I am trying to determine is whether SmarterMail has any mechanism (or extension point) that would allow something similar on Linux.

Specifically:

When a user account is deleted from the SmarterMail administration interface, is there any way to trigger a script or event that could:

• Capture a snapshot of the mailbox directory for that user
• Store it in a temporary archive location
• Allow administrators to restore it later if required

For context, mailboxes are stored under:

/var/lib/smartermail/Domains/{domain}/Users/{user}

So the goal would be something like:

  1. User deletion initiated in the control panel
  2. A hook or event fires
  3. The mailbox directory is archived before removal
I realise that daily backups already provide a recovery option, but a pre-deletion snapshot would make accidental user deletion much easier to recover from without needing to search historical backups.

If there is:

• a built-in feature for this
• an event hook / plugin system
• or a recommended best practice for Linux deployments

I would appreciate any guidance.

Thanks in advance.
Derek Curtis Replied
Employee Post
There's nothing within SmarterMail itself that does this, but I'd imagine you could use an Event to call a webhook. I'm not sure what that would necessarily look like as I'm not a programmer (I'm a "recovering programmer") but the Event system is a definite option.

Another option may be the Archiving feature. It's a bit more labor-intensive, but it could work in those instances where an account is deleted by accident as it archives everything. 

Another option is more of a business rule: don't immediately delete mailboxes. Disable them for a period of time (a day, a few days, a week, etc.) before they're deleted. 

Finally, I changed this Thread to a Question so, if someone has a solution, we can mark it as "Answered" for other users. 
Derek Curtis CCO SmarterTools Inc. www.smartertools.com
J. LaDow Replied
We lock/disable accounts for 30 days instead of deleting - then after no activity or data requests, we send one last notification to the requesting party before finally performing data removal.
MailEnable survivor / convert --
Jay Dubb Replied
+1 for disabling, pending deletion.  We run 30 days on disabled before removing.  That has saved us from having to scrounge from backups when managers or directors realize they actually did want something from a terminated employee's mailbox after all.  
 
Nathan Replied
Maybe have an integrated delayed delete feature?

Reply to Thread

Enter the verification text