Restoring Messages Deleted by a User
The trash is called "double-bottomed": it offers a delay during which deleted emails are kept. During that time, users are able to recover messages directly from their BlueMind messaging system or their Outlook client (Mapi-based), or the administrator can recover them from the server using command line. This page presents the administrator procedure.
Setting up retention time
By default, the delay between an expunge
command and the unexpunge
recovery is 7 days.
To change it :
- go to System Configuration > Mail > Retention
- enter the number of days in the "Retention time for e-mails to be purged" field.
For more information, see the page System Configuration.
Procedure
When an email is deleted by the user, the BlueMind mail server does not immediately delete the message: the message is marked as deleted and is no longer available, but the file is retained.
The double-bottomed bin does not handle folder hierarchy. When a folder is permanently deleted, the messages are recoverable, but the folder itself is not. It is not possible to retrieve a folder structure.
IMAP clients can execute the "expunge" command to initiate immediate deletion of messages (via the "empty trash" option, for example), but here too, the mail server is able to add a delay between the moment the user requests expunge and the actual final deletion of the message on the server.
Thus, the bm-cli unexpunge
command allows you to recover messages during this period:
bm-cli mail unexpunge
Restoring a user's messages
The user John Doe (ID: jdoe@bluemind.loc) wants to recover the emails deleted in the past two days. You can use the following command:
#> bm-cli mail unexpunge --days 2 jdoe@bluemind.loc
Folder has 1 deleted message(s)
Recovering messages less than 2 day(s) old
+-----+---------+---------+------------------------------+
| id | subject | preview | last-modification |
+-----+---------+---------+------------------------------+
| 406 | Contact | Boss | Mon Jan 18 11:36:54 GMT 2021 |
+-----+---------+---------+------------------------------+
Checked 1 deleted item(s), will restore 1 item(s)
Restoring messages from a shared mailbox
To restore messages from a shared mailbox, you must log in as a user with permission to write on that mailbox. Then add the authn
parameter to the command.
Example: you want to restore the messages deleted since yesterday in the Contact mailbox (contact@bluemind.loc) which John Doe has permission to manage:
#> bm-cli mail unexpunge --days 1 --authn jdoe@bluemind.loc contact@bluemind.loc
Folder has 1 deleted message(s)
Recovering messages less than 1 day(s)) old
+-----+---------+---------+------------------------------+
| id | subject | preview | last-modification |
+-----+---------+---------+------------------------------+
| 203 | Coucou | XMen | Tue Jan 19 15:22:34 GMT 2021 |
+-----+---------+---------+------------------------------+
Checked 1 deleted item(s), will restore 1 item(s)
Available options
You can use several parameters to make a more specific recovery:
days
: the number of days to restoredry
: tests the command without actually executing the recoveryfolder
: specify a particular directoryid
: the id of a specific message
For more details on available options and how to use them, use the bm-cli command line help:
# bm-cli mail help unexpunge