summaryrefslogtreecommitdiff
path: root/mail-client/claws-mail
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-07-24 02:52:00 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-07-24 02:52:00 +0100
commite19b21c73e5feac42ade97baf3eeb45c58a2f234 (patch)
treef524a01a657ca0dd25be3a5bf70fbb6b694b0275 /mail-client/claws-mail
parentfceabcd48faf4c890719a14ac4ed93b6b7993364 (diff)
gentoo auto-resync : 24:07:2022 - 02:51:59
Diffstat (limited to 'mail-client/claws-mail')
-rw-r--r--mail-client/claws-mail/Manifest3
-rw-r--r--mail-client/claws-mail/claws-mail-4.1.0-r1.ebuild1
-rw-r--r--mail-client/claws-mail/files/claws-mail-4.1.0-disable_gnutls.patch641
3 files changed, 644 insertions, 1 deletions
diff --git a/mail-client/claws-mail/Manifest b/mail-client/claws-mail/Manifest
index 95c2eb98be8e..6034d3dc0d36 100644
--- a/mail-client/claws-mail/Manifest
+++ b/mail-client/claws-mail/Manifest
@@ -1,5 +1,6 @@
AUX claws-mail-3.17.5-enchant-2_default.patch 1284 BLAKE2B 076c2aa8c121e656a0b15f341b6a4b13a114348faba4bb0f298306379b26374c45719702949a5e64f35f718bd656366838ea6b867c7b18fef588f37d7d99cd9f SHA512 ac7ae41be0bc8303974c9f675ab9a0d3e6b5fbae8d569d0b87dfe2e2f72c22f3cefb64796107e393a392b8be1aa7c8d93319cd06cf57ac7517067091ff69da05
AUX claws-mail-3.19.0-perl-5.36.patch 11254 BLAKE2B 0c348bc581a83e068dcf9afa0d0b526fe831983d86576e2eb2a4cb2b6c07a0e6d28f71eea1865e5b44e2849d981741b5552598ed4387184e07d90c1b42928c72 SHA512 38699d82ac108012bd9416dc67b0f1bb50bfea30bdd5df36d49ea899f2dc905ec53d77bff2f33a17741eecbf533019f50825bbde46af5e9c29e20001b8aef499
+AUX claws-mail-4.1.0-disable_gnutls.patch 19822 BLAKE2B 7dc777cecababa089d299c8209a3198ac3066cbe6e27931fe541c8337e98dd3b564f14641b63bbbf1c0546168ac37e6dba9452cf57298fe3359371fe08bd8714 SHA512 0919161f4968249bddf6f8186cbd3b4dcc1d618d656fd5e7b8a5e51a08e24b4d322d38dfdea1ca6b950554afd86e515debdbb2ddf8205f9befcd9a9f88a97feb
AUX claws-mail-4.1.0-perl-5.36.patch 11183 BLAKE2B ecbdfcfb8ecbf73bc8e74cc90de173a15b1a2634c0a55455a63933f53bccb1639bd475018e864d02e5aa248b14e25c43a6de0c7356a6ec7c3d352f2879e4c6ae SHA512 105ab6596aa540bc901e30072371271e8c9874bdc97dac0ff15084bed1b44a5dbaca1e5e9548e32c648e8599ac8dccae041dd42ad202dd3f224dc138e19625aa
DIST claws-mail-3.18.0.tar.xz 6517632 BLAKE2B 534a37a081ceeb4d3066717d738d04e2027d38c621c15091506ec117a3b592eedb6f3c67afddd972424976398019fda3d618db4083f0a05f39e7b8f07a1c2138 SHA512 3f73e11fc75234c44c0faf266a196c7f1c80b837fb920fc4a3979ede81f37efd180c006ab6436ae9c2dffde2d6c3bf6340a90d93e1e3fa8821fb09693d030811
DIST claws-mail-3.19.0.tar.xz 6543188 BLAKE2B eeb7df2b921dbd7ad40c845804fcabe5ddc2064fcf410e7809004be472bbe2ba8bfd89a868420a1bb76845180856fee8a0b3cde879ae67b1a1aab14442fe5d2d SHA512 88780df55873919197d3c6df5102a8eb89a586e8287419c179e1d0af839435a719814b1e3643aa783a7badeadceafda2dc3cb4a3265432b5ad3a210663922b20
@@ -7,6 +8,6 @@ DIST claws-mail-4.1.0.tar.xz 6471604 BLAKE2B 30d1725c2679e8a0b44edd6c30b15f28633
EBUILD claws-mail-3.18.0-r3.ebuild 5631 BLAKE2B 82456d518d3316d71923667da8743142d7df7d631544e516bbee05ae555eca221bc73f374ba8afaf57c87f2cd97bbd2fc22728ce36c905553672271f8fe21a89 SHA512 b256cb224632450a22bd3fb66ae75cbeeb3e0524e964d6cf48cdc92a50ae00c3c22b83047a1a639c00e0abb252970b8e7d888c0cd639cc8c3340062f2f82bea1
EBUILD claws-mail-3.19.0-r1.ebuild 5628 BLAKE2B bdcc26e9b0c046dc1ecc260826ee1f67c2b23dd33c6f8fecd1dedfb545025ed02a0c1af14dedb9fae5b173551a3aad3d590cf66cddada6c562ef633626a9361d SHA512 43e89901736039d38138455cbaa60679781dafbec1f97e7028d7785b7188222cce3908a7330f74ff7c0d354b8a17c905c33f197f573410bac4ec0074f7b7eeef
EBUILD claws-mail-3.19.0-r2.ebuild 5674 BLAKE2B 2e7d16867ff97f487479672a09cebd43e6867e922f51834e1111095d7da20fe733f871daa5ea90f4dfb633d14bc1a454a75cee11346e8ef0a610bed37b1748df SHA512 ef74c181adb25adb3c5bc1b672c6435a9293005db1513e5ab1de47b9d1e2164dcb3752cbadb05e4ad7873a04870704819db12d83dd289d559a684625f2473d7e
-EBUILD claws-mail-4.1.0-r1.ebuild 5755 BLAKE2B a9a2389e5a7cb9b06b92e991cc49d6b63776d70712b4ea21106df662e2de6e2084f2f79adf88b38b6f48b29b2c4ebf9e2cb74df34efc29d039030c6cef06944e SHA512 c108da72f328ac22a578d1a34926d8482053e6eb8a6385594305b1088a38962c97f21a9fe1ccffbdb01c84a3fc02c82ea018729cb5bb67d8887d5f9a8378a924
+EBUILD claws-mail-4.1.0-r1.ebuild 5803 BLAKE2B f28c848ac152e31c6b94b853e683e7f9e7fc6bcd9ce1a167e87d2e5b8f110b7cffc60891a992f94559943fd1803cbbca4548275f4c9c2619a33f1e97255a60cc SHA512 757d373627aa3496cbade99d31ac57810ba07ff4093a6f8146b890647ce7cb7f95c632688cdd32e7c7a71094b12b67ba996db62f16e36235c42b10850811d9ab
EBUILD claws-mail-9999.ebuild 5998 BLAKE2B 4c9c1d9e74dd51a1dc4352f08284ffbc2db37b5107a91e9dd72bf417ee3a5b053dcc17a867db41f46236b99ddd3040b07947f7f8a260b01ac1a4c98efc1620af SHA512 d88dc00c953d137a6bc94887193aac83c3be8fdec211ccf59ccc101cea918ed90a13f0219563c2d2142e3cc49b45aa750d2ffb516e3bc0004f35e4a71bbafcd2
MISC metadata.xml 1469 BLAKE2B 783f75970a9a6d0919903cc4b937f4584752e63d9d629e37e89bce5fcbe1bd309bd381d633c59ed2fb2c41786be9964a0d9fd4e7f0aeb92c41acde4fddf1583d SHA512 4015fdffd6751583cb815a9af0e1e0ec2efd052a0d448f3f24248dfc9a74fb5e98f204d4175042fd24aba900d175403b95d586efb8178c2d7fabc3c10abd1696
diff --git a/mail-client/claws-mail/claws-mail-4.1.0-r1.ebuild b/mail-client/claws-mail/claws-mail-4.1.0-r1.ebuild
index 658ae84baa6a..38275a2493c8 100644
--- a/mail-client/claws-mail/claws-mail-4.1.0-r1.ebuild
+++ b/mail-client/claws-mail/claws-mail-4.1.0-r1.ebuild
@@ -111,6 +111,7 @@ RDEPEND="${COMMONDEPEND}
PATCHES=(
"${FILESDIR}/${PN}-3.17.5-enchant-2_default.patch"
"${FILESDIR}/${PN}-4.1.0-perl-5.36.patch"
+ "${FILESDIR}/${PN}-4.1.0-disable_gnutls.patch"
)
src_prepare() {
diff --git a/mail-client/claws-mail/files/claws-mail-4.1.0-disable_gnutls.patch b/mail-client/claws-mail/files/claws-mail-4.1.0-disable_gnutls.patch
new file mode 100644
index 000000000000..5bfea4727e51
--- /dev/null
+++ b/mail-client/claws-mail/files/claws-mail-4.1.0-disable_gnutls.patch
@@ -0,0 +1,641 @@
+diff -Naur claws-mail-4.1.0.orig/src/common/smtp.c claws-mail-4.1.0/src/common/smtp.c
+--- claws-mail-4.1.0.orig/src/common/smtp.c 2022-03-19 13:03:24.000000000 +0100
++++ claws-mail-4.1.0/src/common/smtp.c 2022-07-23 22:10:48.323673856 +0200
+@@ -1,6 +1,6 @@
+ /*
+ * Claws Mail -- a GTK based, lightweight, and fast e-mail client
+- * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail team
++ * Copyright (C) 1999-2022 the Claws Mail team and Hiroyuki Yamamoto
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+@@ -42,11 +42,11 @@
+ static gint smtp_auth(SMTPSession *session);
+ #ifdef USE_GNUTLS
+ static gint smtp_starttls(SMTPSession *session);
++static gint smtp_auth_oauth2(SMTPSession *session);
+ #endif
+ static gint smtp_auth_cram_md5(SMTPSession *session);
+ static gint smtp_auth_login(SMTPSession *session);
+ static gint smtp_auth_plain(SMTPSession *session);
+-static gint smtp_auth_oauth2(SMTPSession *session);
+
+ static gint smtp_ehlo(SMTPSession *session);
+ static gint smtp_ehlo_recv(SMTPSession *session, const gchar *msg);
+@@ -176,11 +176,13 @@
+ &&
+ (session->avail_auth_type & SMTPAUTH_PLAIN) != 0)
+ smtp_auth_plain(session);
++#ifdef USE_GNUTLS
+ else if ((session->forced_auth_type == SMTPAUTH_OAUTH2
+ || session->forced_auth_type == 0)
+ &&
+ (session->avail_auth_type & SMTPAUTH_OAUTH2) != 0)
+ smtp_auth_oauth2(session);
++#endif
+ else if (session->forced_auth_type == 0) {
+ log_warning(LOG_PROTOCOL, _("No SMTP AUTH method available\n"));
+ return SM_AUTHFAIL;
+@@ -323,8 +325,10 @@
+ session->avail_auth_type |= SMTPAUTH_CRAM_MD5;
+ if (strcasestr(p, "DIGEST-MD5"))
+ session->avail_auth_type |= SMTPAUTH_DIGEST_MD5;
++#ifdef USE_GNUTLS
+ if (strcasestr(p, "XOAUTH2"))
+ session->avail_auth_type |= SMTPAUTH_OAUTH2;
++#endif
+ }
+ if (g_ascii_strncasecmp(p, "SIZE", 4) == 0) {
+ p += 5;
+@@ -399,7 +403,7 @@
+ return SM_OK;
+ }
+
+-
++#ifdef USE_GNUTLS
+ static gint smtp_auth_oauth2(SMTPSession *session)
+ {
+ gchar buf[MESSAGEBUFSIZE], *b64buf, *out;
+@@ -428,6 +432,7 @@
+
+ return SM_OK;
+ }
++#endif
+
+ static gint smtp_auth_login(SMTPSession *session)
+ {
+@@ -547,7 +552,9 @@
+ case SMTP_AUTH_PLAIN:
+ case SMTP_AUTH_LOGIN_USER:
+ case SMTP_AUTH_LOGIN_PASS:
++#ifdef USE_GNUTLS
+ case SMTP_AUTH_OAUTH2:
++#endif
+ case SMTP_AUTH_CRAM_MD5:
+ log_print(LOG_PROTOCOL, "ESMTP< %s\n", msg);
+ break;
+@@ -670,7 +677,9 @@
+ break;
+ case SMTP_AUTH_PLAIN:
+ case SMTP_AUTH_LOGIN_PASS:
++#ifdef USE_GNUTLS
+ case SMTP_AUTH_OAUTH2:
++#endif
+ case SMTP_AUTH_CRAM_MD5:
+ ret = smtp_from(smtp_session);
+ break;
+diff -Naur claws-mail-4.1.0.orig/src/etpan/imap-thread.c claws-mail-4.1.0/src/etpan/imap-thread.c
+--- claws-mail-4.1.0.orig/src/etpan/imap-thread.c 2022-03-19 13:03:24.000000000 +0100
++++ claws-mail-4.1.0/src/etpan/imap-thread.c 2022-07-23 22:10:48.324673857 +0200
+@@ -1,6 +1,6 @@
+ /*
+ * Claws Mail -- a GTK based, lightweight, and fast e-mail client
+- * Copyright (C) 2005-2016 DINH Viet Hoa and the Claws Mail team
++ * Copyright (C) 2005-2022 the Claws Mail team and DINH Viet Hoa
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+@@ -999,9 +999,11 @@
+ param->type, NULL, NULL, NULL,
+ NULL, param->login,
+ param->password, NULL);
+- else if (!strcmp(param->type, "XOAUTH2")) {
++#ifdef USE_GNUTLS
++ else if (!strcmp(param->type, "XOAUTH2"))
+ r = mailimap_oauth2_authenticate(param->imap, param->login, param->password);
+- } else
++#endif
++ else
+ r = mailimap_authenticate(param->imap,
+ param->type, NULL, NULL, NULL,
+ param->login, param->login,
+diff -Naur claws-mail-4.1.0.orig/src/imap.c claws-mail-4.1.0/src/imap.c
+--- claws-mail-4.1.0.orig/src/imap.c 2022-03-19 13:03:24.000000000 +0100
++++ claws-mail-4.1.0/src/imap.c 2022-07-23 22:10:48.325673859 +0200
+@@ -72,7 +72,9 @@
+ #include "main.h"
+ #include "passwordstore.h"
+ #include "file-utils.h"
++#ifdef USE_GNUTLS
+ #include "oauth2.h"
++#endif
+
+ typedef struct _IMAPFolder IMAPFolder;
+ typedef struct _IMAPSession IMAPSession;
+@@ -913,9 +915,11 @@
+ case IMAP_AUTH_PLAIN:
+ ok = imap_cmd_login(session, user, pass, "PLAIN");
+ break;
++#ifdef USE_GNUTLS
+ case IMAP_AUTH_OAUTH2:
+ ok = imap_cmd_login(session, user, pass, "XOAUTH2");
+ break;
++#endif
+ case IMAP_AUTH_LOGIN:
+ ok = imap_cmd_login(session, user, pass, "LOGIN");
+ break;
+@@ -932,7 +936,9 @@
+ "\t DIGEST-MD5 %d\n"
+ "\t SCRAM-SHA-1 %d\n"
+ "\t PLAIN %d\n"
++#ifdef USE_GNUTLS
+ "\t OAUTH2 %d\n"
++#endif
+ "\t LOGIN %d\n"
+ "\t GSSAPI %d\n",
+ imap_has_capability(session, "ANONYMOUS"),
+@@ -940,7 +946,9 @@
+ imap_has_capability(session, "DIGEST-MD5"),
+ imap_has_capability(session, "SCRAM-SHA-1"),
+ imap_has_capability(session, "PLAIN"),
++#ifdef USE_GNUTLS
+ imap_has_capability(session, "XOAUTH2"),
++#endif
+ imap_has_capability(session, "LOGIN"),
+ imap_has_capability(session, "GSSAPI"));
+ if (imap_has_capability(session, "CRAM-MD5"))
+@@ -957,8 +965,10 @@
+ ok = imap_cmd_login(session, user, pass, "GSSAPI");
+ if (ok == MAILIMAP_ERROR_LOGIN) /* we always try plaintext login before giving up */
+ ok = imap_cmd_login(session, user, pass, "plaintext");
++#ifdef USE_GNUTLS
+ if (ok == MAILIMAP_ERROR_LOGIN && imap_has_capability(session, "XOAUTH2"))
+ ok = imap_cmd_login(session, user, pass, "XOAUTH2");
++#endif
+ }
+
+ if (ok == MAILIMAP_NO_ERROR)
+@@ -993,12 +1003,12 @@
+ "compiled with SASL support and the "
+ "LOGIN SASL plugin is installed.");
+ }
+-
++#ifdef USE_GNUTLS
+ if (type == IMAP_AUTH_OAUTH2) {
+ ext_info = _("\n\nOAuth2 error. Check and correct your OAuth2 "
+ "account preferences.");
+ }
+-
++#endif
+ if (time(NULL) - last_login_err > 10) {
+ if (!prefs_common.no_recv_err_panel) {
+ alertpanel_error_log(_("Connection to %s failed: "
+@@ -1320,10 +1330,10 @@
+ gboolean failed = FALSE;
+ gint ok = MAILIMAP_NO_ERROR;
+ g_return_val_if_fail(account->userid != NULL, MAILIMAP_ERROR_BAD_STATE);
+-
++#ifdef USE_GNUTLS
+ if(account->imap_auth_type == IMAP_AUTH_OAUTH2)
+ oauth2_check_passwds (account);
+-
++#endif
+ if (!password_get(account->userid, account->recv_server, "imap",
+ SESSION(session)->port, &acc_pass)) {
+ acc_pass = passwd_store_get_account(account->account_id,
+diff -Naur claws-mail-4.1.0.orig/src/inc.c claws-mail-4.1.0/src/inc.c
+--- claws-mail-4.1.0.orig/src/inc.c 2022-03-19 13:03:24.000000000 +0100
++++ claws-mail-4.1.0/src/inc.c 2022-07-23 22:10:48.325673859 +0200
+@@ -61,7 +61,9 @@
+ #include "hooks.h"
+ #include "logwindow.h"
+ #include "passwordstore.h"
++#ifdef USE_GNUTLS
+ #include "oauth2.h"
++#endif
+
+ extern SessionStats session_stats;
+
+@@ -633,11 +635,12 @@
+ manage_window_focus_in
+ (inc_dialog->dialog->window,
+ NULL, NULL);
+-
++#ifdef USE_GNUTLS
+ if(pop3_session->ac_prefs->use_pop_auth &&
+ pop3_session->ac_prefs->pop_auth_type == POPAUTH_OAUTH2)
+ oauth2_check_passwds (pop3_session->ac_prefs);
+-
++#endif
++
+ if (password_get(pop3_session->user,
+ pop3_session->ac_prefs->recv_server,
+ "pop3", pop3_get_port(pop3_session),
+diff -Naur claws-mail-4.1.0.orig/src/oauth2.c claws-mail-4.1.0/src/oauth2.c
+--- claws-mail-4.1.0.orig/src/oauth2.c 2022-03-19 13:03:24.000000000 +0100
++++ claws-mail-4.1.0/src/oauth2.c 2022-07-23 22:10:48.325673859 +0200
+@@ -22,6 +22,8 @@
+ #include "claws-features.h"
+ #endif
+
++#ifdef USE_GNUTLS
++
+ #include <glib.h>
+ #ifdef ENABLE_NLS
+ #include <glib/gi18n.h>
+@@ -715,3 +717,5 @@
+
+ return (0);
+ }
++
++#endif /* USE_GNUTLS */
+diff -Naur claws-mail-4.1.0.orig/src/oauth2.h claws-mail-4.1.0/src/oauth2.h
+--- claws-mail-4.1.0.orig/src/oauth2.h 2022-03-19 13:03:24.000000000 +0100
++++ claws-mail-4.1.0/src/oauth2.h 2022-07-23 22:10:48.325673859 +0200
+@@ -1,6 +1,6 @@
+ /*
+ * Claws Mail -- a GTK based, lightweight, and fast e-mail client
+- * Copyright (C) 2020 the Claws Mail team
++ * Copyright (C) 2020-2022 the Claws Mail team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+@@ -21,6 +21,8 @@
+ #include "claws-features.h"
+ #endif
+
++#ifdef USE_GNUTLS
++
+ #include <glib.h>
+
+ #include "socket.h"
+@@ -79,3 +81,5 @@
+ gint oauth2_use_refresh_token (Oauth2Service provider, OAUTH2Data *OAUTH2Data);
+ guchar* oauth2_decode(const gchar *in);
+ void oauth2_encode(const gchar *in);
++
++#endif /* USE_GNUTLS */
+diff -Naur claws-mail-4.1.0.orig/src/pop.c claws-mail-4.1.0/src/pop.c
+--- claws-mail-4.1.0.orig/src/pop.c 2022-03-19 13:03:24.000000000 +0100
++++ claws-mail-4.1.0/src/pop.c 2022-07-23 22:10:48.325673859 +0200
+@@ -1,6 +1,6 @@
+ /*
+ * Claws Mail -- a GTK based, lightweight, and fast e-mail client
+- * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail team
++ * Copyright (C) 1999-2022 the Claws Mail team and Hiroyuki Yamamoto
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+@@ -178,6 +178,7 @@
+ return PS_SUCCESS;
+ }
+
++#ifdef USE_GNUTLS
+ static gint pop3_getauth_oauth2_send(Pop3Session *session)
+ {
+ gchar buf[MESSAGEBUFSIZE], *b64buf, *out;
+@@ -202,6 +203,7 @@
+ g_free(out);
+ return PS_SUCCESS;
+ }
++#endif
+
+ static gint pop3_getrange_stat_send(Pop3Session *session)
+ {
+@@ -533,8 +535,10 @@
+
+ if (!g_ascii_strncasecmp(buf, "PASS ", 5))
+ log_print(LOG_PROTOCOL, "POP> PASS ********\n");
++#ifdef USE_GNUTLS
+ else if (!g_ascii_strncasecmp(buf, "AUTH XOAUTH2 ", 13))
+ log_print(LOG_PROTOCOL, "POP> AUTH XOAUTH2 ********\n");
++#endif
+ else
+ log_print(LOG_PROTOCOL, "POP> %s\n", buf);
+
+@@ -989,12 +993,12 @@
+ #ifdef USE_GNUTLS
+ if (pop3_session->ac_prefs->ssl_pop == SSL_STARTTLS)
+ val = pop3_stls_send(pop3_session);
++ else if (pop3_session->ac_prefs->use_pop_auth && pop3_session->ac_prefs->pop_auth_type == POPAUTH_OAUTH2)
++ val = pop3_getauth_oauth2_send(pop3_session);
+ else
+ #endif
+ if (pop3_session->ac_prefs->use_pop_auth && pop3_session->ac_prefs->pop_auth_type == POPAUTH_APOP)
+ val = pop3_getauth_apop_send(pop3_session);
+- else if (pop3_session->ac_prefs->use_pop_auth && pop3_session->ac_prefs->pop_auth_type == POPAUTH_OAUTH2)
+- val = pop3_getauth_oauth2_send(pop3_session);
+ else
+ val = pop3_getauth_user_send(pop3_session);
+ break;
+@@ -1015,7 +1019,9 @@
+ break;
+ case POP3_GETAUTH_PASS:
+ case POP3_GETAUTH_APOP:
++#ifdef USE_GNUTLS
+ case POP3_GETAUTH_OAUTH2:
++#endif
+ if (!pop3_session->pop_before_smtp)
+ val = pop3_getrange_stat_send(pop3_session);
+ else
+diff -Naur claws-mail-4.1.0.orig/src/prefs_account.c claws-mail-4.1.0/src/prefs_account.c
+--- claws-mail-4.1.0.orig/src/prefs_account.c 2022-03-19 13:03:24.000000000 +0100
++++ claws-mail-4.1.0/src/prefs_account.c 2022-07-23 22:14:18.477957308 +0200
+@@ -1,6 +1,6 @@
+ /*
+ * Claws Mail -- a GTK based, lightweight, and fast e-mail client
+- * Copyright (C) 1999-2021 the Claws Mail team and Hiroyuki Yamamoto
++ * Copyright (C) 1999-2022 the Claws Mail team and Hiroyuki Yamamoto
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+@@ -54,7 +54,9 @@
+ #include "smtp.h"
+ #include "imap.h"
+ #include "pop.h"
++#ifdef USE_GNUTLS
+ #include "oauth2.h"
++#endif
+ #include "remotefolder.h"
+ #include "combobox.h"
+ #include "setup.h"
+@@ -200,6 +202,7 @@
+ GtkWidget *pop_auth_minutes_lbl;
+ } SendPage;
+
++#ifdef USE_GNUTLS
+ typedef struct Oauth2Page
+ {
+ PrefsPage page;
+@@ -218,6 +221,7 @@
+ GtkWidget *oauth2_client_secret_entry;
+
+ } Oauth2Page;
++#endif
+
+ typedef struct
+ {
+@@ -373,7 +377,9 @@
+ static BasicPage basic_page;
+ static ReceivePage receive_page;
+ static SendPage send_page;
++#ifdef USE_GNUTLS
+ static Oauth2Page oauth2_page;
++#endif
+ static ComposePage compose_page;
+ static TemplatesPage templates_page;
+ static PrivacyPage privacy_page;
+@@ -416,7 +422,8 @@
+ static void prefs_account_pop_auth_type_set_data_from_optmenu
+ (PrefParam *pparam);
+ static void prefs_account_pop_auth_type_set_optmenu (PrefParam *pparam);
+-
++
++#ifdef USE_GNUTLS
+ static void prefs_account_oauth2_provider_set_data_from_optmenu
+ (PrefParam *pparam);
+ static void prefs_account_oauth2_provider_set_optmenu (PrefParam *pparam);
+@@ -425,6 +432,7 @@
+ static void prefs_account_oauth2_set_sensitivity(void);
+ static void prefs_account_oauth2_set_auth_sensitivity(void);
+ static void prefs_account_oauth2_obtain_tokens(GtkButton *button, gpointer data);
++#endif
+ static void prefs_account_set_autochk_interval_from_widgets(PrefParam *pparam);
+ static void prefs_account_set_autochk_interval_to_widgets(PrefParam *pparam);
+
+@@ -652,6 +660,7 @@
+ };
+
+ static PrefParam oauth2_param[] = {
++#ifdef USE_GNUTLS
+ {"oauth2_auth_provider", "0", &tmp_ac_prefs.oauth2_provider, P_ENUM,
+ &oauth2_page.oauth2_auth_optmenu,
+ prefs_account_oauth2_provider_set_data_from_optmenu,
+@@ -668,6 +677,23 @@
+
+ {"oauth2_client_secret", NULL, &tmp_ac_prefs.oauth2_client_secret, P_STRING,
+ &oauth2_page.oauth2_client_secret_entry, prefs_set_data_from_entry, prefs_set_entry},
++#else
++ {"oauth2_auth_provider", "0", &tmp_ac_prefs.oauth2_provider, P_ENUM,
++ NULL, NULL, NULL},
++
++ {"oauth2_date", 0, &tmp_ac_prefs.oauth2_date, P_INT,
++ NULL, NULL, NULL},
++
++ {"oauth2_authcode", NULL, &tmp_ac_prefs.oauth2_authcode, P_PASSWORD,
++ NULL, NULL, NULL},
++
++ {"oauth2_client_id", NULL, &tmp_ac_prefs.oauth2_client_id, P_STRING,
++ NULL, NULL, NULL},
++
++ {"oauth2_client_secret", NULL, &tmp_ac_prefs.oauth2_client_secret, P_STRING,
++ NULL, NULL, NULL},
++
++#endif
+
+ {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
+ };
+@@ -1624,8 +1650,9 @@
+ COMBOBOX_ADD (menu2, _("Select"), 0);
+ COMBOBOX_ADD (menu2, NULL, 0);
+ COMBOBOX_ADD (menu2, "APOP", POPAUTH_APOP);
++#ifdef USE_GNUTLS
+ COMBOBOX_ADD (menu2, "OAuth2", POPAUTH_OAUTH2);
+-
++#endif
+ SET_TOGGLE_SENSITIVITY (pop_auth_checkbtn, vbox5);
+
+ PACK_CHECK_BUTTON (vbox2, rmmail_checkbtn,
+@@ -1762,7 +1789,9 @@
+ COMBOBOX_ADD (menu, "SCRAM-SHA-1", IMAP_AUTH_SCRAM_SHA1);
+ COMBOBOX_ADD (menu, "PLAIN", IMAP_AUTH_PLAIN);
+ COMBOBOX_ADD (menu, "LOGIN", IMAP_AUTH_LOGIN);
++#ifdef USE_GNUTLS
+ COMBOBOX_ADD (menu, "OAUTH2", IMAP_AUTH_OAUTH2);
++#endif
+
+ hbox1 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
+ gtk_widget_show (hbox1);
+@@ -2019,7 +2048,9 @@
+ COMBOBOX_ADD (menu, "PLAIN", SMTPAUTH_PLAIN);
+ COMBOBOX_ADD (menu, "LOGIN", SMTPAUTH_LOGIN);
+ COMBOBOX_ADD (menu, "CRAM-MD5", SMTPAUTH_CRAM_MD5);
++#ifdef USE_GNUTLS
+ COMBOBOX_ADD (menu, "OAUTH2", SMTPAUTH_OAUTH2);
++#endif
+ COMBOBOX_ADD (menu, "DIGEST-MD5", SMTPAUTH_DIGEST_MD5);
+ gtk_list_store_set(menu, &iter, COMBOBOX_SENS, FALSE, -1);
+
+@@ -2165,6 +2196,7 @@
+ page->page.widget = vbox1;
+ }
+
++#ifdef USE_GNUTLS
+ static void oauth2_create_widget_func(PrefsPage * _page,
+ GtkWindow * window,
+ gpointer data)
+@@ -2379,6 +2411,7 @@
+ /* oauth2_encode(OAUTH2info[0][OA2_CLIENT_ID]); */
+
+ }
++#endif
+
+ static void compose_create_widget_func(PrefsPage * _page,
+ GtkWindow * window,
+@@ -3612,8 +3645,10 @@
+ gtk_entry_get_text(GTK_ENTRY(basic_page.pass_entry)),
+ FALSE);
+
++#ifdef USE_GNUTLS
+ /* Manual password change - reset expiry on OAUTH2 tokens*/
+ passwd_store_set_account(tmp_ac_prefs.account_id, PWS_ACCOUNT_OAUTH2_EXPIRY, "0", FALSE);
++#endif
+
+ if (protocol == A_IMAP4 || protocol == A_NNTP) {
+ new_id = g_strdup_printf("#%s/%s",
+@@ -3656,13 +3691,15 @@
+ PWS_ACCOUNT_SEND,
+ gtk_entry_get_text(GTK_ENTRY(send_page.smtp_pass_entry)),
+ FALSE);
+-
++#ifdef USE_GNUTLS
+ /* Manual password change - reset expiry on OAUTH2 tokens*/
+ passwd_store_set_account(tmp_ac_prefs.account_id, PWS_ACCOUNT_OAUTH2_EXPIRY, "0", FALSE);
++#endif
+
+ return 0;
+ }
+
++#ifdef USE_GNUTLS
+ static gint prefs_oauth2_apply(void)
+ {
+ prefs_set_data_from_dialog(oauth2_param);
+@@ -3675,6 +3712,7 @@
+
+ return 0;
+ }
++#endif
+
+ static gint prefs_compose_apply(void)
+ {
+@@ -3773,10 +3811,12 @@
+ /* SendPage *page = (SendPage *) _page; */
+ }
+
++#ifdef USE_GNUTLS
+ static void oauth2_destroy_widget_func(PrefsPage *_page)
+ {
+ /* Oauth2Page *page = (Oauth2Page *) _page; */
+ }
++#endif
+
+ static void compose_destroy_widget_func(PrefsPage *_page)
+ {
+@@ -3840,6 +3880,7 @@
+ return prefs_send_apply() >= 0;
+ }
+
++#ifdef USE_GNUTLS
+ static gboolean oauth2_can_close_func(PrefsPage *_page)
+ {
+ Oauth2Page *page = (Oauth2Page *) _page;
+@@ -3849,6 +3890,7 @@
+
+ return prefs_oauth2_apply() >= 0;
+ }
++#endif
+
+ static gboolean compose_can_close_func(PrefsPage *_page)
+ {
+@@ -3945,6 +3987,7 @@
+ cancelled = FALSE;
+ }
+
++#ifdef USE_GNUTLS
+ static void oauth2_save_func(PrefsPage *_page)
+ {
+ Oauth2Page *page = (Oauth2Page *) _page;
+@@ -3955,6 +3998,7 @@
+ if (prefs_oauth2_apply() >= 0)
+ cancelled = FALSE;
+ }
++#endif
+
+ static void compose_save_func(PrefsPage *_page)
+ {
+@@ -4090,6 +4134,7 @@
+ prefs_account_register_page((PrefsPage *) &send_page);
+ }
+
++#ifdef USE_GNUTLS
+ static void register_oauth2_page(void)
+ {
+ static gchar *path[3];
+@@ -4107,6 +4152,7 @@
+
+ prefs_account_register_page((PrefsPage *) &oauth2_page);
+ }
++#endif
+
+ static void register_compose_page(void)
+ {
+@@ -4296,7 +4342,9 @@
+ hooks_register_hook(SSL_CERT_GET_PASSWORD, sslcert_get_password, NULL);
+ #endif
+ register_proxy_page();
++#ifdef USE_GNUTLS
+ register_oauth2_page();
++#endif
+ register_advanced_page();
+ }
+
+@@ -5043,6 +5091,7 @@
+ combobox_select_by_data(optmenu, type);
+ }
+
++#ifdef USE_GNUTLS
+ static void prefs_account_oauth2_provider_set_data_from_optmenu(PrefParam *pparam)
+ {
+ *((Oauth2Service *)pparam->data) =
+@@ -5177,6 +5226,7 @@
+ g_free(trim_text);
+ g_free(OAUTH2Data);
+ }
++#endif
+
+ static void prefs_account_set_autochk_interval_to_widgets(PrefParam *pparam)
+ {
+diff -Naur claws-mail-4.1.0.orig/src/prefs_account.h claws-mail-4.1.0/src/prefs_account.h
+--- claws-mail-4.1.0.orig/src/prefs_account.h 2022-03-19 13:03:24.000000000 +0100
++++ claws-mail-4.1.0/src/prefs_account.h 2022-07-23 22:10:48.328673863 +0200
+@@ -1,6 +1,6 @@
+ /*
+ * Claws Mail -- a GTK based, lightweight, and fast e-mail client
+- * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail team
++ * Copyright (C) 1999-2022 the Claws Mail team and Hiroyuki Yamamoto
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+diff -Naur claws-mail-4.1.0.orig/src/send_message.c claws-mail-4.1.0/src/send_message.c
+--- claws-mail-4.1.0.orig/src/send_message.c 2022-03-19 13:03:24.000000000 +0100
++++ claws-mail-4.1.0/src/send_message.c 2022-07-23 22:10:48.328673863 +0200
+@@ -57,7 +57,9 @@
+ #include "log.h"
+ #include "passwordstore.h"
+ #include "file-utils.h"
++#ifdef USE_GNUTLS
+ #include "oauth2.h"
++#endif
+
+ typedef struct _SendProgressDialog SendProgressDialog;
+
+@@ -282,6 +284,9 @@
+ strlen(ac_prefs->gnutls_priority))
+ session->gnutls_priority = g_strdup(ac_prefs->gnutls_priority);
+ session->use_tls_sni = ac_prefs->use_tls_sni;
++
++ if (ac_prefs->use_smtp_auth && ac_prefs->smtp_auth_type == SMTPAUTH_OAUTH2)
++ oauth2_check_passwds (ac_prefs);
+ #else
+ if (ac_prefs->ssl_smtp != SSL_NONE) {
+ if (alertpanel_full(_("Insecure connection"),
+@@ -299,9 +304,6 @@
+ }
+ port = ac_prefs->set_smtpport ? ac_prefs->smtpport : SMTP_PORT;
+ #endif
+-
+- if(ac_prefs->use_smtp_auth && ac_prefs->smtp_auth_type == SMTPAUTH_OAUTH2)
+- oauth2_check_passwds (ac_prefs);
+
+ if (ac_prefs->use_smtp_auth) {
+ smtp_session->forced_auth_type = ac_prefs->smtp_auth_type;