Courier IMAPS Server - Maildir

From Wiki

Jump to: navigation, search

1. Install Courier (done using this page: http://www.unixreview.com/documents/s=9811/ur0506m/)

apt-get install courier-imap-ssl
This will pull down all relevant packages
Chose defaults when installing

2. Main Config is naturly enough in /etc/courier

Nothing is chanced in Courier Configs

3. To get postfix handing off to Courier:

Config Postfix (done using this page: http://www.samba.netfirms.com/courier/courier.html)
/etc/postfix/main.cnf
Comment out #mailbox_command = /user/bin/ procaine's-Y -a $DOMAIN 
Include or uncomment home_mailbox = Maildir/

4. Step 3 should automatically make a Maildir in /home/user when mail is recieved

If you want to make the maildir manually, because a maildir is required for IMAP Login:
Done using this website: http://archives.free.net.ph/message/20050807.151155.5ecafcf2.en.html
/home/user
maildirmake Maildir
This can be done for defauly users in the skeleton account /etc/skel/

5. IMAP login and recieving emails should work ok using thunderbird

6. Fix for courier.

So thunderbird gave me the error: "Alert from account: Filesystem notification initialization error -- contact your mail administrator (check for configuration errors with the FAM/Gamin library).
apt-get install gamin
Ref: http://zeldor.biz/2010/12/fix-filesystem-notification-initialization-error/   http://www.tutorialnut.com/index.php/2010/05/18/quick-fix-filesystem-notification-initialization-error-contact-your-mail-administrator-check-for-configuration-errors-with-the-famgamin-library/

7. Now there does seem to be a load in PROCMAIL that I'm not using.

Rules can be made as to what folder to sort incoming email.
(Some basics are at: http://www.pocock.com.au/linux-doc/mbox-maildir.html)
Actually I am mixing up procmail with maildir!!
POSTFIX -> PROCMAIL (not even sure!) -> MAILDIR -> COURIER

Install and Config for Procmail

apt-get install procmail
vi /etc/postfix/main.cf
//add the line:
mailbox_command = /usr/bin/procmail -a "$EXTENSION" DEFAULT=$HOME/Maildir/ MAILDIR=$HOME/Maildir

restart postfix and test.

Quick config for procmail

vi /home/$USER/.procmailrc
#Start of Procmailrc script.
PATH=/bin:/usr/bin:/usr/bin
MAILDIR=$HOME/Maildir
LOGFILE=$MAILDIR/procmail.log

:0 c
!email@gmail.com

This above procmail reciepie creates a procmail log for the user. It also forwards a copy of all email to email@gmail.com More procmail rules at http://wiki.kartbuilding.net/index.php/Procmail

Update Cert

Even though I'm sure its not the best practice, I copy the newly updated apache.pem cert and use it for courier-ssl.

cp /etc/apache2/ssl/apache2.pem /etc/courier/imapd.pem
/etc/init.d/courier-imap-ssl restart
Personal tools