ZDNet UK


Skip to Main Content

ZDNet.co.uk - Winner of Best Business Website 2007
  1. Home
  2. News
  3. Blogs
  4. Reviews
  5. Prices
  6. Resources
  7. Community
  8. My ZDNet

 

ZDNet UK RSS Feeds


IT Jobs

Office applications Toolkit

Replace POP3 with IMAP to extend the reach of users' email

John Locke

Published: 08 May 2003 11:43 BST

  • Email
  • Trackback
  • Clip Link
  • Print friendly
  • Post Comment

Compile and install Courier-IMAP
Follow the instructions of the README file in the Courier-IMAP archive to compile and install Courier-IMAP. In the configure step, make sure you provide the paths to the MySQL headers, as described here:

$ ./configure --with-authmysql --without-authpgsql \
> --with-mysql-libs=/usr/local/mysql/lib/mysql \
> --with-mysql-includes=/usr/local/mysql/include/mysql

Courier-IMAP installs everything in /usr/lib/courier-imap by default. You will want to add this to your list of files to back up, especially the etc subdirectory.

Create the user database
Now you need to create a MySQL database to store the user accounts. The User table in MySQL sidebar shows a create table statement that sets up the required fields in the database for your email system.


Configure Courier-IMAP
The main file you need to edit to configure Courier-IMAP is /usr/lib/courier-imap/etc/authmysqlrc. This file contains the connection and column settings for the user table you just added to MySQL. Change these settings where they are in the file, rather than moving them around, so that if you upgrade Courier-IMAP later, it will preserve your settings. Set the values as follows:

MYSQL_SERVER dbserver
MYSQL_USERNAME user
MYSQL_PASSWORD password
MYSQL_PORT 3306
MYSQL_DATABASE maildb
MYSQL_USER_TABLE users
MYSQL_CRYPT_PWFIELD crypt
MYSQL_UID_FIELD uid
MYSQL_GID_FIELD gid
MYSQL_LOGIN_FIELD id
MYSQL_HOME_FIELD home
MYSQL_NAME_FIELD name
MYSQL_MAILDIR_FIELD CONCAT(home,'/',maildir)

Next, edit the authdaemonrc file in the same directory, removing the extra authentication services from the authmodulelist setting:

authmodulelist='authmysql authpam'

Courier-IMAP comes with a single System V script to start all of the servers. However, the services are disabled by default, so you have to edit the configuration files for the services you want to run to enable them. To enable the IMAP service, edit the imapd file in this directory, and set:

IMAPDSTART=YES

To enable the POP3 service, edit the pop3d file and set:

POP3DSTART=YES

Now you're ready to start Courier-IMAP. You can start each of these services individually, using the scripts in /usr/lib/courier-imap/libexec, or if you have a System V system, you can use the init.d script from the source directory to configure Courier-IMAP to run when the server starts.

To set up the System V script, change back to your source directory and type the following as root:

# cp courier-imap.sysvinit /etc/rc.d/init.d/courier-imap
# chmod 744 /etc/rc.d/init.d/courier-imap
# /etc/rc.d/init.d/courier-imap start

Now Courier-IMAP is up and running and using the MySQL database that was created to authenticate users. But you still need to get Postfix to deliver mail to the virtual users.

What's next?
In the next article, I will configure Postfix to deliver mail to virtual users in the MySQL database that I created in this article, set up the UNIX environment for the virtual accounts, and discuss the DNS issues I need to resolve to get the email delivered correctly to the new server. By the end of the next article, you will have a fully-functioning email server capable of sending and receiving email for multiple domains.


More enterprise IT news in ZDNet UK's Tech Update Channel.

For a weekly round-up of the enterprise IT news, sign up for the Tech Update newsletter.

Let the editors know what you think in the Mailroom.

Next

Previous

1 2


  • Email
  • Trackback
  • Clip Link
  • Print friendly Print with Dell

Did you find this article useful?
98 out of 191 people found this useful



Company/Topic Alerts

Create a new alert from the list below:









Related Jobs

Endur Analyst (Endur, Openlink, AVS, Trading,ISEB)

Analyse and prioritise business requirements and problems, and seek effective solutions through improvements in processes and possible enhancements ...

PHP / MYSQL / CSS / HTML / Javascript / Design Developer 25K Bolton

Essential skills include: PHP / MYSQL CSS, HTML, Javascript AJAX, XML, Linux, Apache (desirable) E-Commerce, Content Management (desirable) You will ...

Oracle Financials and SCM Consultants

All qualified applicants will receive consideration for employment without regard to race, color, religion, gender, gender identity or expression, ...

Featured Talkback

Why do so many (virtually all) software packages think that they are so important that they have to be started automatically every time the computer boots? What is the largest number of "speed access", "update check", "camera download" and whatever other background programs you have ever seen running? Of those, how many did you really need?

By: J.A. Watson

Read full story:
Annoying software: a rogues' gallery

Discussions

dogStar dogStar

Shake those Monkeys!

Friday 25 July 2008, 9:51 AM

1 comment
Freddyoky Freddyoky

Police And The Internet

Friday 25 July 2008, 8:32 AM

4 comments

Vista Upgrade Blog

Microsoft's pre-modern message puts a...

Over at ZDNet.com, Ed Bott reports a first sighting of Microsoft's eagerly awaited $300 million ad campaign. Already the cause of much speculation, the consensus is that this will be... More

7 comments

A $40 CONSUMER-class router has create...

Believe it or not I don't work in IT, haven't for 7 years. Yes I work with Microsoft's Windows XP Embedded and as a result I have to know a lot about the OS, the kernal, Win API calls... More

Post a comment

Sick Puppy Redo

I generally follow a dispassionate investigative process when trying to discern what happened when a project goes bad. Although its a low priority item, it gets done simply because... More

Post a comment