aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-07-08 01:53:31 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-07-08 01:53:31 +0800
commit243dbca93af49733ab7680e32affb276467899b9 (patch)
tree0ecaa883799be359d18862a19c67ec08c261cedf /camel
parenta25600d9b54d81f533b273716d9100c6ab35175b (diff)
downloadgsoc2013-evolution-243dbca93af49733ab7680e32affb276467899b9.tar
gsoc2013-evolution-243dbca93af49733ab7680e32affb276467899b9.tar.gz
gsoc2013-evolution-243dbca93af49733ab7680e32affb276467899b9.tar.bz2
gsoc2013-evolution-243dbca93af49733ab7680e32affb276467899b9.tar.lz
gsoc2013-evolution-243dbca93af49733ab7680e32affb276467899b9.tar.xz
gsoc2013-evolution-243dbca93af49733ab7680e32affb276467899b9.tar.zst
gsoc2013-evolution-243dbca93af49733ab7680e32affb276467899b9.zip
Fixed the parser to actually work
2000-07-07 Jeffrey Stedfast <fejj@helixcode.com> * providers/smtp/camel-smtp-transport.c (esmtp_get_authtypes): Fixed the parser to actually work svn path=/trunk/; revision=3950
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog5
-rw-r--r--camel/providers/smtp/camel-smtp-transport.c26
2 files changed, 17 insertions, 14 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 8bd0400257..e628e69e64 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,8 @@
+2000-07-07 Jeffrey Stedfast <fejj@helixcode.com>
+
+ * providers/smtp/camel-smtp-transport.c (esmtp_get_authtypes):
+ Fixed the parser to actually work
+
2000-07-06 Dan Winship <danw@helixcode.com>
* camel-mime-utils.c (header_references_decode): Make this deal
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index beee253cd5..cf2649f78c 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -174,7 +174,7 @@ smtp_connect (CamelService *service, CamelException *ex)
transport->istream = camel_stream_buffer_new (transport->ostream,
CAMEL_STREAM_BUFFER_READ);
- /* Read the greeting, note whether the server is ESMTP and if it requests AUTH. */
+ /* Read the greeting, note whether the server is ESMTP or not. */
do {
/* Check for "220" */
g_free (respbuf);
@@ -247,17 +247,14 @@ smtp_disconnect (CamelService *service, CamelException *ex)
return TRUE;
}
-static GList
-*esmtp_get_authtypes (gchar *buffer)
+static GList *
+esmtp_get_authtypes (gchar *buffer)
{
GList *ret = NULL;
gchar *start, *end;
- if (!(start = strstr (buffer, "AUTH")))
- return NULL;
-
/* advance to the first token */
- for (start += 4; *start && *start != ' ' && *start != '='; start++);
+ for (start = buffer; *start == ' ' || *start == '='; start++);
for ( ; *start; ) {
/* advance to the end of the token */
@@ -266,7 +263,7 @@ static GList
ret = g_list_append (ret, g_strndup (start, end - start));
/* advance to the next token */
- for (start = end; *start && *start != ' '; start++);
+ for (start = end; *start == ' '; start++);
}
return ret;
@@ -293,8 +290,8 @@ static CamelServiceAuthType cram_md5_authtype = {
TRUE
};
-static GList
-*query_auth_types (CamelService *service, CamelException *ex)
+static GList *
+query_auth_types (CamelService *service, CamelException *ex)
{
/* FIXME: Re-enable this when auth types are actually
* implemented.
@@ -415,8 +412,8 @@ _send (CamelTransport *transport, CamelMedium *message,
return _send_to (transport, message, recipients, ex);
}
-static gchar
-*smtp_get_email_addr_from_text (gchar *text)
+static gchar *
+smtp_get_email_addr_from_text (gchar *text)
{
/* get the actual email address from the string passed and place it in addr
* we can assume the address will be in one of the following forms:
@@ -539,8 +536,9 @@ smtp_helo (CamelSmtpTransport *transport, CamelException *ex)
}
if (transport->smtp_is_esmtp && strstr (respbuf, "AUTH")) {
/* parse for supported AUTH types */
- g_strchomp (respbuf);
- transport->esmtp_supported_authtypes = esmtp_get_authtypes (respbuf);
+ char *auths = strstr (respbuf, "AUTH") + 4;
+
+ transport->esmtp_supported_authtypes = esmtp_get_authtypes (auths);
}
} while ( *(respbuf+3) == '-' ); /* if we got "250-" then loop again */
g_free (respbuf);