![]() | ![]() |
|
Cyrus IMAP HOWTOAurora Skarra-Gallagher (Community Vision)v1.3, 11 October 2000A comprehensive guide to installing, configuring, and running Cyrus Imap and Cyrus Sasl
1. About this HOWTO
2. Introduction to IMAP
3. Obtaining the Files
4. Different SASL Authentication Methods
5. Cyrus SASL
6. Cyrus IMAP Installation
7. Cyrus IMAP Configuration
8. Cyrus IMAP Implementation
9. Troubleshooting1. About this HOWTO1.1 Copyrights and Trademarks(c) 2000 Aurora Skarra-Gallagher This section was copied from the HOWTO-HOWTO: This manual may be reproduced in whole or in part, without fee, subject to the following restrictions:
1.2 FeedbackComments (especially corrections) can be sent to asg@CommunityVision.com 1.3 CHANGES
1.4 Document Conventions
2. Introduction to IMAP2.1 What is IMAP?This definition is from the ComputerUser.com High-Tech Dictionary: Internet Message Access Protocol. A protocol that allows a user to perform certain electronic mail functions on a remote server rather than on a local computer. Through IMAP the user can create, delete, or rename mailboxes; get new messages; delete messages; and perform search functions on mail. A separate protocol is required for sending mail. Also called Internet Mail Access Protocol. 2.2 IMAP vs. POPIMAP allows the user to read email from many different locations and accounts because email folders are stored on the server, locally, at the home or the office, for instance. Even saved and read messages are stored on the IMAP server. POP only stores new unread messages on the server, and the read and saved messages are stored locally. To force POP to not delete email once it has been read can create many copies of the same email, creating a waste of space and confusion. However, IMAP is usually more complicated to set up. If you only have one email account, POP is most likely your best choice. If you want to access more than one account, from different locations, IMAP will probably serve you most efficiently. 2.3 Cyrus IMAP vs. Washington IMAPCyrus has its own mailbox database which is standalone and increases performance, whereas Washington uses the stanard UNIX mailbox format, which was designed for a smaller set of users. Washington is portable to more UNIX and non-UNIX systems than Cyrus. The main difference is that with Cyrus, you don't have to add new users to your linux box (i.e. in /etc/passwd) to add new mail users, and with Washington, you do. 3. Obtaining the Files3.1 Cyrus Imap HomepageThe homepage is currently located at: http://asg.web.cmu.edu/cyrus/imapd 3.2 Downloading the filesYou will need both IMAP and SASL. Download the latest files here: ftp://ftp.andrew.cmu.edu/pub/cyrus-mail Download cyrus-imapd-X.X.X.tar.gz and cyrus-sasl-X.X.X.tar.gz (where X.X.X is the latest release) into your temporary directory. I will use /temp as the directory I've uncompressed the files under for the rest of the examples. 4. Different SASL Authentication Methods4.1 sasldbThis is the default method of authentication. It stores usernames and passwords in the SASL secrets file sasldb. In this HOWTO, I assume you are using the sasldb method of authentication. 4.2 LDAPThe following definition came from the OpenLDAP website. Lightweight Directory Access Protocol (LDAP) is an open-standard protocol for accessing information services. The protocol runs over Internet transport protocols, such as TCP, and can be used to access stand-alone directory servers or X.500 directories. This method isn't discussed in this HOWTO, but here is a link to a page with patches and info: http://www.openldap.org/faq/data/cache/428.html 4.3 PAMNot enough info to document. Email me if you have some. 4.4 kerberos_v4Not enough info to document. Email me if you have some. 5. Cyrus SASL5.1 UncompressHere we untar and gunzip the file in a single step.
5.2 Building the filesFor most purposes, the following set of instructions works fine. If you would like to examine the
other configuration options, type
If you don't want your password check to be the default sasldb, you must specify which one of PAM, kerberos_v4, passwd, shadow you wish to use. If PAM is the authentication you desire for example, you would type:
instead of the ./configure line above 6. Cyrus IMAP Installation6.1 UncompressThe following commands will tar and gunzip cyrus IMAP under /temp.
6.2 A note on com_err.hWhen I tried to install cyrus IMAP, I got errors regarding the file com_err.h. My com_err.h was located in /usr/include/et. It needs to reside in /usr/include. Run the following command to make sure it is in the correct location:
This will show you where the file is. If it is under /usr/include, you can skip to the next section. If it is in another directory, just copy it to /usr/include. If it doesn't exist, download it here: http://www.ludd.luth.se/~jnilsson/cvsweb/cvsweb.cgi/src/contrib/com_err. 6.3 Configure
6.4 Adding the default userCyrus requires a user to own its files. The default user is cyrus. The following command adds a user cyrus with the group of "mail"
You'll want to set the password for user cyrus.
Type in the password you desire cyrus to have each time you are prompted 6.5 Building the files
That's it! You're ready to configure Cyrus IMAP. 7. Cyrus IMAP Configuration7.1 Editing conf files
If you don't want your password check to be the default sasldb, you must specify which one of PAM, kerberos_v4, passwd, shadow you wish to use. If PAM is the authentication you desire for example, you would type:
instead of the line above 7.2 Creating the necessary directoriesThis list of instructions will set up all the directories necessary for imap.
You are now the user cyrus. This is necessary for the files to have the correct owner and group. Continue:
You are now root again. The last command:
7.3 More configuration file editing
7.4 If you use postfix instead of sendmailPostfix is a mail-deliver alternative to sendmail. Most linux installations use sendmail by default. If you use postfix, ignore configuration #3 from the last section and uncomment or add the following line in /etc/postfix/master.cf
cyrus unix - n n - - pipe flags=R user=cyrus argv=/usr/sbin/cyrdeliver -e -m ${extension} ${user} Also add or uncomment this line in /etc/postfix/main.cf
8. Cyrus IMAP Implementation8.1 Add the cyrus administratorRun the following command to set up a user for cyrus
8.2 Testing Cyrus IMAP
Enter your password. If you see something like:
(L01 OK User logged in means you're in) Then the setup has been successful. Type
. logout to log out. 8.3 Setting up usersStill as the user cyrus, type the following commands. They will set up the mailbox(es) for each user. Fill in the username where you see the (username).
Now as root, enter a password for each username
8.4 Delivery database pruningIf you don't periodically prune the database of deliveries, you can fill up your file system. Adding a cron job which will run once a day is one way to do this. That involves going to /etc/cron.daily and creating a file named cyrus-imapd. Inside that file, put the following two lines of code:
#!/bin/bash su cyrus -s /bin/bash -c '/usr/cyrus/bin/deliver -E 3' Make this script executable by running: You should also create the deliverdb directory to store database files in:
8.5 Finishing upReboot the machine to make sure that everything has been restarted under the new configuration 9. TroubleshootingIf you encounter any errors, you can do the following to view error messages:
If you are having "virtual memory exhausted errors" when compiling, running
as root has been reported to work. |
![]() |