How can I configure alpine to read my gmail in Ubuntu?

38,422

Solution 1

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 imap.gmail.com:993/ssl/[email protected] 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 (smtp.gmail.com:587/tls/[email protected]) 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:

Solution 2

From M S C the following entries in config:

User Domain                       = <No Value Set>                                                                                   
SMTP Server (for sending)         = smtp.gmail.com/novalidate-cert/[email protected]/ssl                                   
NNTP Server (for news)            = localhost                                                                                        
Inbox Path                        = {imap.gmail.com/novalidate-cert/ssl/[email protected]}INBOX                            
Incoming Archive Folders          = <No Value Set>                                                                                   
Pruned Folders                    = <No Value Set>       

plus manually adding the following by opening .pinerc with an editor like vi or nano to add the IMAP folders:

# List of directories where saved-message folders may be. First one is
# the default for Saves. Example: Main {host1}mail/[], Desktop mail\[]
# Syntax: optnl-label {optnl-imap-hostname}optnl-directory-path[]
folder-collections=mail/[],
    gmail {imap.gmail.com:993/ssl/[email protected]}[]

Of course, you can just make all those configurations directly in .pinerc with most any editor.

Share:
38,422

Related videos on Youtube

harisibrahimkv
Author by

harisibrahimkv

I love to write. A 'psycho' path.

Updated on September 18, 2022

Comments

  • harisibrahimkv
    harisibrahimkv over 1 year

    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?

  • imz -- Ivan Zakharyaschev
    imz -- Ivan Zakharyaschev over 8 years
    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
    imz -- Ivan Zakharyaschev over 8 years
    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
    imz -- Ivan Zakharyaschev over 8 years
    And here is this problem mentioned with Gnus: superuser.com/q/963361/65570
  • Alexey Ce
    Alexey Ce over 7 years
    @imz works for me -- for what that's worth. I open alpine from gnome-terminal and use the arrow to select the link, then just press "enter". It either directly opens the link in firefox, or prompts, I don't recall. For me, works seamlesslly....what have you tried?
  • imz -- Ivan Zakharyaschev
    imz -- Ivan Zakharyaschev over 7 years
    @Thufir I believe I wasn't able to select such link with arrows: it just appeared in the status line, and well... how do I get with arrows there? Arrows just allow me to move through the menu items, don't they?
  • Alexey Ce
    Alexey Ce over 7 years
    @imz--IvanZakharyaschev screeshot here: askubuntu.com/a/870251/45156 go there and make comments. You may need to post your .pinerc file, or selected portions thereof and ask your own question. Hope that helps. I can look further in .pinerc if you can't find config. Or, just edit the question to "make it your own." Hijack it :)
  • imz -- Ivan Zakharyaschev
    imz -- Ivan Zakharyaschev over 7 years
    @Thufir Your example has some text with URL. This is "clickable", I know. But in my case, the URL is not in a text, it's not in the main screen. I've explained this already: it's an error message from the IMAP server (not in an email message!), and it is shown not in the main screen, but in the "status" line at the bottom. Have you ever "clicked" successfully a link in such a case?
  • Alexey Ce
    Alexey Ce over 7 years
    @imz--IvanZakharyaschev you need to ask an actual question IMO. Can you include screenshot/copy text etc? In pine you can use v. When you say error message from the server...I'm thinking logs. Dunno whether pine logs...doubt it.
  • imz -- Ivan Zakharyaschev
    imz -- Ivan Zakharyaschev over 7 years
    @Thufir Have you ever seen the "status" lines at the bottom of (Al)pine like: [Already at end of Index] or [No more messages in folder]. The password prompt also appears in the same bottom line. The URL I'm talking about also appears in there, and it is abbreviated. No way to click it. A screenshot is not needed because this is trivial for anyone who's been using (Al)pine: I saw this problem years ago, and I don't need to reproduce it to remember what it looks like because it can be explained through the basic elements of UI. Your misunderstanding proves we'd better have a screenshot...
  • Alexey Ce
    Alexey Ce over 7 years
    @imz--IvanZakharyaschev dunno what to tell you. mailing list is all I can suggest.
  • imz -- Ivan Zakharyaschev
    imz -- Ivan Zakharyaschev over 7 years
    @Thufir Yes, my comment was a way to write down a thing that could be enhanced in alpine. If someone or me has enough time and expertise, he could make a patch to handle this inconvenience after reading this comment. (I prefer to share my remarks about FLOSS in order to help its advancement to the extent that I am able to invest my energy.) I do not expect that you can help with this issue by writing just an answer; I suspect that one could help only by writing the solution as a patch to alpine. A patch would be a solution to the issue I have mentioned in my comment.
  • Alexey Ce
    Alexey Ce over 7 years
    I encourage you again to utilize the mailing list for that. It might even be logged somewhere.
  • imz -- Ivan Zakharyaschev
    imz -- Ivan Zakharyaschev over 7 years
    @Thufir Yes, that must be more effective. I even used to be a subscriber and a seldom participant of the related mailing lists...