UNEXPUNGE(8)

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

okay bestie, welcome to unexpunge β€” it's part of the Cyrus IMAP docs and it's genuinely the "undo button" of the mail world. Let's get into it. 🫢


✨ NAME ✨

unexpunge β€” the Cyrus IMAP tool that recovers 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...

🌸 DESCRIPTION 🌸

So the whole point of unexpunge: it lists or restores messages that got deleted from a mailbox but are still chillin' in the Cyrus IMAP mail spool. They're not gone gone, bestie. They're just lurking. πŸ‘€

⚠️ This utility is only useful when the server is configured with expunge_mode set to delayed in its configuration file. No delayed mode, no resurrection, periodt.

And unexpunge reads its configuration options out of the imapd.conf(5) file unless you say otherwise with -C. ✨


πŸ’… OPTIONS πŸ’…

  • -C config-file β€” use config-file as the config file instead of the default imapd.conf(5). iykyk.
  • -l, --list β€” list the expunged messages in the specified mailbox that are available for restoration. Optional lil' bonus: you can only list the messages matching the UIDs in that space-separated list at the very end of the command invocation. 🌈
  • -t time-interval, --within-time-interval=time-interval β€” unexpunge the messages that were expunged within the last time-interval seconds. Want a different time unit? Use one of the trailing modifiers: m (minutes), h (hours), d (days) or w (weeks). πŸ•°οΈ
  • -a, --all β€” restore all of the expunged messages in the specified mailbox. main character energy fr fr.
  • -u, --uids β€” restore only the messages matching the UIDs, in a space-separated list at the end of the command invocation, in the specified mailbox.
  • -d, --unset-deleted β€” unset the \Deleted flag on any restored messages.
  • -f flagname, --set-flag=flagname β€” set the user flag \flagname on the messages restored, which makes it way easier for the user(s) to find the restored messages and operate on them (in a batch). πŸ‘‘
  • -v, --verbose β€” enable verbose output/logging. For when you simply must know everything. πŸ”₯

πŸ¦‹ EXAMPLES πŸ¦‹

unexpunge -l user/john@example.org

List the messages that are expunged and could be restored for mailbox user/john@example.org.

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

Unexpunge two of these messages.

mbexamine user/john@example.org

Examine the mailbox for the two restored messages.

unexpunge -u -d user.johnsmith 46908

Unexpunge a select message based on its UID, clearing the \Deleted flag.

unexpunge -a user.johnsmit.Trash

Unexpunge all messages in a user's Trash, but leave them flagged \Deleted.

unexpunge -a -f Flagged user.johnsmith.Trash

The same, but setting user flag \Flagged to facilitate later bulk operations.

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

Unexpunge messages matching only a given time period.

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

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


πŸŽ€ FILES πŸŽ€

  • /etc/imapd.conf

⭐ SEE ALSO ⭐


πŸ’œ AUTHOR πŸ’œ

The Cyrus Team, Nic Bernstein (Onlight), Jeroen van Meeuwen (Kolab Systems). absolute icons, no cap.


1993–2026, The Cyrus Team


okay that's the whole page bestie, go forth and un-delete πŸ’…βœ¨

Cyrus IMAP unexpunge, version 3.12.3, dated Jul 15, 2026 β€” that's the vibe check for this one, and yes, UNEXPUNGE(8) is the section it lives in. mwah 🫢

πŸ“¦ where this page comes from