Resolving errors

Errors can be received at each phase of the build. Errors while running the configure script will probably relate to a missing dependency. Check the README and INSTALL files supplied with the software, and ensure that all dependencies are installed.
 
If the problem is not obvious from the error message provided, then an Internet search for the exact error message may find a solution.

An error at build time is unusual, as most errors will be prevented by the configure script. Again, the error message should provide a good clue to the source of the error, and use of an Internet search engine may pay off.

Errors when running the software are generally due to erroneous configuration. There are few configuration options with the Courier Authentication Library, but errors can and do occur.

If an answer can't be found, there is a courier mailing list which can be approached for help. As always, firstly search list archives for your problem, and consult the FAQ. For Courier-IMAP, the mailing list is at http://lists.sourceforge.net/lists/listinfo/courier-imap, searchable list archives are available at http://sourceforge.net/mailarchive/forum.php?forum_id=7307, and the FAQ is available at http://www.courier-mta.org/FAQ.html.

Building Courier-IMAP

The Courier-imap source code is available in a tarball -a package of all the files, similar to a zip file. This should be downloaded from www.courier-mta.org/, but be careful to download the source for courier-imap and not for the Courier MTA.

To install Courier-IMAP, a few commands must be entered. As with much free software, a configuration script is run first. The configuration script checks the software installed on our machine and configures the software so that it will build correctly.

When Courier-IMAP is used as an IMAP server, it assumes that its clients are going to follow the IMAP standard exactly. Unfortunately, this is not the case, and if Courier-IMAP expects the clients to conform to the IMPA standard exactly, then the clients would not function correctly. The Courier-IMAP developers recognize this, and have built the capability to work with non-standard clients, by passing the –enable-workarounds-for-imap-client-bugs flag to the configure script.

Courier-IMAP also includes a check functionality when building it. Unfortunately, using --enable-workarounds-for-imap-client-bugs prevents the check from working successfully. As the check functionality is useful, we will build the software twice, firstly without the --enable-workarounds-for-imap-client-bugs, and then run the check, and then build again with the flag, and install the software.

To build Courierr-IMAP, enter the following commands. Choose a suitable directory to build the software, in this example we choose /tmp, and the software unpacked itself into the courier-imap

3.0.8 directory.

checking for gcc... gcc

checking for C compiler default output file name... a.out

checking whether the C compiler works... yes

.... (a lot more output follows)

config.status: creating config.h

config.status: executing depfiles commands

Making check in numlib

make[1]: Entering directory `/tmp/courier-imap-3.0.8/numlib'

Compiling atotimet.c

... (a lot more output appears)

rm -f '/tmp/courier-imap-3.0.8/=install-check/usr/lib/courier

imap/etc/pop3d.cnf'

rm -f '/tmp/courier-imap-3.0.8/=install-check/usr/lib/courier

imap/etc/quotawarnmsg.example'

make[2]: Leaving directory `/tmp/courier-imap-3.0.8'

make[1]: Leaving directory `/tmp/courier-imap-3.0.8'

checking for gcc... gcc

checking for C compiler default output file name... a.out

checking whether the C compiler works... yes

checking whether we are cross compiling... no

.... (a lot more output follows)

config.status: creating config.h

config.status: executing depfiles commands

make all-gmake-check FOO=BAR

make[1]: Entering directory `/tmp/courier-imap-3.0.8'

make[1]: Leaving directory `/tmp/courier-imap-3.0.8'

NOTE

All questions regarding ANY vpopmail-related problems,such as compiling/building failures, or login errorsshould be referred to the vpopmail mailing list.

Vpopmail questions sent to the sqwebmail or Couriermailing lists will be IGNORED.

(lots more output appears)cp imap/pop3d-ssl.dist .cp imap/imapd.cnf .cp imap/pop3d.cnf .make[1]: Leaving directory `/tmp/courier-imap-3.0.8' Making install in numlibmake[1]: Entering directory `/tmp/courier-imap-3.0.8/numlib'make[2]: Entering directory `/tmp/courier-imap-3.0.8/numlib'(lots more output appears)

/bin/install -c 'makeuserdb' '/usr/lib/courier-imap/share/makeuserdb'

/bin/install -c 'pw2userdb' '/usr/lib/courier-imap/share/pw2userdb'make[2]: Leaving directory `/tmp/courier-imap-3.0.8'make[1]: Leaving directory `/tmp/courier-imap-3.0.8' make[1]: Entering directory `/tmp/courier-imap-3.0.8/numlib'make[1]: Leaving directory `/tmp/courier-imap-3.0.8/numlib'make[1]: Entering directory `/tmp/courier-imap-3.0.8/gdbmobj'(lots more output appears)authdaemonrc:

