10

I am using FreeBSD 8.1 and just installed Alpine email client. I wonder if anybody knows how to setup Alpine to get mail from a Gmail account using IMAP.

2

2 Answers 2

9

For clarity, I'm just going to give the directions in terms of what you should add to .pinerc. You can also set all of these setting using the configuration interface if you wish.

To get your mail via IMAP:

inbox-path={imap.gmail.com/ssl/[email protected]}

Include this to make sure you have access to all of the various gmail folders:

folder-collections=Gmail {imap.gmail.com/ssl/[email protected]}[]

I find this useful to mimic "archiving":

default-saved-msg-folder=[Gmail]/All Mail

To send mail via gmail, you need this in .pinerc:

smtp-server=smtp.gmail.com:587/tls/[email protected]

Also, I find that these two settings improve performance a lot:

 rsh-open-timeout=0
 disable-these-authenticators=GSSAPI

If you want alpine to remember your password for you, you can run this command in your home directory:

 touch .pine-passfile

The first time you use alpine after running this command, you will be asked whether you want to save your password for later use each time you enter one.

3
  • 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. 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. Commented Dec 11, 2015 at 11:08
  • And here is this problem mentioned with Gnus: superuser.com/q/963361/65570 Commented Dec 11, 2015 at 11:20
  • 1
    I think the warning about "less secure" is a bit exaggerated. The Fetchmail FAQ has a paragraph about it actually. Commented Jan 6, 2016 at 21:06
1

Short answer: you need to set up with Google API and configure alpine to use xoAuth. It will take you a good hour if doing it for the first time.

The previous answer, involving enabling "less secure" applications in Google account settings, is no longer possible, at least for me, since 2021. I had been setting the "less secure" apps in Gamil to use alpine for 10 years now. Since 2021, even if that setting is enabled, Gmail's IMAP server will still try to redirect the user to a web authentication page. This happened to my various Gmail accounts. This is the end of the password authentication era, and now the only way to get alpine to work with Gmail is to go to Settings -> xoaUth2 and try to get xoAuth working. It still technically uses IMAP except for not its authentication part.

Maybe we should be thankful that Gmail has allowed it for 10 years.

1
  • application specific passwords are still a thing on Google... you sure that you can't make that part still work? Commented May 3, 2021 at 15:50

You must log in to answer this question.