UNEXPUNGE(8)

πŸ’– UNEXPUNGE(8) πŸ’–

okay bestie, listen up β€” this is unexpunge, a Cyrus IMAP joint, and it's literally here to save you when someone (or honestly, you) deleted the wrong emails. No cap. 🫢


✨ NAME ✨

unexpunge β€” Cyrus IMAP documentation

Recover messages the user has (accidentally) deleted. πŸ’€βž‘οΈπŸ’–


🌸 SYNOPSIS 🌸

unexpunge [ -C config-file ] -l mailbox [ uid... ]
unexpunge [ -C config-file ] -t time-interval [ -d ] [ -v ] [ -f flagname ] mailbox
unexpunge [ -C config-file ] -a [ -d ] [ -v ] [ -f flagname ] mailbox
unexpunge [ -C config-file ] -u [ -d ] [ -v ] [ -f flagname ] mailbox uid...

four whole ways to run it, pick your fighter πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

So the unexpunge program is the one that lists or restores messages that have been deleted from a mailbox but are still, like, physically chilling in the Cyrus IMAP mail spool. They're not gone gone, they're just in their deleted era. 😭

vibe check tho: this utility is only useful when the server is configured with expunge_mode set to delayed in its configuration file. If it's not set to delayed, bestie, there's nothing to recover. Periodt.

unexpunge reads its configuration options out of the imapd.conf(5) file unless you say otherwise with -C. πŸŽ€


πŸ’… OPTIONS πŸ’…

  • -C config-file β€” use the specified configuration file config-file instead of the default imapd.conf(5). your config, your rules.
  • -l, --list β€” list the expunged messages in the specified mailbox that are available for restoration. Optionally, only list the messages in the mailbox matching the UIDs in the space-separated list at the end of the command invocation. window shopping for emails πŸ‘€
  • -t time-interval, --within-time-interval=time-interval β€” unexpunge messages which were expunged within the last time-interval seconds. Use one of the trailing modifiers β€” m (minutes), h (hours), d (days) or w (weeks) β€” to specify a different time unit. time math but make it cute ⏰
  • -a, --all β€” restore all of the expunged messages in the specified mailbox. the everything button
  • -u, --uids β€” restore only messages matching the UIDs, in a space-separated list at the end of the command invocation, in the specified mailbox. hand-picked, curated, iconic ✨
  • -d, --unset-deleted β€” unset the \Deleted flag on any restored messages. taking off the "yes I'm deleted" sticker
  • -f flagname, --set-flag=flagname β€” set the user flag \flagname on the messages restored, making it easier for the user(s) to find the restored messages and operate on them (in a batch). tagging them so future-you can find them 🏷️
  • -v, --verbose β€” enable verbose output/logging. tell me everything, I want the tea β˜•

πŸ”₯ EXAMPLES πŸ”₯

the receipts, let's go:

unexpunge -l user/john@example.org

List the messages that are expunged and could be restored for mailbox user/john@example.org. just looking, not touching 🫣

unexpunge -u user/john@example.org 278787 278788

Unexpunge two of these messages. two lil guys saved πŸ’–

mbexamine user/john@example.org

Examine the mailbox for the two restored messages. proof they're actually back, no cap

unexpunge -u -d user.johnsmith 46908

Unexpunge a select message based on its UID, clearing the \Deleted flag. one specific babe, and un-deleted

unexpunge -a user.johnsmit.Trash

Unexpunge all messages in a user's Trash, but leave them flagged \Deleted. everything out of the bin, but they still got the label

unexpunge -a -f Flagged user.johnsmith.Trash

The same, but setting user flag \Flagged to facilitate later bulk operations. now you can batch them later, slay πŸ’…

unexpunge -t 24h -d -f Flagged user.johnsmith

Unexpunge messages matching only a given time period. last 24 hours only, we're not doing the whole year

unexpunge -t 24h -d -f Flagged user/johnsmith

The same command, supporting the unixhierarchysep: yes option in imapd.conf(5). same energy, different separator, iykyk


πŸŽ€ FILES πŸŽ€

  • /etc/imapd.conf

🌈 SEE ALSO 🌈


πŸ‘‘ AUTHOR πŸ‘‘

The Cyrus Team, Nic Bernstein (Onlight), Jeroen van Meeuwen (Kolab Systems)

absolute legends, all of them ✨


1993–2026, The Cyrus Team


and that's the whole page, bestie!! this was Cyrus IMAP version 3.12.4, dated Sep 09, 2026 β€” go forth and un-expunge responsibly, mwah πŸ’–πŸ’…πŸ¦‹

πŸ“¦ where this page comes from