<div dir="ltr">Hi Thomas,<div><br></div><div>Thanks for sharing it !<br><br><div class="gmail_quote">Em sex, 20 de mar de 2015 às 10:16, Thomas Jarosch <<a href="mailto:thomas.jarosch@intra2net.com">thomas.jarosch@intra2net.com</a>> escreveu:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
we are doing backups of our imap mailboxes using<br>
simple unix tools like find + afio. Sometimes, when a mailbox<br>
is still locked, deleted files were not expunged immediately<br>
and therefore ended up in the backup.<br>
<br>
During testing we found an additional problem with re-creating<br>
a deleted folder and fixed this one in the same run, too.<br>
<br>
Attached you'll find a few tools for cyrus imapd 2.4(.17):<br>
<br>
1. cyr_getdeleted: Lists deleted IMAP messages for a given mboxspec.<br>
(+ additional patch to add it to the build system)<br>
<br>
2. A patch for cyrus to create a ".deleted" file when a folder<br>
is marked for deletion. If the folder is re-created before it<br>
was removed from disk and we find the .deleted file,<br>
we clear out all *stale* messages.<br>
<br>
3. find_wrapper.py: A wrapper around find(1) to automatically<br>
exclude deleted messages and folders. Useful for backup shell scripts.<br>
Makes use of the ".deleted" file, too.<br>
<br>
I'm putting this out here in case these additions might come in handy<br>
for other people running cyrus imapd 2.4. Most of those tools and patches<br>
were developed by my colleague Samir Aguiar.<br>
<br>
As written in the "Mailbox deletion race: folders and files are never deleted"<br>
email[1] , we'll especially revisit issue 2. when testing cyrus 2.5.x<br>
<br>
Have a nice day,<br>
Thomas<br>
<br>
[1] <a href="http://lists.andrew.cmu.edu/pipermail/cyrus-devel/2015-February/003133.html" target="_blank">http://lists.andrew.cmu.edu/<u></u>pipermail/cyrus-devel/2015-<u></u>February/003133.html</a><br>
</blockquote></div></div></div>