Tuesday, March 01, 2005

Cyrus Imap Server

1) Cyrus-Imap is a imap/pop3 mail System which can use sendmail or postfix as MTA

2) It support SIEVE for server side email filtering

3) Authentication available from SASL library like Kerberos_v4, GSSAPI. CRAM-MD5, DIGEST-MD5, OPT, PLAIN, STARTTLS.

4) Enable these ports in firewall

pop3 110/tcp
imap 143/tcp
imaps 993/tcp
pop3s 995/tcp
sieve 2000/tcp

5) Config files are

/etc/imapd.conf
/etc/cyrus.conf

6) Test using this command if its setup and listining

netstat -an | grep LISTEN

It should list all above port saying that its listining

7) Now to test if it really logs in

cyradm is the tools for logging in as admin and it uses sasl and imap login.
So first create sasl user cyrus with this command

/usr/sbin/saslpasswd2 -c cyrus
Password: (enter your passwd)
Again (for verification): (enter your password)

Now login as user cyrus

/usr/lib/cyrus-imapd/cyradm --user cyrus --server localhost --auth plain
Password: # This is the SASL2 password
IMAP Password: # This is the IMAP password that you need to enter in the
mysql-table »accountusers«
localhost>

That is it.

8) Now to make cyrus as postfix transport edit main.cf and add this line

mailbox_transport = cyrus

9) To SASL Posfix SMTP add following lines in main.cf

smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks,
reject_unauth_destination
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain =
broken_sasl_auth_clients = yes

10) Add /usr/lib/sasl2/smtp.conf

pwcheck_method: saslauthd

11) The next step is to tell postfix how to find the saslauthd socket:

mv /var/run/sasl2 /var/run/sasl2-old
ln -s /var/run/saslauthd /var/run/sasl2

12) With Fedora Core 3 there is a error in master.cf. Correct it as follows

user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}

Only then delivery to cyrus will work.

No comments: