imapd 2.4: Tool to list deleted messages and folders

Thomas Jarosch thomas.jarosch at intra2net.com
Fri Mar 20 09:14:57 EDT 2015


Hi,

we are doing backups of our imap mailboxes using
simple unix tools like find + afio. Sometimes, when a mailbox
is still locked, deleted files were not expunged immediately
and therefore ended up in the backup.

During testing we found an additional problem with re-creating
a deleted folder and fixed this one in the same run, too.

Attached you'll find a few tools for cyrus imapd 2.4(.17):

1. cyr_getdeleted: Lists deleted IMAP messages for a given mboxspec.
    (+ additional patch to add it to the build system)

2. A patch for cyrus to create a ".deleted" file when a folder
  is marked for deletion. If the folder is re-created before it
  was removed from disk and we find the .deleted file,
  we clear out all *stale* messages.

3. find_wrapper.py: A wrapper around find(1) to automatically
  exclude deleted messages and folders. Useful for backup shell scripts.
  Makes use of the ".deleted" file, too.
 
I'm putting this out here in case these additions might come in handy
for other people running cyrus imapd 2.4. Most of those tools and patches
were developed by my colleague Samir Aguiar.

As written in the "Mailbox deletion race: folders and files are never deleted"
email[1] , we'll especially revisit issue 2. when testing cyrus 2.5.x

Have a nice day,
Thomas

[1] http://lists.andrew.cmu.edu/pipermail/cyrus-devel/2015-February/003133.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cyr_getdeleted.c
Type: text/x-csrc
Size: 5051 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/cyrus-devel/attachments/20150320/fa25bc5a/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cyrus-imapd-2.4.17-build-cyr_getdeleted.patch
Type: text/x-patch
Size: 937 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/cyrus-devel/attachments/20150320/fa25bc5a/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cyrus-imapd-2.4.17-flag-deleted-folders.patch
Type: text/x-patch
Size: 3279 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/cyrus-devel/attachments/20150320/fa25bc5a/attachment-0002.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: find_wrapper.py
Type: text/x-python
Size: 5769 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/cyrus-devel/attachments/20150320/fa25bc5a/attachment.py 


More information about the Cyrus-devel mailing list