Gernot Walzl

Fetchmail

This article describes an old-school email client setup.

Why is an email solution from the 1990s still useful in the 2020s?

Contents

Procmail

Procmail is a simple mail delivery agent (MDA).
If a given regular expression is matched,
the mail is delivered into the specified mailbox.

Installation:

sudo apt install procmail

Specify the local mail directories:

$HOME/.procmailrc
MAILDIR=$HOME/Mail
DEFAULT=$MAILDIR/default/
LOGFILE=$MAILDIR/procmail.log

:0
* ^TO_johndoe@gmx\.net
johndoe@gmx.net/

:0
* ^From.*johndoe@gmx\.net
johndoe@gmx.net/.Sent/

Ensure the directories exist:

mkdir -p $HOME/Mail/default
mkdir -p $HOME/Mail/johndoe@gmx.net

Fetchmail

Fetchmail is a mail retrieval agent (MRA).

Installation:

sudo apt install fetchmail

Configure the email account:

$HOME/.fetchmailrc
poll imap.gmx.net
    protocol imap
    username "johndoe@gmx.net"
    password "secretpassword"
    ssl
    folders INBOX,Sent,Gesendet
    keep
    mda "/usr/bin/procmail -d %T"

Because the file contains passwords,
ensure that only the file owner can read it:

chmod 0600 $HOME/.fetchmailrc

Download new emails:

fetchmail

Download all emails:
(might create duplicates)

fetchmail --all

Mutt

Mutt is a terminal-based mail user agent (MUA), an email client.

Installation:

sudo apt install mutt

View and search downloaded emails:

mutt -f $HOME/Mail/johndoe@gmx.net/
CONTENT.html source 2023-05-10 3 KB
delete_duplicates_maildir.py source 2023-04-30 4.3 KB
delete_duplicates_maildir.py
2023-04-29
by Gernot Walzl
If `fetchmail --all` is run twice, duplicate messages will be in the mailbox.
This script cleans the maildir from multiple messages with the same content.
imap_client_list_folders.py source 2023-05-10 1.1 KB
imap_client_list_folders.py
2023-05-10
by Gernot Walzl