SMTP: implement AUTH LOGIN username (with optional initial-response, see RFC2554)

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@992 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-04-07 22:02:58 +00:00
parent 12c8ab9e49
commit 2e8a130e0f
4 changed files with 15 additions and 3 deletions

View File

@ -151,6 +151,9 @@ public class AbstractConnection extends Thread {
if (line != null) {
if (line.startsWith("PASS")) {
DavGatewayTray.debug(new BundleMessage("LOG_READ_CLIENT_PASS"));
// SMTP LOGIN
} else if (line.startsWith("AUTH LOGIN ")) {
DavGatewayTray.debug(new BundleMessage("LOG_READ_CLIENT_AUTH_LOGIN"));
// IMAP LOGIN
} else if (state == State.INITIAL && line.indexOf(' ') >= 0 &&
line.substring(line.indexOf(' ') + 1).startsWith("LOGIN")) {

View File

@ -97,8 +97,15 @@ public class SmtpConnection extends AbstractConnection {
decodeCredentials(tokens.nextToken());
authenticate();
} else if ("LOGIN".equalsIgnoreCase(authType)) {
sendClient("334 " + base64Encode("Username:"));
state = State.LOGIN;
if (tokens.hasMoreTokens()) {
// user name sent on auth line
userName = base64Decode(tokens.nextToken());
sendClient("334 " + base64Encode("Password:"));
state = State.PASSWORD;
} else {
sendClient("334 " + base64Encode("Username:"));
state = State.LOGIN;
}
} else {
sendClient("451 Error : unknown authentication type");
}

View File

@ -101,6 +101,7 @@ LOG_OPEN_LINK_NOT_SUPPORTED=Open link not supported (tried AWT Desktop and SWT P
LOG_PROTOCOL_PORT={0} port {1,number,# }
LOG_READ_CLIENT_AUTHORIZATION=< Authorization: ********
LOG_READ_CLIENT_AUTH_PLAIN=< AUTH PLAIN ********
LOG_READ_CLIENT_AUTH_LOGIN=< AUTH LOGIN ********
LOG_READ_CLIENT_LINE=< {0}
LOG_READ_CLIENT_LOGIN=< LOGIN ********
LOG_READ_CLIENT_PASS=< PASS ********

View File

@ -250,4 +250,5 @@ EXCEPTION_UNSUPPORTED_PARAMETER=Param
EXCEPTION_INVALID_PARAMETER=Paramètre invalide : {0}
UI_USE_SYSTEM_PROXIES=Utiliser la configuration système :
UI_SHOW_STARTUP_BANNER=Notification au lancement
UI_SHOW_STARTUP_BANNER_HELP=Afficher ou non la fenêtre de notification au démarrage
UI_SHOW_STARTUP_BANNER_HELP=Afficher ou non la fenêtre de notification au démarrage
LOG_READ_CLIENT_AUTH_LOGIN=< AUTH LOGIN ********