The Heirloom mailx package (formerly known as the Nail package) contains mailx, a command-line Mail User Agent derived from Berkeley Mail. It is intended to provide the functionality of the POSIX mailx command with additional support for MIME messages, IMAP (including caching), POP3, SMTP, S/MIME, message threading/sorting, scoring, and filtering. Heirloom mailx is especially useful for writing scripts and batch processing.
This package is known to build and work properly using an LFS 13.0 platform.
Download (HTTP): https://anduin.linuxfromscratch.org/BLFS/mailx/heirloom-mailx_12.5.orig.tar.gz
Download MD5 sum: 29a6033ef1412824d02eb9d9213cb1f2
Download size: 317 KB
Estimated disk space required: 3.2 MB
Estimated build time: less than 0.1 SBU
nss-3.120.1, MIT Kerberos V5-1.22.2 (for IMAP GSSAPI authentication), and an MTA
This package does not support parallel build.
Install Heirloom mailx by running the following commands.
patch -Np1 -i ../heirloom-mailx-12.5-fixes-1.patch &&
sed 's@<openssl@<openssl-1.0/openssl@' \
-i openssl.c fio.c makeconfig &&
make -j1 LDFLAGS+="-L /usr/lib/openssl/" \
SENDMAIL=/usr/sbin/sendmail
This package does not come with a test suite.
Now, as the root user:
make PREFIX=/usr UCBINSTALL=/usr/bin/install install && ln -v -sf mailx /usr/bin/mail && ln -v -sf mailx /usr/bin/nail && install -v -m755 -d /usr/share/doc/heirloom-mailx-12.5 && install -v -m644 README /usr/share/doc/heirloom-mailx-12.5
make
SENDMAIL=/usr/sbin/sendmail: This changes the
default MTA path of sendmail to /usr/sbin/sendmail, instead of using /usr/lib/sendmail.
make PREFIX=/usr
UCBINSTALL=/usr/bin/install install: This changes
the default installation path from /usr/local and the default install command path from
/usr/ucb.
For displaying mail, mailx uses
a pager program. Since the default of pg is not available on a LFS
system, you need to specify which pager mailx is supposed to use. By
default, the more
and the more comfortable less commands are installed. If
the PAGER environment variable is not
set in /etc/profile or ~/.bash_profile, or if it should be set to
another pager specifically for reading mails, it can be set
system wide in /etc/nail.rc as the
root user:
echo "set PAGER=<more|less>" >> /etc/nail.rc
or for the current user in ~/.mailrc:
echo "set PAGER=<more|less>" >> ~/.mailrc
Other interesting options to set in the config files might be EDITOR and MAILDIR.
If the default editor is not set in the environment for other
packages, it can be set by running the following command as the
root user:
echo "set EDITOR=<vim|nano|...>" >> /etc/nail.rc
Depending on which kind of MTA is
installed, it might be necessary to set the MAILDIR variable so
that mailx is able to find mail
as the root user:
echo "set MAILDIR=Maildir" >> /etc/nail.rc