From af479f53c6e0dbb80fd14c46787ac3bcb556b002 Mon Sep 17 00:00:00 2001 From: mguessan Date: Wed, 28 Oct 2009 15:16:57 +0000 Subject: [PATCH] SMTP: allow lower case commands git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@797 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/smtp/SmtpConnection.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/java/davmail/smtp/SmtpConnection.java b/src/java/davmail/smtp/SmtpConnection.java index 8bcfa7a2..2ebeef10 100644 --- a/src/java/davmail/smtp/SmtpConnection.java +++ b/src/java/davmail/smtp/SmtpConnection.java @@ -80,21 +80,21 @@ public class SmtpConnection extends AbstractConnection { } else if ("QUIT".equalsIgnoreCase(command)) { sendClient("221 Closing connection"); break; - } else if ("EHLO".equals(command)) { + } else if ("EHLO".equalsIgnoreCase(command)) { sendClient("250-" + tokens.nextToken()); // inform server that AUTH is supported // actually it is mandatory (only way to get credentials) sendClient("250-AUTH LOGIN PLAIN"); sendClient("250 Hello"); - } else if ("HELO".equals(command)) { + } else if ("HELO".equalsIgnoreCase(command)) { sendClient("250 Hello"); - } else if ("AUTH".equals(command)) { + } else if ("AUTH".equalsIgnoreCase(command)) { if (tokens.hasMoreElements()) { String authType = tokens.nextToken(); - if ("PLAIN".equals(authType) && tokens.hasMoreElements()) { + if ("PLAIN".equalsIgnoreCase(authType) && tokens.hasMoreElements()) { decodeCredentials(tokens.nextToken()); authenticate(); - } else if ("LOGIN".equals(authType)) { + } else if ("LOGIN".equalsIgnoreCase(authType)) { sendClient("334 " + base64Encode("Username:")); state = State.LOGIN; } else { @@ -103,7 +103,7 @@ public class SmtpConnection extends AbstractConnection { } else { sendClient("451 Error : authentication type not specified"); } - } else if ("MAIL".equals(command)) { + } else if ("MAIL".equalsIgnoreCase(command)) { if (state == State.AUTHENTICATED) { state = State.STARTMAIL; recipients.clear(); @@ -112,7 +112,7 @@ public class SmtpConnection extends AbstractConnection { state = State.INITIAL; sendClient("503 Bad sequence of commands"); } - } else if ("RCPT".equals(command)) { + } else if ("RCPT".equalsIgnoreCase(command)) { if (state == State.STARTMAIL || state == State.RECIPIENT) { if (line.startsWith("RCPT TO:")) { state = State.RECIPIENT; @@ -131,7 +131,7 @@ public class SmtpConnection extends AbstractConnection { state = State.AUTHENTICATED; sendClient("503 Bad sequence of commands"); } - } else if ("DATA".equals(command)) { + } else if ("DATA".equalsIgnoreCase(command)) { if (state == State.RECIPIENT) { state = State.MAILDATA; sendClient("354 Start mail input; end with .");