Help for Alpine - XOAUTH2
You are in Home > Miscellaneous > XOAUTH2 > Authorizing Alpine to access Yandex

If you want to use XOAUTH2 to authenticate to the Yandex server, you must set your inbox or incoming folder, and your smtp servers as follows

inbox: {imap.yandex.com/ssl/user=your@id.com/auth=xoauth2}INBOX
smtp: smtp.yandex.com/ssl/user=your@id.com/auth=xoauth2

here your@id.com, is your id to login to Yandex.

Now let's go through the one-time set up of XOAUTH2 in Yandex. First we assume you have already set up Yandex as your inbox or as an incoming folder.

The rest of the set up will happen once you try to open that folder. When you do that, you will see a long message in the screen.

First Setup Screen

Looking at the screen, there are some commands in the menu. The one you will use to setup Alpine is the "C" command, to enter a code. If you do not wish to proceed, simply cancel by pressing "E" to exit. However, before you enter a code you need to open the long URL that appears in the screen. Alpine will attempt to use your web browser to open that link, but you can use any browser. Since you will login into Yandex, you must open this link with a browser that supports Javascript. This is a requirement set up by Yandex, not Alpine. This might mean that persons with disabilities might need additional help to login to Yandex's servers.

If you open the link, you will see a normal login screen. Enter your login and password.

Login Screen for Yandex

Once you complete loging in to your account, you will see the following screen

Warning from Yandex

What you are supposed to do is to click on the link at the bottom of the warning screen, and Allow Alpine access to your account.

Once you click on Allow, you will be given a code. The image below shows part of a code. It is a long string, you probably will have a hard time trying to memorize it.

Code to Access Yandex

Copy this code, and return to Alpine. You will go back to the set up screen where you started this process. Now press "C". It will look as follows

Entering Code into Alpine Prompt

Paste the code into this prompt. You will see something similar to the following

Pasting the code

Finally, press Enter. Alpine will ask you if you want to preserve this code in your password file.

preserve code prompt

You must save this code somehow. It will be used to login into Alpine in the future. For example, when you login to Alpine the next day, or next week. Using your password file is the best way to preserve this code. Do not share it. Anyone who has access to this code could access your account.

You are done! Now you can login to your Yandex account using XOAUTH2. In the future you will not go through this process. Alpine will open your account as soon as you attempt to open your Yandex account. (However, note that this code expires. If you do not access your Yandex account using Alpine for a long time, Yandex will expire this code, and you will have to go through this process again to get a new one.)

Also note that this set up is done on each device that you use Alpine. If you use Alpine in two different devices, you will have to go through this process in each device. Yandex keeps a record of the last 20 codes that it gives you before it deletes them or expires them. If you use one or two of them frequently, you will never have to generate a code again.
You are in Home > Miscellaneous > XOAUTH2