Skip to the content.

19. Mail/News Clients


Mail Clients help you retrieve (Fetchmail), sort (Procmail), read and compose responses (Heirloom mailx, Mutt, Pine, Kmail, Balsa, Evolution, SeaMonkey) to email.

News clients also help you retrieve, sort, read and compose responses, but these messages travel through USENET (a worldwide bulletin board system) using the Network News Transfer Protocol (NNTP).

19.1 Fetchmail-6.4.36


Introduction to Fetchmail

The Fetchmail package contains a mail retrieval program. It retrieves mail from remote mail servers and forwards it to the local (client) machine’s delivery system, so it can then be read by normal mail user agents.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Fetchmail Dependencies

a local MDA (Procmail-3.22)

Optional

MIT Kerberos V5-1.20.1 and libgssapi

Optional (for running fetchmailconf)

Python-3.11.2, built after Tk-8.6.13, with the py-future package

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/fetchmail

Installation of Fetchmail

Create a dedicated user for the fetchmail program. Issue the following commands as the root user:

useradd -c "Fetchmail User" -d /dev/null -g nogroup \
        -s /bin/false -u 38 fetchmail

Install Fetchmail by running the following commands:

PYTHON=python3 \
./configure --prefix=/usr \
            --enable-fallback=procmail &&
make

To test the results, issue: make check.

Now, as the root user:

make install                                  &&
chown -v fetchmail:nogroup /usr/bin/fetchmail

Command Explanations

PYTHON=python3: a version of Python is required, but only used to install a module to allow fetchmailconf to be run. That module is unmaintained and should not be used.

--enable-fallback=procmail: This tells Fetchmail to hand incoming mail to Procmail for delivery, if the port 25 mail server is not present or not responding.

Configuring Fetchmail

Config Files

~/.fetchmailrc

Configuration Information

Note

If you are connecting to a mailserver that supports SSL/TLS-wrapped or “implicit” mode on a dedicated port (default 993) you should use fetchmail –ssl or add the option ‘ssl’ in an rcfile.

cat > ~/.fetchmailrc << "EOF"

# The logfile needs to exist when fetchmail is invoked, otherwise it will
# dump the details to the screen. As with all logs, you will need to rotate
# or clear it from time to time.
set logfile fetchmail.log
set no bouncemail
# You probably want to set your local username as the postmaster
set postmaster <username>

poll SERVERNAME :
    user <isp_username> pass <password>;
    mda "/usr/bin/procmail -f %F -d %T";
EOF

touch ~/fetchmail.log       &&
chmod -v 0600 ~/.fetchmailrc

This is an example configuration that should suffice for most people. You can add as many users and servers as you need using the same syntax.

man fetchmail: Look for the section near the bottom named CONFIGURATION EXAMPLES. It gives some quick examples. There are countless other configuration options once you get used to it.

If you expect to receive very little mail you can invoke fetchmail when you wish to receive any incoming mail. More commonly, it is either invoked in daemon mode with the -d option either on the command line, or in .fetchmailrc (see ‘DAEMON MODE’ in man fetchmailconf), or alternatively it is invoked from a cron job.

Contents

Installed Programs: fetchmail and fetchmailconf

Installed Libraries: None

Installed Directories: None

Short Descriptions

fetchmail when executed as a user, this will source ~/.fetchmailrc and download the appropriate mail

fetchmailconf is intended to assist you in setting up and editing a ~/.fetchmailrc configuration file, by using a Tk GUI interface. It is written for Python and the Tkinter module but is labelled with a WARNING that it needs to be updated for fetchmail 6.4’s SSL options and other recent new options.

19.2 mailx-12.5


Introduction to Heirloom mailx

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 11.3 platform.

Package Information

Additional Downloads

Heirloom mailx Dependencies

Optional

nss-3.88.1, MIT Kerberos V5-1.20.1 (for IMAP GSSAPI authentication), and an MTA

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/mailx

Installation of Heirloom mailx

Note

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

Command Explanations

make SENDMAIL=/usr/sbin/sendmail: This changes the default MTA path of /usr/lib/sendmail.

make PREFIX=/usr UCBINSTALL=/usr/bin/install install: This changes the default installation path of /usr/local and the default install command path of /usr/ucb.

