Due to the increased demand in webmail clients, I thought it would be appropriate to explain how one can configure PHP with IMAP support.
Download the IMAP package from ftp://ftp.cac.washington.edu/imap/imap/ (you will want the latest version of imap - I downloaded imap-2002e.tar.Z).
After downloading the file, you will want to untar the package within your working base directory (mine was /usr/local/src/apache). After untarring the package, you should change the directory to the subdirectory imap-2002e that was created.
Once in the subdirectory, we have to notify the make file what type of operating system we are on. Read the Makefile file, and you should see your OS listed. Using the code for your operating system, you will want to run:
If the IMAP library does not have to be compiled with OpenSSL libraries it is best to append SSLTYPE=none at the end of the make command.
Otherwise, if the IMAP compilation should be linked against OpenSSL, before compiling, it is wise to double check where the compiler will look for the OpenSSL libraries. One can change this in the file, imap-2002e/src/osdep/unix/Makefile. The values for the parameters SSLDIR should be changed, for example, to the path of the OpenSSL directory that was installed to from before, or to the default current location that exists on the server.
# make [operating system code] [optional: SSTYPE=none, if there is no need for SSL].
For example, for FreeBSD, you would want to run make bsf. For Linux, try make slx (there are various options for Linux, though, so make sure you read the Makefile list properly).
Do not bother with make install, or if you want, you may go ahead and install the library and header files on your system. We will simply tell PHP to look in the current imap-2002e directory for the appropriate files.
After compiling, it is necessary to create some soft links for PHP's sake:
# cd /usr/local/src/apache/imap-2002e # ln -s c-client lib # ln -s c-client include