Alpine email client on NetBSD

NetBSD on an RPi. Mail — Alpine is light and useful. First, installed it:

# pkg_add -v alpine

Then followed this post to try to set up the passwordy stuff, but the openssl command failed, because it found no /etc/openssl/openssl.cnf

I copied one from /etc/ssl/openssl.cnf on my Debian box.

Seemed to work.

Created ~/.pine-passfile with a single empty line in it.

Created my app password for Gmail.

Started Alpine on NetBSD

Followed my own instructions (here), but needed to use novalidate-cert as well.

Did not seem to be saving the password. So I tried this:

I had to create a ssl certificate and install the file in ~/.alpine-smime/private, ~/.alpine-smime/public and ~/.alpine-smime/ca. Only then will the imap password be saved

From: https://unix.stackexchange.com/questions/331927/alpine-refuses-to-save-imap-password

But actually, I had created .pine-passfile in the wrong place, so I am not sure these steps were vital.

But with .pine-passfile in the right place and the above steps done, it did work.

 

OK.

Gmail for older computers and the command line — Alpine

We used to be able to access Gmail from browsers without JavaScript, but that’s no longer the case. So now, if going by browser, I need to install a relatively heavy-duty piece of kit like Firefox or Chrome (heavy compared with say Links or Dillo). But can still get at the email without…

I started by installing Alpine mail reader. On Debian, it’s

$ sudo apt install alpine

I then logged into my Gmail account as usual (ie in Firefox) and went to Settings → Forwarding and POP/IMAP and chose Enable IMAP (IMAP is preferable to POP if I want to use this method on more than one computer — it does a better job of syncing between sessions).

Then clicked on Configuration instructions, opened up Alpine and did what the Google instructions said.

Updated my details as per the gmail website instructions. These websites are also handy:

Compile: http://www.chiark.greenend.org.uk/doc/alpine-doc/tech-notes/installation.html

Save password: https://scienceblogs.com/gregladen/2009/10/08/do-you-want-the-alpine-email-c

But the best guide is at:

https://bcacciaaudio.com/2018/10/09/alpine-mail-setup-with-gmail/

Especially:

Navigate to Setup > Config and check off the following items:

  • Compensate for deficient IMAP servers

  • Combined Folder Display

  • Enable incoming folders collection

  • Enable incoming folders checking

but note that an app-specific password is necessary (or was for me) — this is a 16-letter combination you can generate after logging into your Google account and going to Security (you must have turned on 2-factor authentication, too). Also, unless you want to have to note it down and reenter it multiple times, go to the ‘Save password’ link noted above and turn on Alpine password saving (on Linux, $ touch ~/.pine-passfile). Note that this may be a security issue; the encryption in this file is (apparently) not that strong. I don’t know.

So ran Alpine, went (S)etup and Co(L)lections and (A)dd, then entered:

Nickname : Gmail
Server : imap.gmail.com/ssl/user=first.second@gmail.com
Path :
View :

On hitting ‘Enter’ after the imap line, I was asked for my password. Used the 16-letter app-specific password.

Then, back to the main menu of Alpine and:

(S)etup (C)onfig

Personal Name = <No Value Set: using "Username">
User Domain = gmail.com
SMTP Server (for sending) = smtp.gmail.com:587/tls/user=first.second@gmail.com

See also the Gmail help page — https://support.google.com/mail/answer/7126229.

Also, went to Gmail on the web, and set:

Limit IMAP folders to contain no more than this many messages = 1000

And that allows use of Gmail without JavaScript or even a GUI — no need for X windows, for example. I’m sure other mail clients would work just as well.
screen shot showing the main menu -- Help, Compose, Message Index, Folder List, Address book, Set up and Quit
The Alpine front page
viewing system mail -- three messages
A typical Alpine screen