I'm looking at scripting a mechanism to delete a mailbox, which is easy with 'doveadm mailbox delete' -- however it gets complicated when there are children of arbitrary depth, for example, I may have this: restored.daily1.INBOX restored.daily1.Sent restored.daily1.Mystuff restored.daily1.Mystuff.foo I would like to delete the 'restored' mailbox and all its children (and unsubscribe the folders), but the 'doveadm mailbox delete' command wont delete any children. I'm surprised that there isn't a -r (recursive) option to 'doveadm mailbox delete', but perhaps I am missing the easier way to handle this? thanks for any ideas or suggestions! micah -- -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 835 bytes Desc: not available URL: <http://dovecot.org/pipermail/dovecot/attachments/20111115/c9669dc5/attachment-0004.bin>
On 16.11.2011, at 3.04, Micah Anderson wrote:> I'm looking at scripting a mechanism to delete a mailbox, which is easy > with 'doveadm mailbox delete' -- however it gets complicated when there > are children of arbitrary depth, for example, I may have this: > > restored.daily1.INBOX > restored.daily1.Sent > restored.daily1.Mystuff > restored.daily1.Mystuff.foo > > I would like to delete the 'restored' mailbox and all its children (and > unsubscribe the folders), but the 'doveadm mailbox delete' command wont > delete any children. > > I'm surprised that there isn't a -r (recursive) option to 'doveadm > mailbox delete', but perhaps I am missing the easier way to handle this?Well, how about something like: doveadm mailbox list 'restored.*' | xargs -1 doveadm mailbox delete doveadm mailbox delete restored That's what it would have to do internally anyway..