From bbfbb2b668fc4a590a505a5f852eac9ea8a59da2 Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Thu, 9 Jul 2020 11:58:47 -0600 Subject: * Addition of Yandex.com to the list of services that Alpine can use XOAUTH2 to authenticate for reading and sending email. --- alpine/imap.c | 29 +++++++++++++++++++++++++++++ alpine/xoauth2.h | 5 +++++ alpine/xoauth2conf.c | 1 + pith/pine.hlp | 5 ++++- 4 files changed, 39 insertions(+), 1 deletion(-) diff --git a/alpine/imap.c b/alpine/imap.c index fe4fdcec..bf5f9aea 100644 --- a/alpine/imap.c +++ b/alpine/imap.c @@ -232,6 +232,35 @@ OAUTH2_S alpine_oauth2_list[] = 0, /* first time indicator */ 1 /* client secret required */ }, + {"Yandex", + {"imap.yandex.com", "smtp.yandex.com", NULL, NULL}, + {{"client_id", NULL}, + {"client_secret", NULL}, /* not used, but needed */ + {"tenant", NULL}, /* not used */ + {"code", NULL}, /* used during authorization */ + {"refresh_token", NULL}, + {"scope", NULL}, /* not needed, so not used */ + {"redirect_uri", "https://oauth.yandex.ru/verification_code"}, + {"grant_type", "authorization_code"}, + {"grant_type", "refresh_token"}, + {"response_type", "code"}, + {"state", NULL}, /* not used */ + {"device_code", NULL} /* not used */ + }, + {{"GET", "https://oauth.yandex.com/authorize", /* Get Access Code */ + {OA2_Id, OA2_Redirect, OA2_Response, OA2_End, OA2_End, OA2_End, OA2_End}}, + {NULL, NULL, {OA2_End, OA2_End, OA2_End, OA2_End, OA2_End, OA2_End, OA2_End}}, /* device code, not used */ + {"POST", "https://oauth.yandex.com/token", /* Get first Refresh Token and Access token */ + {OA2_Id, OA2_Redirect, OA2_GrantTypeforAccessToken, OA2_Secret, OA2_Code, OA2_End, OA2_End}}, + {"POST", "https://login.microsoftonline.com/\001/oauth2/v2.0/token", /* Get access token from refresh token */ + {OA2_Id, OA2_RefreshToken, OA2_GrantTypefromRefreshToken, OA2_Secret, OA2_End, OA2_End, OA2_End}} + }, + {NULL, NULL, NULL, 0, 0, NULL}, /* device_code information, not used */ + NULL, /* access token */ + 0, /* expiration time */ + 0, /* first time indicator */ + 1 /* client secret required */ + }, { NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0}, }; diff --git a/alpine/xoauth2.h b/alpine/xoauth2.h index 739a3b71..0a17a222 100644 --- a/alpine/xoauth2.h +++ b/alpine/xoauth2.h @@ -25,4 +25,9 @@ #define OUTLOOK_SECRET "Tk-DAcEi13-FeSsY_Ja4Y.-MyL66I.wIPt" #define OUTLOOK_TENANT "common" +#define YANDEX_NAME "Yandex" +#define YANDEX_ID "393578fee26f47858023cf59681882a7" +#define YANDEX_SECRET "7304c4993583498f8ab63e2f21ad6960" +#define YANDEX_TENANT NULL + #endif /* ALPINE_XOAUTH2_INCLUDED */ diff --git a/alpine/xoauth2conf.c b/alpine/xoauth2conf.c index f930be6b..11c53766 100644 --- a/alpine/xoauth2conf.c +++ b/alpine/xoauth2conf.c @@ -28,6 +28,7 @@ extern OAUTH2_S alpine_oauth2_list[]; XOAUTH2_INFO_S xoauth_default[] = { { GMAIL_NAME, GMAIL_ID, GMAIL_SECRET, GMAIL_TENANT, NULL, NULL}, { OUTLOOK_NAME, OUTLOOK_ID, OUTLOOK_SECRET, OUTLOOK_TENANT, NULL, NULL}, + { YANDEX_NAME, YANDEX_ID, YANDEX_SECRET, YANDEX_TENANT, NULL, NULL}, { NULL, NULL, NULL, NULL, NULL, NULL} }; diff --git a/pith/pine.hlp b/pith/pine.hlp index 965e6424..425eb1b7 100644 --- a/pith/pine.hlp +++ b/pith/pine.hlp @@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any reasonable place to be called from. Dummy change to get revision in pine.hlp ============= h_revision ================= -Alpine Commit 490 2020-07-09 10:17:35 +Alpine Commit 491 2020-07-09 11:58:15 ============= h_news ================= @@ -199,6 +199,9 @@ problems you find with this release. the credentials in the XOAUTH2 configuration screen. Learn more. +
  • Addition of Yandex.com to the list of services that Alpine can use XOAUTH2 to + authenticate for reading and sending email. +
  • Addition of a link to the Apache License 2.0 (see above). This is available from the Release Notes as well as the welcome screen. -- cgit v1.2.3-70-g09d2