Cyradm delete mailbox permission denied

clearoscyrusimap

I have a new ClearOs 7 system. It has Cyrus IMAP installed. In trying to copy the mailboxes from the old server, I seem to have screwed up one of them. It has a folder called Junk E-mail which is only partly there.

I am trying to sort it out with cyradm, as follows:

    # cyradm --user root localhost
    localhost> lm
    user/harold (\HasChildren)
    user/harold/Drafts (\HasNoChildren)
    user/harold/Junk E-mail (\HasNoChildren)
    user/harold/NotSpam (\HasNoChildren)
    user/harold/SPAM (\HasNoChildren)
    user/harold/Sent (\HasNoChildren)
    user/harold/Sent Items (\HasNoChildren)
    user/harold/Trash (\HasNoChildren)
    localhost> sam user/harold root all
    localhost>  dm 'user/harold/Junk E-mail'
    deletemailbox: Permission denied

    # cyradm --user harold localhost
    localhost> lm
    INBOX (\HasChildren)               INBOX/Sent (\HasNoChildren)
    INBOX/Drafts (\HasNoChildren)      INBOX/Sent Items (\HasNoChildren)
    INBOX/NotSpam (\HasNoChildren)     INBOX/Trash (\HasNoChildren)
    INBOX/SPAM (\HasNoChildren)
    localhost> dm 'Junk E-mail'
    deletemailbox: Mailbox does not exist
    localhost> dm 'INBOX/Junk E-mail'
    deletemailbox: Permission denied

Unfortunately the permission denied messages mean that I cannot.

I have checked the ownership and permissions of the files in /var/spool/imap/h/user/harold, and they are all owned by user cyrus, group mail.

Best Answer

Actually you need to set the right ACL for that mailbox before deleting it. If you can't delete your own mailbox means the ACLs for that are missing. You should check the answer given to a similar question here.

In advance, you can set the ACL needed for deleting using:

sam <mailbox-name-here> <user> c
Related Topic