betabug... Sascha Welter

home english | home deutsch | Site Map | Sascha | Kontakt | Pro | Weblog | Wiki

13 February 2006

cyradm Cheatsheet for Mac OS X Server

One of those "note to self" posts

I rarely have to do stuff on Mac OS X Servers with cyradm (the cyrus imap server administration tool). That's why I always have to look the stuff up. Here is a little cheatsheet for some of the commands I have used so far...

So far most BOFH tasks I had to do where related to problems with deleting mails from overfull mailboxes through the webmail interface. Given the right amount of (in well adjusted proportions) whining, authentification, reasoning, authorization, kharma, and overall asking and being a nice person, I can be convinced to do stuff on the servers in question (no names). Here is what I use (hints for improvements welcome). I noticed that the sample chapter from O'Reilly's Managing IMAP - Cyrus System Adminnistration is a good guide, but for users on OS X Server I had to adjust some stuff, notably the user paths. Dunno why, I'm in no way a cyrus expert.

logging in:

/usr/bin/cyrus/admin/cyradm -user adminusername localhost

Yes, even that is causing a search through the docs sometimes :-) Note that it prompts for the password of that user account. The user should be listed in /etc/imapd.conf on a line like:

admins: admin1 anotheradmin luserwhoisadminbyerror

list quota:

lq 'Other Users/username'

On Mac OS X Server 10.4 I found the users not like 'users.betabug', but always in this form. Dunno what that means, if you know, please enlighten me.

delete a mailbox:

And recreate it empty. Note that I give the adminuser all the rights, contrary to the O'Reilly book that gives only 'd'. A big hammer, but with only d it did not let me delete (maybe child mailboxes settings? -- update: according to the man page 'c' would have been what I needed). After the re-creation of the mailbox, the admins extra acl rights are gone, so all is well.

setaclmailbox 'Other Users/username' adminusername lrswipcda
deletemailbox 'Other Users/username'
createmailbox 'Other Users/username'

List a mailboxes access rights

listacl 'Other Users/username'

Don't blame me if you shoot yourself in the foot, better read the manual and the documentation yourself, like a good BOFH should.

Posted by betabug at 12:58 | Comments (2) | Trackbacks (0)
ch athens
Life in Athens (Greece) for a foreigner from the other side of the mountains. And with an interest in digital life and the feeling of change in a big city. Multilingual English - German - Greek.
Main blog page
Recent Entries
Best of
Some of the most sought after posts, judging from access logs and search engine queries.

Apple & Macintosh:
Security & Privacy:
Misc technical:
Athens for tourists and visitors:
Life in general:
<< Sunshine with HelMUG, Darkness with QTSS | Main | Vodafone Public Relations in the Phone Tapping Storm >>
Re: cyradm Cheatsheet for Mac OS X Server

Also, to set a quota:

sq 'Other Users/username' 19240

(in kilobytes, sq for setquota, other examples I found did not include the "storage" word, but the man page has it)

Update: indeed, does not work for me with the "storage" keyword in there.

Posted by: betabug at June 13,2006 17:20
Re: cyradm Cheatsheet for Mac OS X Server

I just found out why in cyradm the 'Other Users/shortname' is displayed instead of relative pathname to the mailbox storage area like 'user/shortname'.

If you run the command like this:
    /usr/bin/cyrus/admin/cyradm --user some_cyrus_admin_user --auth login --server localhost
you get mailbox listings like:
    Other Users/shortname (HasNoChildren)

If you run the command like this (no --auth flag):
    /usr/bin/cyrus/admin/cyradm --user some_cyrus_admin_user --server localhost
you get mailbox listings like:
    user/shortname (HasNoChildren)

I happened across different web pages that showed the two syntaxes and tried both.

BTW, THANK YOU for your clue to adding an admin user to the /etc/imapd.conf file. While i have been sys admin for many many years and am used to and very comfortable with command lines and conf files, i have gotten used to Mac OS X Server doing so much in the GUI that i am getting lazy when it doesn't handle things, like being able to delete a cyrus mailbox. Some bug or crash had generated some garbage name shared folder mailboxes and i wanted to delete them. It wasn't until reading your blog post that it struck me to add a user to the 'admins:' line in /etc/imapd.conf to give me the power to admin cyrus with cyradm. I had tryed cyradm before but never was able to get the admin power!

BUT, a warning for all. Do NOT use your regular email/login account on Mac OS X Server to add as an admin user in the /etc/imapd.conf file. If you do, next time you start your imap account on (probably other email clients too) you will see all user accounts as if they were your mailboxes! When i did that, my junk filter made a new 'Shared Folders/Junk' mailbox on the server since it didn't find one so i had to delete that after i scrambled to quit

So what i have done is to create a special user just for administering cyrus and then adding that to the 'admins:' line in /etc/imapd.conf file. You also have to restart cyrus -- or just stop and restart the whole mail system using the GUI in Server Admin -- to get your conf file reread for the user to be treated as admin. I bet a good ole NOHUP to the correct cyrus process would get the file reread...

Thanks again for your post!


Posted by: isis at April 01,2007 20:02
You can trackback to:
There are no trackbacks.