Alpine is a CLI email client for BSD and GNU/Linux. Not a difficult program to learn and use, but setting up multiple accounts can be tricky, and not as obvious as it should be.

Several reasons exist for usage of a CLI tool. One reason is setting up on a remote server that you can have as a hub for all your mail that can be ssh'ed into and have all your accounts setup and ready, along with any special configuration such as macros, etc. This can be especially handy when using portable devices such as a PiTop, PocketChip, etc. This allows for zero config, as your remote system is already good-to-go.

Also, it can be faster than a GUI in many cases. Caveat is, of course, that you must get proficient with the tool (mutt is an alternative).

Whatever is the case for you, here is a quick and dirty primer on getting setup and using Alpine. Happy hacking!

INSTALLATION

SETUP IMAPS AND BASIC SMTPS

  1. Run alpine

    alpine
    
  2. At the main screen type 's' then 'c' to get to the configuration page

  3. Set "User Domain" to be the fqdn of your main account. So if you have the account me@test.com, set it to test.com
  4. Set "SMTP Server" to be your smtp server with the following format to handle users logging in (presuming TLS security, change port as appropriate):
    mail.server.com:587/tls/user=user@mail.server.com
    
    1. Type 'e' to exit setup, and save changes when prompted to
    2. Type 's' then 'l' to enter the incoming accounts (also named Collections by Alpine) area
    3. Type 'a' to add an account
    4. Fill in the nickname field. Then fill in the server field using the following format (presuming imaps here)

      mail.server.com/ssl/user=user@mail.server.com 9. You will be prompted for a password for the account, provide it. 10. Type CTL+X to save settings and go back to the account list 11. Repeat as need be to add all accounts you have.

MULTIPLE SMTP

Usage of multiple SMTP servers requires the setup of role(s). The following is a rough guide on how to accomplish this

  1. Goto the "Setup Role Rules" screen by typing 'm' 's' 'r' 'r'
  2. Add a role by typing 'a'
  3. Enter role name in the Nickname field
  4. Under "Current Folder Type", select "Specific", and fill in the "Folder List" field below it with the incoming nickname(s) you want the role to handle.
  5. Scroll down to "Actions Begin Here" section and fill in the "Set From" field

    Desired Display Name <username@server.tld>
    
  6. Go to the "Use SMTP Server" and fill in the field

    smtp.server.tld:port/novalidate-cert/ssl/user=username@server.tld
    
  7. Go to the "Uses Begin Here" section, and select "Without Confirmation" for each of Reply, Forward, and Compose Use. This will stop Alpine from asking what role you want to use, and instead use the role assigned to the mail folder, as defined by the "Folder List" back at the top of the screen.

MANIPULATION OF MESSAGES

Some of the common commands:

Keypress Action
d delete message
o other commands
q quit Alpine
s save message
CTL+C cancel
? help screen with ALL of the commands available

Now a tip : when you highlight or enter a message, you can type 's' to "Save" it to another file or move it to another mailbox. On multi-collection setups, you may have the wrong collection pre-selected, so use CTL+N or CTL+P to change the collection. You will see the

Default prompt, with the standard, local, mailbox:

    SAVE Msg #1 to folder in <Mail> [saved-messages] :

Changed collection

    SAVE Msg #1 to folder in <andrew@andrew...> [saved-messages] :

From here you may type in your new folder you want to plop the message into (such as 'Archive')

    SAVE Msg #1 to folder in <andrew@andrew...> [saved-messages] : Archive

NOTES

SOURCES