[evolution-data-server/gnome-41] M!81 - Camel-SMTP: accept any 2xx code on MAIL FROM: as success



commit 302e13b8ec9813499f1b5fe3036ce73f32d24135
Author: Дилян Палаузов <git-dpa aegee org>
Date:   Sun Oct 24 19:40:55 2021 +0300

    M!81 - Camel-SMTP: accept any 2xx code on MAIL FROM: as success
    
    Close https://gitlab.gnome.org/GNOME/evolution-data-server/-/merge_requests/81
    Close https://gitlab.gnome.org/GNOME/evolution/-/issues/1670

 src/camel/providers/smtp/camel-smtp-transport.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/camel/providers/smtp/camel-smtp-transport.c b/src/camel/providers/smtp/camel-smtp-transport.c
index 117811977..0dba2bd19 100644
--- a/src/camel/providers/smtp/camel-smtp-transport.c
+++ b/src/camel/providers/smtp/camel-smtp-transport.c
@@ -1631,7 +1631,7 @@ smtp_mail (CamelSmtpTransport *transport,
        g_free (cmdbuf);
 
        do {
-               /* Check for "250 Sender OK..." */
+               /* Check for "250 Sender OK..." or anything starting with "2" */
                g_free (respbuf);
                respbuf = camel_stream_buffer_read_line (istream, cancellable, error);
                d (fprintf (stderr, "[SMTP] received: %s\n", respbuf ? respbuf : "(null)"));
@@ -1642,14 +1642,14 @@ smtp_mail (CamelSmtpTransport *transport,
                                FALSE, cancellable, NULL);
                        return FALSE;
                }
-               if (strncmp (respbuf, "250", 3)) {
+               if (*respbuf != '2') {
                        smtp_set_error (transport, istream, respbuf, cancellable, error);
                        g_prefix_error (
                                error, _("MAIL FROM command failed: "));
                        g_free (respbuf);
                        return FALSE;
                }
-       } while (*(respbuf+3) == '-'); /* if we got "250-" then loop again */
+       } while (*(respbuf+3) == '-'); /* if we got "2xx-" then loop again */
        g_free (respbuf);
 
        return TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]