From f322cbe9713f9868488c1c2e73dd163ec40f323a Mon Sep 17 00:00:00 2001 From: yesalam Date: Mon, 27 Mar 2017 17:08:09 +0530 Subject: [PATCH] added if(lastcommand) in catch block --- .../k9/mail/transport/smtp/SmtpTransport.java | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/k9mail-library/src/main/java/com/fsck/k9/mail/transport/smtp/SmtpTransport.java b/k9mail-library/src/main/java/com/fsck/k9/mail/transport/smtp/SmtpTransport.java index b45610a4c..11086eb03 100644 --- a/k9mail-library/src/main/java/com/fsck/k9/mail/transport/smtp/SmtpTransport.java +++ b/k9mail-library/src/main/java/com/fsck/k9/mail/transport/smtp/SmtpTransport.java @@ -655,26 +655,19 @@ public class SmtpTransport extends Transport { String responseLine = null; List results = new ArrayList<>(); while (noOfPipelinedResponse > 0) { + noOfPipelinedResponse--; results.clear(); responseLine = readCommandResponseLine(results); try { responseLineToCommandResponse(responseLine, results); - } catch (NegativeSmtpReplyException exception) { - //continue reading response till DATA response . - Timber.d("SMTP <<< " + exception.getReplyCode() + exception.getReplyText()); - } catch (MessagingException exception) { + if (noOfPipelinedResponse == 0) { + throw exception; + } + Timber.d("SMTP <<< " + exception.getMessage()); //continue reading response till DATA response . - } - noOfPipelinedResponse-- ; - } - - try { - responseLineToCommandResponse(responseLine, results); - } catch (NegativeSmtpReplyException exception) { - throw exception; } }