authmodulelist: newauthmodulelistorig: newdaemons: newversion: newauthdaemonvar: new

make[1]: Leaving directory `/tmp/courier-imap-3.0.8'
$

If the output appears similar to above, then Courier-IMAP will have been successfully installed. You may continue at the section "Configuring Courier-IMAP".

Handling errors

It is possible that the configure command will fail. Configuration attempts to detect existing software, and ensure that Courier-IMAP works with it, but it occasionally makes an error.

checking for getspent... yes configure: error: /var/vpopmail/etc/lib_deps does not exist -upgrade vpopmail to the current version or fix the permissions on this file configure: error: /bin/sh './configure' failed for authlib

In this example, the configure command assumed that vpopmail was installed, and failed when it couldn't find parts of vpopmail. In reality, vpopmail was not installed, and should not have been detected, By consulting the INSTALL file, we read:

configure should automatically detect if you use vpopmail, and compile and install the authvchkpw authentication module.

This suggests that the authvchkpw is used for vpopmail. Further up the INSTALL file, we read:

* authvchkpw -this module is compiled by default only if the vpopmail account is defined.

Upon checking the /etc/passwd file, we find that there is an account for vpopmail, which explains the detection. The lack of vpopmail files explains the failure of the configure script. In the INSTALL file, the parameters to the configure script are described:

Options to configure: ...

* --without-module -explicitly specify that the authentication module

named "module" should not be installed. See below for more details.

Example: --without-authdaemon.

The solution is therefor to use the --without-authvchkpw option:

$ ./configure –without-authvchkpw

Most problems can be solved in a similar way. It is best not to be put off by terms and names that aren't understood -just by searching for the term vpopmail(which was mentioned in the original error message), but without understanding anything about vpopmail, it is possible to resolve the error by reading the documentation.

If an answer can't be found, there is a courier mailing list which can be approached for help. Details are given in the section on the Courier Authentication Library.

Using POP3

As mentioned above, POP3 is typically used when email is to be stored on a client computer. It is most often used when there is an intermittent connection to the email server, for example when using a dial-up line to access an email account at an ISP. This approach has the advantage that the email is always available to the client, who can work when not connected to the email server. Emails can be read, and replies created ready for when the user is next on line.

The main disadvantage of using POP3 is that email is generally only available on the client PC. If the client PC fails, or is stolen, then the email is lost, unless a backup has been made.

POP3 clients can be configured to keep email on the POP3 server, for other clients to access. IMAP is more often used in this situation.

Configuring Courier for POP3

The configuration files are located in /usr/lib/courier-imap/etc/courier-imap/, if courier was built from source. If using a packaged distribution, they may be located in /etc/courier-imap. The file pop3d contains the settings for the pop3 server.

If you are using a packaged distribution of Courier, then the configuration files can be found with this command:

/usr/lib/courier-imap/etc/pop3d/usr/lib/courier-imap/bin/pop3d

Edit the file and locate and alter the following settings: A samplepop3d configuration file is shown below.

Setting Description
PIDFILE The pop3d daemon keeps track of the process ID that it uses. Specify a valid path and a name which suggests the use of the file. Typically, this might be /var/run/pop3d.pid
MAXDAEMONS This specifies the maximum number of pop3d process that can run at one time. The number of users that can connect at one time is limited by this number. A number higher than the expected number of users may be wasteful, but users attemptingto connect are also included in this number. Set this to a number around the maximum that may connect at one time, or a little higher.
MAXPERIP This specifies the maximum number of connections from each IP address. A low number prevents malicious acts such as denial-of-service attacks, where an attempt is made to use up all the connections on the mail server.
AUTHMODULES This specifies the authentication method to be used. If the courier authentication daemon is used, as with Courier-IMAP v4.0 and later, then set this to “authdaemon”
POP3AUTH If the courier authentication daemon is used, set this to blank, otherwise set it to indicate the type of login authentication performed. For versions prior to 4.0, this should probably be set to “LOGIN”.
PORT This specifies the port that the daemon listens on. The standard port is 110, and a different one should only be chosen if all client software is configured to use the non-standard port.
ADDRESS This specifies the IP address to listen on. If the machine has multiple network interfaces, then Courier can be configured to listen only on one of the addresses. A value of 0 indicates that all network interfaces should be used.
TCPDOPTS These are options to be used. Typical ones used include -nodnslookup, which prevents the pop3 daemon from attempting to resolve the name of each connection, and -noidentlookup prevents it from attempting an ident query for the incoming connection. Specifying both of these settings can decrease the time taken to authenticate a user connection.
MAILDIRPATH This is the path to a typical user's maildir. Specify the appropriate value for your system, for example “.maildir”

PIDFILE=/var/run/pop3d.pidMAXDAEMONS=40MAXPERIP=4AUTHMODULES="authdaemon"POP3AUTH=""PORT=110ADDRESS=0TCPDOPTS="-nodnslookup -noidentlookup"MAILDIRPATH=.maildir

Once the pop3 server has been configured, it is time to test it. If you are using a distribution-supplied version of Courier-IMAP, then use their startup script, probably called /etc/init.d/courier-imap. This will attempt to start imapd as well as pop3d, but as most of the configuration will have been done by the distributors, imap should start successfully.

To start the pop3 service for testing, run the following command:

# /usr/lib/courier-imap/libexec/pop3d.rc start

Once the pop3 and imap services are configured correctly, they can be started automatically when the machine is started. As this should be done once imap is configured, it is described at the end of that section. The instructions can be followed, even if IMAP is not required.

Testing the POP3 service

The easiest way to test a service like POP3 is by using the telnet utility and connecting to the appropriate port. This avoids any problems that there may be with network connectivity or client configuration. POP3 uses port 110, so telnet to port 110 on the local machine:

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

+OK Hello there.

+OK Password required.

+OK logged in.

+OK 82 1450826

+OK POP3 clients that break here, they violate STD53.

1 5027

2 5130

3 6331

4 3632

5 1367

... all emails are listed, with their sizes in bytesa

82 6427

.

+OK 5027 octets follow.

Return-Path: <user@domain.com>

X-Original-To: user@localhost

Delivered-To: user@machine.domain.com

Received: from isp (isp [255.255.255.255])

... email is listed

.

+OK Bye-bye.

Connection closed by foreign host.

The POP3 protocol is based on text commands, and so it is easy to emulate a client with telnet. Initially, use the USER and PASS commands to authenticate a user. If the user is authenticated correctly, then the STAT command lists all emails and their combined size in bytes. LIST lists each email and its size. The RETR command retrieves (or lists) an email when the email number is specified with the command. The DELE command, which is not shown in the example, will delete an email from the server.

Now that POP3 appears to be working, it is time to configure an email client to collect email.

Retrieving email via POP3 with Outlook Express

Outlook Express is a popular email client, shipped with most versions of Windows. It includes POP ability. Follow the following steps to set up a windows client

These instructions are for Outlook Express 6, shipped with Windows XP. Other versions will be configured in a similar way.

Start Outlook Express by clicking on the icon on the desktop, or locate it in the Start menu hierarchy. Select the Tools->|Accounts menu.

 

Click on the Add button, and select Mail from the menu. The Internet Connection is displayed.

Enter a descriptive name for the server as the "Display Name", then press Next.

Enter your email address and press Next.

Enter the IP address of the email server in both the Incoming mail and the Outgoing Mail fields. Ensure that POP3 is selected in the list of server types at the top of the screen, then press Next.

Enter the account name. This is the system account on the email server. If desired, leave the "Remember Password" box checked and enter a password, otherwise leave the password field empty. Press Next one more time Press Finish to complete the wizard.

 

The account has been added to the summary screen. Press Close, or select the account and press the Properties button if some of the details need to be changed. You can return to this screen and modify the account by selecting it in the list and pressing the Properties button.

To retrieve mail, select the Tools->Send and Receive->Send and Receive All menu. If you did not provide a password, then you will be prompted for the password.

 

Enter the password and press OK, and email will be downloaded.

Now that POP3 has been successfully configured, it's time to move on to IMAP.

 

< <Back to Linux Email Part One     Continue to Linux Email Part Three >>

 

© Copyright 2003-2023 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.