Configuring Heirloom mailx

Config Files

/etc/nail.rc and ~/.mailrc

Configuration Information

For displaying mails, mailx uses a pager program. Since the default of pg is not available on a LFS system, its required to specify which pager is to use. By default, there is more and the more comfortable less installed. If the variable PAGER is not set in /etc/profile or ~/.bash_profile, or if it should be another pager just for reading mails, it can be set system wide in /etc/nail.rc:

echo "set PAGER=<more|less>" >> /etc/nail.rc

or individually for the actual user in ~/.mailrc:

echo "set PAGER=<more|less>" >> ~/.mailrc

Other interesting options to set in the config files might be EDITOR and MAILDIR.

If not set in the environment for other packages, the default editor can be set by:

echo "set EDITOR=<vim|nano|...>" >> /etc/nail.rc

Depending on which kind of MTA is installed, it might be required to set the MAILDIR variable so mailx is able to find the mails:

echo "set MAILDIR=Maildir" >> /etc/nail.rc

Contents

Installed Programs: mail, mailx and nail

Installed Libraries: None

Installed Directories: None

Short Descriptions

mailx is a command-line mail user agent compatible with the mailx command found on commercial Unix versions.

mail is a symbolic link to mailx.

nail is a symbolic link to mailx.

19.3 Mutt-2.2.9


Introduction to Mutt

The Mutt package contains a Mail User Agent. This is useful for reading, writing, replying to, saving, and deleting your email.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Mutt Dependencies

Lynx-2.8.9rel.1, or Links-2.28 (or W3m, or ELinks) - please read the Note.

Optional

Aspell-0.60.8, Cyrus SASL-2.1.28, DocBook-utils-0.6.14, GDB-13.1, GnuPG-2.4.0, GnuTLS-3.8.0, GPGME-1.18.0, libidn-1.41, MIT Kerberos V5-1.20.1, an MTA (that provides a sendmail command), slang-2.3.3, SQLite-3.40.1, libgssapi, Mixmaster, QDBM or Tokyo Cabinet

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/mutt

Installation of Mutt

Note

Mutt ships with an HTML version of its manual, but the text version is no longer provided because differences in the formatting from different text browsers compared to the shipped version caused complaints. To get a text file, the following are used in order of preference: lynx with overstriking (backspaces) for emphasis, w3m or elinks: the latter two apparently provide plain text. Plain text is generally preferred unless reading the HTML manual, so the instructions below use lynx if available, or else links to produce plain text.

Mutt requires a group named mail. You can add this group, if it does not exist, with this command:

groupadd -g 34 mail

If you did not install an MTA, you need to modify the ownership of /var/mail with this command:

chgrp -v mail /var/mail

Install Mutt by running the following commands:

To ensure that a plain text manual is created when using lynx or to otherwise use links to produce it (instead of elinks), run the following command:

sed  -e 's/ -with_backspaces//' \
     -e 's/elinks/links/'       \
     -e 's/-no-numbering -no-references//' \
     -i doc/Makefile.in

Now configure and build the application:

./configure --prefix=/usr                           \
            --sysconfdir=/etc                       \
            --with-docdir=/usr/share/doc/mutt-2.2.9 \
            --with-ssl                              \
            --enable-external-dotlock               \
            --enable-pop                            \
            --enable-imap                           \
            --enable-hcache                         \
            --enable-sidebar                        &&
make

This package does not come with a test suite.

Now, as the root user:

make install

Note

If you used a DESTDIR method to only install to a temporary location as a regular user (as part of a package management process), you will need to run the following as the root user after completing the real install:

chown root:mail /usr/bin/mutt_dotlock &&
chmod -v 2755 /usr/bin/mutt_dotlock

An info file is now installed, so you will also need to recreate the /usr/share/info/dir as described when Texinfo was installed in LFS.

Command Explanations

sed ... -e 's/ -with_backspaces//' ...: This turns off the backspaces used for overstriking when lynx is used, resulting in readable plain text when using view.

sed ... -e 's/elinks/links/' ...: This allows links to be run instead of elinks which is not in the book.

sed ... -e 's/-no-numbering -no-references//' ...: This removes switches which are not understood by links.

--enable-external-dotlock: In some circumstances the mutt-dotlock program is not created. This switch ensures it is always created.

