Deleting multiple users
Mordur
cl at 1984.is
Thu Dec 28 22:11:10 EST 2006
> Mordur wrote:
>> Hi all,
>>
>> I would like to delete about 550 users from Cyrus imap. Does anyone have
>> a script or advice for me how to do that without me having to manually
>> grant cyrus user the delete right for each user and then deleting? Any
>> advice greatly appreciated.
>>
>
> You could try:
>
> cyradm host
> sam user.* cyrus x
> (if x it the flag, I'm not sure at the moment)
> dm user.*
>
> if that doesn't work put a % in stead of a *
>
>
I want to apologize for wasting anyones time, but I figured this out.
This confused me no end, so I just want to explain what it was I was
trying to do, in case this could help anyone else.
My implementation of Cyrus IMAP is one of virtual domains. In this case,
I needed to remove all users of a certain domain, superflous.biz, but no
others.
An example of a users top level mailbox is this:
user/ziggi at superflous.biz (\HasChildren)
And a sub-box like this:
user/ziggi/Sent at superflous.biz (\HasNoChildren)
What I had to do to grant user cyrus all rights was simply:
--- > localhost> sam user/*@superflous.biz cyrus all
and this granted user cyrus all rights on every mailbox and sub-mailbox
for domain superflous.biz
I, then, thought I was home free, and tried:
--- > dm user/*@superflous.biz
But this delivered me an error message informing me that there was no
such mailbox as user/Drafts/someuser at superflous.biz. The user was, in
fact, deleted, and so were his sub-mailboxes, but the error stopped the
process so I would have had to reissue the command for every user. I
didn't feel like doing that 533 times. The solution to this was:
--- > dm user/*/*@superflous.biz
To delete all the sub-mailboxes,
and only then:
--- > dm user/*@superflous.biz
to remove the top level mailbox.
Hope this can help someone.
Mordur Ingolfsson
More information about the Info-cyrus
mailing list