Here is my new email client, based on a few utilities from GNU Mailutils:
#!/usr/bin/env bash
set -e
MAILBOX="$HOME/Mail/inbox.mbox"
movemail --uidl 'pops://<mail server details>:995' "$MAILBOX"
# This sieve step is optional.
sieve -f "$MAILBOX" "$HOME/Mail/filter.sv"
frm -t "$MAILBOX" | tail
You can put this in a script somewhere like $HOME/local/bin/getmail.sh.
You'll have to figure out your mail server details yourself depending
on your email server. There are so many interesting free mail
servers out there other than gmail, but this can probably be made
to work with gmail.
You might use something like this:
username;[email protected].
The info pages for movemail can be helpful here.
And here is the optional ~/Mail/filter.sv file which filters out
spam to a separate file based on POP server-provided spam headers:
require ["fileinto"];
if header :is "X-Spam_action" "reject" {
fileinto "spam.mbox";
stop;
}
Now, you can run getmail.sh which gets any
new messages you have and shows you a few of your latest
ones. Then, open your inbox with a simple client like
mutt to read them and reply:
mutt -f ~/Mail/inbox.mbox
It's a little different than using the gmail web interface. Notably, these methods are so much faster than using any web interface... dare I say, a bit more modern, once you get accustomed.
If you want to leave your mail on the server after you download it,
add the --preserve option to the movemail command. Or
you can handle mail sync in a more complicated way by using IMAP
rather than POP, but why complicate things.