mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-07 18:50:11 -05:00
Changed SMTP code to handle reply codes without additional text.
Fixes issue 2801
This commit is contained in:
parent
2d7bd5a341
commit
fe724c8c79
@ -496,27 +496,32 @@ public class SmtpTransport extends Transport
|
|||||||
writeLine(command, sensitive);
|
writeLine(command, sensitive);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean cont = false;
|
/*
|
||||||
do
|
* Read lines as long as the length is 4 or larger, e.g. "220-banner text here".
|
||||||
|
* Shorter lines are either errors of contain only a reply code. Those cases will
|
||||||
|
* be handled by checkLine() below.
|
||||||
|
*/
|
||||||
|
String line = readLine();
|
||||||
|
while (line.length() >= 4)
|
||||||
{
|
{
|
||||||
String line = readLine();
|
|
||||||
checkLine(line);
|
|
||||||
if (line.length() > 4)
|
if (line.length() > 4)
|
||||||
{
|
{
|
||||||
|
// Everything after the first four characters goes into the results array.
|
||||||
results.add(line.substring(4));
|
results.add(line.substring(4));
|
||||||
if (line.charAt(3) == '-')
|
|
||||||
{
|
|
||||||
cont = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cont = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
while (cont);
|
|
||||||
return results;
|
|
||||||
|
|
||||||
|
if (line.charAt(3) != '-')
|
||||||
|
{
|
||||||
|
// If the fourth character isn't "-" this is the last line of the response.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
line = readLine();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if the reply code indicates an error.
|
||||||
|
checkLine(line);
|
||||||
|
|
||||||
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user