mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-07 02:30:10 -05:00
Application of patch submitted by cnehren for Issue 356, with
generalization.
This commit is contained in:
parent
932adf5ed2
commit
aa4a92a541
@ -1299,7 +1299,7 @@ public class ImapStore extends Store {
|
|||||||
try {
|
try {
|
||||||
// TODO eventually we need to add additional authentication
|
// TODO eventually we need to add additional authentication
|
||||||
// options such as SASL
|
// options such as SASL
|
||||||
executeSimpleCommand("LOGIN \"" + mUsername + "\" \"" + mPassword + "\"", true);
|
executeSimpleCommand("LOGIN \"" + escapeString(mUsername) + "\" \"" + escapeString(mPassword) + "\"", true);
|
||||||
authSuccess = true;
|
authSuccess = true;
|
||||||
} catch (ImapException ie) {
|
} catch (ImapException ie) {
|
||||||
throw new AuthenticationFailedException(ie.getAlertText(), ie);
|
throw new AuthenticationFailedException(ie.getAlertText(), ie);
|
||||||
@ -1380,6 +1380,17 @@ public class ImapStore extends Store {
|
|||||||
throw ioe;
|
throw ioe;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String escapeString(String in)
|
||||||
|
{
|
||||||
|
if (in == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String out = in.replaceAll("\\\\", "\\\\\\\\");
|
||||||
|
out = out.replaceAll("\"", "\\\\\"");
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
public String sendCommand(String command, boolean sensitive)
|
public String sendCommand(String command, boolean sensitive)
|
||||||
throws MessagingException, IOException {
|
throws MessagingException, IOException {
|
||||||
|
Loading…
Reference in New Issue
Block a user