Getting deleted mail back

Mail deleted by mistake can be got back for a window the organisation sets, and Trash and Junk empty themselves.

When somebody deletes a message for good, emptying it from Trash or deleting it in a mail app that skips Trash, it is not gone at once. It waits for 14 days, the organisation’s window. Within that window the person, or an administrator for them, can put it back. Trash and Junk also empty themselves after 30 days, so they don’t grow forever.

The examples use the vsx shell function from the Quick start.

What can be got back

Mail taken out of the last folder its holder sees can be got back:

  • emptied from Trash, or deleted for good, over IMAP;
  • destroyed over JMAP;
  • deleted over POP3;
  • inside a folder that was deleted with its mail.

It waits where no mail app shows it, and still counts toward the person’s mailbox size until the window ends. Put back, a message returns to the folder it was deleted from, or to the Inbox if that folder is gone, as a message nobody has deleted.

Some things are removed for good straight away, because the server does it on purpose:

Getting it back

People themselves. Nixt Mail offers Recover items deleted from Trash. Other JMAP apps can do the same through the JMAP recoverable mail extension. People see what they deleted, newest first, with who each message is from, its subject, and when and from which folder it was deleted. They can search it and put back what they choose. Only the account’s owner gets their deleted mail back this way: a delegate reading somebody else’s mail cannot.

Administrators, for somebody. On the console, open the person from People. The Deleted mail card lists what can be got back, by sender and subject only, never what the messages say, and Put back restores it. From the command line:

vsx admin mailbox recoverable ada@example.com --search invoice
vsx admin mailbox recover ada@example.com 3 4

recoverable numbers what it lists, and recover takes those numbers. It also takes --from YYYY-MM-DD for mail deleted since a day, and --limit for how many to list.

Organisation administrators and helpdesks can do this for anybody, and a domain administrator for the people in their domains. An auditor can see the list and restore nothing. Every restore is in the audit log.

The organisation’s settings

On the console, Settings has a Deleted mail, Trash and Junk card. From the command line:

vsx admin org deleted-mail --keep 14 --trash 30 --junk 30
SettingDefaultWhat it does
--keep14 daysHow long deleted mail can be got back. off removes deleted mail for good at once. That is the less safe choice: a mistake can then only be undone from a backup.
--trash30 daysMail in Trash longer than this is deleted, and can then be got back for the --keep window. never keeps Trash until people empty it.
--junk30 daysThe same for Junk.

These are the organisation’s settings. People have no setting of their own that makes any of them longer.

A mailbox on legal hold keeps its deleted mail after the window ends. The person can no longer get it back, but the hold keeps it.

Over the API

RouteWhat it does
GET /api/v1/tenants/{tenant}/accounts/{id}/recoverableWhat the person deleted that can be got back, by headers, newest first.
POST /api/v1/tenants/{tenant}/accounts/{id}/recoverable/restorePuts back the messages named.

Something unclear or out of date on this page? Tell us.