From 2a5393cf5373accf9f09f67881f308c32262d472 Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Tue, 2 Sep 2014 17:31:44 +0300 Subject: [PATCH] SMTP: Fix edge case where nothing was sent when no authentication was needed. Relates to #1845. --- src/smtp.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/smtp.cpp b/src/smtp.cpp index ba41ac0c2..cc1a7a870 100644 --- a/src/smtp.cpp +++ b/src/smtp.cpp @@ -397,6 +397,10 @@ void Smtp::authenticate() // Skip authentication qDebug() << "Skipping authentication..."; state = Authenticated; + // At this point the server will not send any response + // So fill the buffer with a fake one to pass the tests + // in readyRead() + buffer.push_front("250 QBT FAKE RESPONSE\r\n"); return; } // AUTH extension is supported, check which @@ -420,6 +424,10 @@ void Smtp::authenticate() "we support [CRAM-MD5|PLAIN|LOGIN], skipping authentication, " "knowing it is likely to fail... Server Auth Modes: "+auth.join("|")); state = Authenticated; + // At this point the server will not send any response + // So fill the buffer with a fake one to pass the tests + // in readyRead() + buffer.push_front("250 QBT FAKE RESPONSE\r\n"); } }