System information
Compiling the IMAP library
Now that we have our dependencies satisfied, we can compile the IMAP library that
Asterisk will use to connect to our IMAP server.
The first thing to do is change to the thirdparty directory located under the asterisk-
complete directory. If you have not already created this directory, do so now:
$ cd ~/src/asterisk-complete
$ mkdir thirdparty
$ cd thirdparty
Next up is downloading the IMAP toolkit and compiling it. The next steps will get the
latest version of the IMAP toolkit from the University of Washington’s server (more
information about the toolkit is available at http://www.washington.edu/imap/):
$ wget ftp://ftp.cac.washington.edu/mail/imap.tar.Z
$ tar zxvf imap.tar.Z
$ cd imap-2007e
The directory name imap-2007e may change as new versions of the
toolkit become available.
There are a few options we need to pass to the make command when building the IMAP
library, and the values you should pass will depend on what platform you’re building
on (32-bit vs. 64-bit), if you need OpenSSL support, and whether you need IPv6 support
or just IPv4. Table 18-1 shows some of the various options you could pass on different
platforms.
Table 18-1. IMAP library compile time options
Option Description
EXTRACFLAGS="-fPIC" Required when building on 64-bit platforms.
EXTRACFLAGS="-I/usr/include/openssl" Used for building in OpenSSL support.
IP6=4 Many platforms that support IPv6 prefer that method of connection,
which may not be desirable for all servers. If you would like to force
IPv4 as the preferred connection method, set this option.
If you look in the Makefile shipped with the IMAP library, you will find a list of platforms
for which the library can be compiled. In our case, we’ll be compiling for either CentOS
or Ubuntu with PAM support. If you’re compiling on other systems, take a look in the
Makefile for the three-letter code that tells the library how to compile for your platform.
To compile for a 64-bit platform with OpenSSL support and a preference for connecting
via IPv4:
$ make lnp EXTRACFLAGS="-fPIC -I/usr/include/openssl" IP6=4
VoiceMail IMAP Integration | 413