Why would you use a command line mail client when the GMail web client is accessible from anywhere and has a myriad of useful features?
- You have an older computer and the javascript heavy web client takes too long to load.
- You work primarily in a CLI environment, use a terminal multiplexer, and would like to be able to read your email without spinning up a browser instance.
For my particular use case, the first bullet point is the reason why I wanted to try setting up Alpine. Loading GMail on my older under powered laptop was taking far too long. Below is the process I used to configure everything.
Downsides
There are some convenient features that you’ll be missing from the web client such as:
- Access to and autocomplete of email addresses in your Google Contacts. (although there is discussion of an inelegant work around)
- Rich text email reading/composition.
Installing
I’m setting this up on Kubuntu 18.04 LTS. The first step is to install Alpine using the following command:
sudo apt install alpine
Server setup
IMAP Setup
Launch Alpine. Navigate to Main>Setup>collectionLists>Add and add in the following settings:
Nickname : Gmail (or whatever you would like to name the folder)
Server : imap.gmail.com/ssl/user=youruserid@gmail.com (ex: youremail@gmail.com)
Path :
View :
Press enter. When prompted, enter your password.
If you are using Gmail 2FA, your login password will not be accepted. You will need to create a specialized Google App password in the Gmail Privacy and Security settings and enter that in instead.
SMTP Setup
Navigate to Setup > Config and enter in the following information for SMTP Server:
smtp.gmail.com:587/tls/user=youruserid@gmail.com (ex: youremail@gmail.com)
Folder setup
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
Deleting mail
To properly delete email in Alpine so that it shows up in the Trash folder on Gmail, do the following:
- Select the message and press Shift + S to mark it to be saved.
- Press Ctrl + T to show the folder menu.
- Select [Gmail]/Trash as the folder.
- Confirm your choice and save.
Tips
- By default, Alpine checks for new mail every 150 seconds. You can change this in the Config screen by changing the Mail Check Interval value. Press Ctrl + L to force updating/checking of a folder.
Reference pages
- Initial server setup: https://www.cs.virginia.edu/~csadmin/wiki/index.php/Setting_up_Pine_(Alpine)_for_IMAP_Gmail
- Explanation of Gmail non standard folder behavior: https://superuser.com/questions/454263/deleting-gmail-messages-from-alpine
- Settings that should be enabled for folder views: https://accc.uic.edu/answer/how-do-i-use-pine-alpine-googleapps