[evolution-data-server] Bug #671172 - camel: smtp: Make EHLO keywords check case insensitive
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Bug #671172 - camel: smtp: Make EHLO keywords check case insensitive
- Date: Mon, 26 Mar 2012 15:42:28 +0000 (UTC)
commit 61fa51ad86b07ba7830db4d5bb9c0a15081ca7e2
Author: Pawel Moll <mail pawelmoll com>
Date: Mon Mar 26 17:41:14 2012 +0200
Bug #671172 - camel: smtp: Make EHLO keywords check case insensitive
According to section 4.1.1.1 of RFC 2821 (last paragraph,
see tools.ietf.org/html/rfc2821#section-4.1.1.1):
Although EHLO keywords may be specified in upper, lower, or mixed
case, they MUST always be recognized and processed in a case-
insensitive manner. This is simply an extension of practices
specified in RFC 821 and section 2.4.1.
Current smtp_helo() implementation is using strncmp() - replace them
with g_ascii_strncasecmp().
camel/providers/smtp/camel-smtp-transport.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index d4a00b5..78364fc 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -1153,13 +1153,13 @@ smtp_helo (CamelSmtpTransport *transport,
token = respbuf + 4;
if (transport->flags & CAMEL_SMTP_TRANSPORT_IS_ESMTP) {
- if (!strncmp (token, "8BITMIME", 8)) {
+ if (!g_ascii_strncasecmp (token, "8BITMIME", 8)) {
transport->flags |= CAMEL_SMTP_TRANSPORT_8BITMIME;
- } else if (!strncmp (token, "ENHANCEDSTATUSCODES", 19)) {
+ } else if (!g_ascii_strncasecmp (token, "ENHANCEDSTATUSCODES", 19)) {
transport->flags |= CAMEL_SMTP_TRANSPORT_ENHANCEDSTATUSCODES;
- } else if (!strncmp (token, "STARTTLS", 8)) {
+ } else if (!g_ascii_strncasecmp (token, "STARTTLS", 8)) {
transport->flags |= CAMEL_SMTP_TRANSPORT_STARTTLS;
- } else if (!strncmp (token, "AUTH", 4)) {
+ } else if (!g_ascii_strncasecmp (token, "AUTH", 4)) {
if (!transport->authtypes || transport->flags & CAMEL_SMTP_TRANSPORT_AUTH_EQUAL) {
/* Don't bother parsing any authtypes if we already have a list.
* Some servers will list AUTH twice, once the standard way and
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]