Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to use a terminal based mail client for my e-mail activities. I've been suggested to use alpine for it. But how do I configure it in Ubuntu to read my gmail mails?

share|improve this question
up vote 10 down vote accepted

It's quite straightforward to configure Alpine to access your gmail account via the imap protocol, and there are many tutorials online such as this article.

As you probably know, the first thing to do is to go to the settings in your gmail account and make sure imap is enabled for your account.

Then fetch Alpine with

sudo apt-get install alpine

Alpine was developed at the University of Washington; it is a successor to the old Pine email program; more details are available here at the official site, although there is further development going on at the re-Alpine project. Indeed, the Alpine version in the repositories is re-Alpine version 2.02-3.1.

The following tutorial describes a minimal way to setup Alpine so that you can receive and send mail.

Start up Alpine in terminal by typing alpine, and you come to the main screen. From that main screen (M) go to setup (S) > add a new collection (L), as in the screenshot below. Add the name of the collection (Gmail) and in the server box (adding your proper gmail address of course).

Some guides such as this one and many others will recommend the novalidate-cert option to be added in the above imap line (and in the smtp line quoted later), but it is not necessary with the current version of Alpine, as there is no problem with the certificates.

enter image description here

Then go back to the main menu and go to setup > config (C) and place all your details in the appropriate boxes, as in the screenshot below, with this time adding also the smtp server ( and specifying your inbox path and personal name:

enter image description here

Now save and exit back to the menu. Now with this basic setup you should be able to read and send mail. If you want, you can exit the program and the load it up again to check everything has configured correctly, and the main screen should be something like this:

enter image description here

There are a lot more customisations that can be made and settings experimented with (the users' configuration file is .pinerc in the home folder), and you can even export Thunderbird mail to view in Alpine, as I discuss here:

share|improve this answer
My problem now (which I didn't use to experience earlier, soem years ago with such a configuration) is that Gmail shows me a message with a weblink to confirm the login, but alpine (and pine) don't have have enough length for it to fit. I'd appreciate an advice how to read the weblink through Alpine and confirm the login. – imz -- Ivan Zakharyaschev Dec 11 '15 at 10:50
Here at reddit, they, too, recommend turning on "less secure" apps in Gmail. I'd rather like an explanation what is wanted by Gmail and how to make an app secure. – imz -- Ivan Zakharyaschev Dec 11 '15 at 11:06
And here is this problem mentioned with Gnus: – imz -- Ivan Zakharyaschev Dec 11 '15 at 11:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.