previous next contents

Configuring the Cyrus server


After installation, there are several steps necessary to get you new IMAP server up and running. First, create your /etc/imapd.conf file. This is a simple configuration file, and a basic setup should look something like the sample below. For a full description of the fields in this file, see the imapd.conf(5) man page.

configdirectory: /var/imap
partition-default: /var/spool/imap
admins: cyrus
sendmail: /usr/sbin/sendmail

Next, create the "configdirectory" specified in the imapd.conf file. Ensure this is owned by the cyrus user and group (by default, cyrus:mail), and change its permissions to 750. Do the same for the "partition-default" directory. Then, run the tools/mkimap script from the Cyrus distribution, as the cyrus user - this will create the cyrus directories under those you just created. On Linux file systems (ext2 - this does not apply to ReiserFS, XFS, or similar), it's important to use the "chattr +S" command to set these directories and their contents for synchronous updates. The ext2 filesystem can be prone to mailbox corruption under certain circumstances without this attribute set. Using synchronous updates forces the OS to flush changes to these directories to the disk immediately, and generates a performance overhead. For a large system, it may be preferable to use a journaling filesystem to obviate the need for this.

Ensure that your /etc/services file contains all the entries below:-
	
	pop3      110/tcp
	imap      143/tcp
   	imsp      406/tcp
   	acap      674/tcp
   	imaps     993/tcp
   	pop3s     995/tcp
   	kpop      1109/tcp
   	sieve     2000/tcp
   	lmtp      2003/tcp
   	fud       4201/udp

Finally, the master process must be configured. The Cyrus distribution comes with a number of sample configurations in the master/conf directory - choose the appropriate one, and copy it to /etc/cyrus.conf, and uncomment the entries required.

To test connections to the IMAP server, start the "master" process, and try to telnet to the server on the IMAP port:-
$ telnet bifrost 143
Trying 192.168.1.4...
Connected to bifrost.altair.nexus.
Escape character is '^]'.
* OK bifrost.altair.nexus Cyrus IMAP4 v2.0.11 server ready

If you see a greeting message like that above, your server is running. Add a user and password to your SASL secrets file using the saslpasswd utility (this won't be necessary if you already have an authentication framework like Kerberos in place). You can then test connections for this user with the imtest script from the cyrus distribution:-

# /usr/bin/imtest -m login -a imapuser bifrost
C: C01 CAPABILITY
S: * OK bifrost.altair.nexus Cyrus IMAP4 v2.0.11 server ready
S: * CAPABILITY IMAP4 IMAP4rev1 ACL QUOTA LITERAL+ NAMESPACE UIDPLUS ID NO_ATOMIC_RENAME UNSELECT MULTIAPPEND SORT THREAD=ORDER
EDSUBJECT THREAD=REFERENCES IDLE AUTH=DIGEST-MD5 AUTH=CRAM-MD5
S: C01 OK Completed
Password: 
C: L01 LOGIN imapuser {9}
+ go ahead
C: 
L01 OK User logged in
Authenticated.
Security strength factor: 0
. logout
* BYE LOGOUT received
. OK Completed
Connection closed.

At this stage, you have a working IMAP server installed. You now need to add user mailboxes - this is done with a Perl program called cyradm, which is installed as part of the Cyrus distribution. This should be run as the cyrus user, and allows a number of administrative operations:-

$ cyradm bifrost.altair.nexus
Please enter your password: 
bifrost.altair.nexus> ?
authenticate, login, auth         authenticate to server
chdir, cd                         change current directory
createmailbox, cm, create         create mailbox
deleteaclmailbox, dam, deleteacl  remove ACLs from mailbox
deletemailbox, delete, dm         delete mailbox
disconnect, disc                  disconnect from current server
exit, quit                        exit cyradm
help, ?                           show commands
listacl, lam, listaclmailbox      list ACLs on mailbox
listmailbox, lm                   list mailboxes
listquota, lq                     list quotas on specified root
listquotaroot, lqr, lqm           show quota roots and quotas for mailbox
renamemailbox, rename, renm       rename (and optionally relocate) mailbox
server, servername, connect       show current server or connect to server
setaclmailbox, setacl, sam        set ACLs on mailbox
setquota, sq                      set quota on mailbox or resource
version, ver, info                display version info of current server

Each user should have a mailbox created. For the "imapuser" test user, we'd create a mailbox called "user.imapuser" through cyradm. This will become the INBOX for that user. All other mailboxes will be subordinate to this one, and are best created via a mail client.

To complete the installation, you need to arrange for the Cyrus "master" process to start when the system boots, and also configure your MTA to deliver mail into the Cyrus mailstore. Cyrus provides a local delivery agent, which the MTA must be configured to call for local mail. The Cyrus documentation provides information on how to achieve this with sendmail - for other MTA's, different procedures will be required.


previous next contents