I'm in the process of nuking a bunch of dead mailboxes after they've been migrated to other servers - but the accounts have been kept. A simple shell script takes care of most of it, BUT.... (there's always a "but" isn't there?) One user has named all his mailboxes with leading hyphens. ie: -foo -bar -bazz and "doveadm mailbox delete" doesn't like it. Does anyone have the magic sauce needed to escape the - character? Thanks in advance Alan
On Tue, Jun 04, 2013 at 11:58:50AM +0100, Alan Brown wrote:> > > One user has named all his mailboxes with leading hyphens. > > ie: > > -foo > -bar > -bazz> Does anyone have the magic sauce needed to escape the - character?No idea what you've tried, but maybe '--' is enough? doveadm mailbox delete -u $user -- -foo -jf
>> and "doveadm mailbox delete" doesn't like it. >> >> Does anyone have the magic sauce needed to escape the - character? > > An "escaping" that works at the *nix level (not necessarily with > doveadm, but I would assume it works there too) is, e.g., > > rm -- -foo > > i.e., double dashes to nullify the "-" option flag, followed by the > filename.That does work. Thanks. Alan
On 2013-06-04 6:58 AM, Alan Brown <ajb2 at mssl.ucl.ac.uk> wrote:> One user has named all his mailboxes with leading hyphens. > > ie: > > -foo > -bar > -bazzHow annoying. I have a user that prefixes all of their folders with a leading asterisk (*)... -- Best regards, Charles