Dear Bron,<div><br></div><div>Thanks for your input. </div><div>I was able to achieve it using following IMAP command.</div><div><br></div><div>uid store start-id:end-id -flags.silent (\deleted)<br><br>As you mentioned now I am exploring Perl&#39;s IMAPClient module</div>


<div>to do it recusively. I will post the solution after completion.</div><div><br></div><div>Just for more info: Meanwhile I had opened a question</div><div>on <a href="http://serverfault.com/questions/377748/how-deleted-flag-can-be-unset-for-all-mails-in-cyrus-imapd-mailbox" target="_blank">serverfault</a> where I got some help too.</div>


<div><br></div><div>--</div><div>Regards,</div><div>Sachin Divekar</div><div><br></div><div><br><div class="gmail_quote">On Mon, Apr 9, 2012 at 1:33 PM, Bron Gondwana <span dir="ltr">&lt;<a href="mailto:brong@fastmail.fm" target="_blank">brong@fastmail.fm</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div style="font-family:Arial;font-size:medium" dir="ltr"><div>
        <div>
                <div>
                        With IMAP:</div>
                <div>
                         </div>
                <div>
                        tag STORE 1:* -flags \Deleted</div>
                <div>
                         </div>
                <div>
                        You&#39;ll have to do it on every folder though... the kind of thing scripting is handy for!</div>
                <div>
                         </div>
                <div>
                        Bron.</div><div><div>
                <div>
                         </div>
                <div>
                        On Mon, Apr 9, 2012, at 07:32 AM, Sachin Divekar wrote:</div>
                </div></div><blockquote type="cite"><div><div>
                        Dear guys,
                        <div>
                                 </div>
                        <div>
                                I have a 5GB mailbox which I moved using imapsync. But somehow I</div>
                        <div>
                                messed up with --delete option and end up with almost all the messages</div>
                        <div>
                                having \Deleted flag set. I do not have delayed expunge enabled, so</div>
                        <div>
                                I can not use unexpunge utility.  I am using cyrus-imapd v2.3.7.</div>
                        <div>
                                 </div>
                        <div>
                                Is there any way I can unset \Deleted flag for all the mails in the mailbox?</div>
                        <div>
                                 </div>
                        <div>
                                Thank you.</div>
                        <div>
                                 </div>
                        <div>
                                --</div>
                        <div>
                                Regards,</div>
                        <div>
                                Sachin Divekar</div>
                        </div></div><div>
                                ----</div>
                        <div>
                                Cyrus Home Page: <a href="http://www.cyrusimap.org/" target="_blank">http://www.cyrusimap.org/</a></div>
                        <div>
                                List Archives/Info: <a href="http://lists.andrew.cmu.edu/pipermail/info-cyrus/" target="_blank">http://lists.andrew.cmu.edu/pipermail/info-cyrus/</a></div>
                </blockquote>
        </div>
</div>
<div>
         </div>
</div><div>-- </div>
<div>  Bron Gondwana</div>
<div>  <a href="mailto:brong@fastmail.fm" target="_blank">brong@fastmail.fm</a></div>
</div></blockquote></div><br></div>