diff options
author | Márcio Alexandre Silva Delgado <coadde@lavabit.com> | 2013-08-20 01:03:50 -0300 |
---|---|---|
committer | Márcio Alexandre Silva Delgado <coadde@lavabit.com> | 2013-08-20 01:03:50 -0300 |
commit | f6fdbc4ba29f50f77c6ec1cbce249569551c6cfc (patch) | |
tree | 64bf1197fd3f13baa8fb1ea30671540cf21c27f7 /nonprism/gnome-online-accounts-nonprism/smtp-auth-plain.patch | |
parent | 54dc76aa52ec1f0feb46e36604fa7a15fa8062d6 (diff) | |
download | abslibre-f6fdbc4ba29f50f77c6ec1cbce249569551c6cfc.tar.gz abslibre-f6fdbc4ba29f50f77c6ec1cbce249569551c6cfc.tar.bz2 abslibre-f6fdbc4ba29f50f77c6ec1cbce249569551c6cfc.zip |
move coherence to nonprism repo
Diffstat (limited to 'nonprism/gnome-online-accounts-nonprism/smtp-auth-plain.patch')
-rw-r--r-- | nonprism/gnome-online-accounts-nonprism/smtp-auth-plain.patch | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/nonprism/gnome-online-accounts-nonprism/smtp-auth-plain.patch b/nonprism/gnome-online-accounts-nonprism/smtp-auth-plain.patch new file mode 100644 index 000000000..c6782d0f6 --- /dev/null +++ b/nonprism/gnome-online-accounts-nonprism/smtp-auth-plain.patch @@ -0,0 +1,88 @@ +From 2210bf547dc35adacbc95c0dcf4abe75a73a8368 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray <debarshir@gnome.org> +Date: Tue, 18 Jun 2013 15:27:55 +0000 +Subject: smtp-auth-plain: Handle multiline SMTP greetings + +Fixes: https://bugzilla.gnome.org/702263 +--- +diff --git a/src/goabackend/goasmtpauthplain.c b/src/goabackend/goasmtpauthplain.c +index bb783bd..77324cf 100644 +--- a/src/goabackend/goasmtpauthplain.c ++++ b/src/goabackend/goasmtpauthplain.c +@@ -167,6 +167,40 @@ smtp_auth_plain_check_454 (const gchar *response, GError **error) + + /* ---------------------------------------------------------------------------------------------------- */ + ++static gboolean ++smtp_auth_plain_check_greeting (GDataInputStream *input, GCancellable *cancellable, GError **error) ++{ ++ gboolean ret; ++ gchar *response; ++ ++ response = NULL; ++ ret = FALSE; ++ ++ greeting_again: ++ response = g_data_input_stream_read_line (input, NULL, cancellable, error); ++ if (response == NULL) ++ goto out; ++ g_debug ("< %s", response); ++ if (smtp_auth_plain_check_421 (response, error)) ++ goto out; ++ if (smtp_auth_plain_check_not_220 (response, error)) ++ goto out; ++ ++ if (response[3] == '-') ++ { ++ g_clear_pointer (&response, g_free); ++ goto greeting_again; ++ } ++ ++ ret = TRUE; ++ ++ out: ++ g_free (response); ++ return ret; ++} ++ ++/* ---------------------------------------------------------------------------------------------------- */ ++ + static gchar * + smtp_auth_plain_get_domain (GoaSmtpAuthPlain *auth, + GError **error) +@@ -563,15 +597,8 @@ goa_smtp_auth_plain_run_sync (GoaMailAuth *_auth, + + if (!auth->greeting_absent) + { +- response = g_data_input_stream_read_line (input, NULL, cancellable, error); +- if (response == NULL) +- goto out; +- g_debug ("< %s", response); +- if (smtp_auth_plain_check_421 (response, error)) ++ if (!smtp_auth_plain_check_greeting (input, cancellable, error)) + goto out; +- if (smtp_auth_plain_check_not_220 (response, error)) +- goto out; +- g_clear_pointer (&response, g_free); + } + + /* Send EHLO */ +@@ -685,15 +712,8 @@ goa_smtp_auth_plain_starttls_sync (GoaMailAuth *_auth, + + /* Check the greeting */ + +- response = g_data_input_stream_read_line (input, NULL, cancellable, error); +- if (response == NULL) +- goto out; +- g_debug ("< %s", response); +- if (smtp_auth_plain_check_421 (response, error)) ++ if (!smtp_auth_plain_check_greeting (input, cancellable, error)) + goto out; +- if (smtp_auth_plain_check_not_220 (response, error)) +- goto out; +- g_clear_pointer (&response, g_free); + + /* Send EHLO */ + +-- +cgit v0.9.2 |