AlphaMail Is Scalable and Accessible Web Mail
The build is very much what you would expect:
# ./configure # make # make install
The configure script checks your system for dependencies and tells you what is missing or out of date. You should be able to complete all three steps as long as you have Boost installed, even if Perl dependencies are not met.
Be aware that some versions of g++ have a bug that will cause the compiler to go into an infinite loop while building imap_webcache. Two of the files in the source (IMAPFolder_rules.cc and RFC2822.cc) can trip this bug, but even with a good compiler, these files take a large amount of time and space to build, so expect the compile to run for a few minutes.
On some systems, there can be problems with the location of files. For example, on Red Hat Enterprise Linux systems, Kerberos dependencies cause OpenSSL code to fail to compile, which can be corrected by passing a value for CXXFLAGS:
# CXXFLAGS="-I/usr/kerberos/include" ./configure
As with any other GNU autoconf system, check the config.log if the configuration script fails to complete.
The biggest difficulty on most distributions is not building AlphaMail, but rather meeting all of the prerequisites. Many distributions come with an older version of mod_perl, libapreq and other Perl modules.
Make sure that you have libapreq2 and mod_perl >= 2.0 installed before messing with the other Perl dependencies, because some of them rely on one or both. Once this is done, you should be able to install the remaining Perl dependencies with your package manager or cpan(1).
You need to use cpan(1) if the packaged versions of a module do not exist or are too old. See the sidebar on avoiding packaging conflicts with your distribution's package manager.
Avoiding Package Management Conflicts When Using cpan(1)
Many Linux administrators do not like to use cpan(1) due to competition between the files installed by the cpan utility and the distribution's package manager. In production systems, therefore, it is desirable to install Perl modules in a place where the package manager will not see them.
AlphaMail looks for its own libraries in /usr/local/lib/alphamail (if you chose the default prefix during the build), and you can install Perl dependencies there without having to change anything about the runtime configuration of the system.
First, set your environment to indicate you would like Perl to look in an additional location (this is needed only during the build, the runtime system already includes this path during startup):
# export PERL5LIB=/usr/local/lib/alphamail
If you use an alternate prefix during configure, alter the /usr/local part of this to match.
Next, run cpan(1) and (re)configure it:
# cpan cpan> o conf makepl_arg ↪'PREFIX=/tmp/unneeded LIB=/usr/local/lib/alphamail'
The PREFIX argument tells the build process what the general installation prefix is; whereas, LIB tells it where to install the actual module code. I use /tmp/unneeded for PREFIX and remove the files afterward, because AlphaMail needs only the library. Set PREFIX to something like /usr/local if you need the manual pages or other extras that come with these modules.
If you want to save the cpan settings for future sessions, do:
cpan> o conf commit
Now, install or upgrade the necessary Perl modules (which are listed when you run configure):
cpan> install Time::HiRes ...
If you want to use these modules in your own scripts (or need to change where an AlphaMail script looks for them), add the following line near the top of the file:
use lib qw(/usr/local/lib/alphamail);
The build instructs you to create template configuration files with the alphamail_genconfig utility. This script prompts you for all of the necessary configuration options for a basic installation and creates the necessary files in a location you provide.
You need a special user for a sandbox and knowledge of what user your Web server runs as before starting configuration. I recommend creating a user named sandbox for the former. Logins for this user should not be enabled.
The configuration will ask for an installation prefix, which is whatever you passed to configure. This is usually /usr/local, and the script will verify correctness before continuing.
You will be asked to provide an IMAP prefix and separator for each IMAP server you want to access with AlphaMail. Some IMAP servers use slash (/) for the separator; others use dot (.). The prefix is a subfolder where users put all their other mail folders. For example, if users have shell access and their mail folders are stored in their home directories, it might be policy to put all of them in a directory named mail, in which case the prefix is probably mail.
It is important to note that some Web servers (such as Cyrus) use INBOX for the prefix and dot (.) for the separator. The following procedure can help you determine what to use. First, connect to the IMAP server from the command line, with:
# openssl s_client -connect imap.example.com:993 # For SSL
Practical books for the most technical people on the planet. Newly available books include:
- Agile Product Development by Ted Schmidt
- Improve Business Processes with an Enterprise Job Scheduler by Mike Diehl
- Finding Your Way: Mapping Your Network to Improve Manageability by Bill Childers
- DIY Commerce Site by Reven Lerner
Plus many more.
- diff -u: What's New in Kernel Development
- Server Hardening
- What's New in 3D Printing, Part III: the Software
- 22 Years of Linux Journal on One DVD - Now Available
- Giving Silos Their Due
- Controversy at the Linux Foundation
- Don't Burn Your Android Yet
- Firefox OS
- February 2016 Issue of Linux Journal