--enable-pop: This switch enables POP3 support.

--enable-imap: This switch enables IMAP support.

--enable-hcache: This switch enables header caching.

--enable-sidebar: This switch enables support for the sidebar (a list of mailboxes). It is off by default, but can be turned on by :set sidebar_visible in mutt (and off again with ‘:unset’), or it can be enabled in ~/.muttrc.

--with-ssl: This parameter adds SSL/TLS support from openssl in POP3/IMAP/SMTP.

--enable-autocrypt --with-sqlite3: These two switches add support for passive protection against data collection, using gnupg and gpgme (gpgme is enabled by autocrypt). See The Manual.

--enable-gpgme: This switch enables GPG support through the GPGME package. Use this switch if you want GPG support in Mutt.

--enable-smtp: This switch enables SMTP relay support.

--with-idn2: Use this parameter if both libidn and libidn2 have been installed, and you wish to use libidn2 here.

--with-sasl: This parameter adds authentication support from Cyrus SASL-2.1.28 in POP3/IMAP/SMTP if they are enabled. Depending on the server configuration, this may not be needed for POP3 or IMAP. However, it is needed for SMTP authentication.

Configuring Mutt

Config Files

/etc/Muttrc, ~/.muttrc, /etc/mime.types, and ~/.mime.types

Configuration Information

No changes in these files are necessary to begin using Mutt. When you are ready to make changes, the man page for muttrc is a good starting place.

In order to utilize GnuPG, use the following command:

cat /usr/share/doc/mutt-2.2.9/samples/gpg.rc >> ~/.muttrc

Contents

Installed Programs: flea, mutt, mutt_dotlock, muttbug, pgpewrap, mutt_pgpring, and smime_keys

Installed Libraries: None

Installed Directories: /usr/share/doc/mutt-2.2.9

Short Descriptions

flea is a script showing where to report bugs

mutt is a Mail User Agent (MUA) which enables you to read, write and delete your email

mutt_dotlock implements the mail spool file lock

muttbug is a script identical to flea

pgpewrap prepares a command line for the GnuPG-2.4.0 utilities

pgpring is a key ring dumper for PGP. It is not needed for GnuPG-2.4.0

smime_keys manages a keystore for S/MIME certificates.

19.4 Procmail-3.22


Introduction to Procmail

The Procmail package contains an autonomous mail processor. This is useful for filtering and sorting incoming mail.

This package is known to build and work properly using an LFS 11.3 platform.

Package Information

Additional Downloads

Procmail Dependencies

A MTA that installs sendmail

Optional

libnsl-2.0.0

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/procmail

Installation of Procmail

This package does not come with a test suite.

Install Procmail by running the following commands as the root user:

sed -i 's/getline/get_line/' src/*.[ch]                   &&
patch -Np1 -i ../procmail-3.22-consolidated_fixes-1.patch &&

make LOCKINGTEST=/tmp MANDIR=/usr/share/man install       &&
make install-suid

Command Explanations

sed -i ‘s/getline/get_line/’ src/*.[ch]: This renames procmail’s getline function to avoid conflict with the getline function from glibc.

make LOCKINGTEST=/tmp install: This prevents make from asking you where to test file-locking patterns.

make install-suid: Modifies permissions of the installed files.

Configuring Procmail

Config Files

/etc/procmailrc and ~/.procmailrc

Configuration Information

Recipes have to be written and placed in ~/.procmailrc for execution. The procmailex man page is the starting place to learn how to write recipes. For additional information, see also https://pm-doc.sourceforge.net/.

Contents

Installed Programs: formail, lockfile, mailstat and procmail

Installed Libraries: None

Installed Directories: None

Short Descriptions

formail is a filter that can be used to format mail into mailbox format

lockfile is a utility that can lock a file for single use interactively or in a script

mailstat prints a summary report of mail that has been filtered by procmail since the last time mailstat was ran

procmail is an autonomous mail processor. It performs all the functions of an MDA (Mail Delivery Agent).

19.5 Other Mail and News Programs


Balsa-2.6.4 is a GTK2 based mail client.

SeaMonkey-2.53.15 includes both a mail client and newsreader in its installation.

Thunderbird-102.8.0 is a mail/news client based on the Mozilla code base.