aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/smtp
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-06-10 02:58:57 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-06-10 02:58:57 +0800
commit59d329b5b090175e2ea5ffd06cb20dfcd41a7688 (patch)
treefe94beab713bf7998a0adc4fd735c6506e2ccbb6 /camel/providers/smtp
parent9e8db9cf29fc2a30575c3e1181d535330902cb69 (diff)
downloadgsoc2013-evolution-59d329b5b090175e2ea5ffd06cb20dfcd41a7688.tar.gz
gsoc2013-evolution-59d329b5b090175e2ea5ffd06cb20dfcd41a7688.tar.zst
gsoc2013-evolution-59d329b5b090175e2ea5ffd06cb20dfcd41a7688.zip
Will now always send EHLO first, if that fails it will fall back on HELO.
2000-06-09 Jeffrey Stedfast <fejj@helixcode.com> * providers/smtp/camel-smtp-transport.c (smtp_connect): Will now always send EHLO first, if that fails it will fall back on HELO. (esmtp_get_authtypes): Should now correctly parse authtypes. svn path=/trunk/; revision=3490
Diffstat (limited to 'camel/providers/smtp')
-rw-r--r--camel/providers/smtp/camel-smtp-transport.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index 1ce7d8b0f3..74ab08dc99 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -128,12 +128,13 @@ camel_smtp_transport_get_type (void)
static gboolean
smtp_connect (CamelService *service, CamelException *ex)
{
+ CamelSmtpTransport *transport = CAMEL_SMTP_TRANSPORT (service);
struct hostent *h;
struct sockaddr_in sin;
gint fd, num, i;
guint32 addrlen;
gchar *pass = NULL, *respbuf = NULL;
- CamelSmtpTransport *transport = CAMEL_SMTP_TRANSPORT (service);
+
if (!service_class->connect (service, ex))
return FALSE;
@@ -188,7 +189,17 @@ smtp_connect (CamelService *service, CamelException *ex)
g_free (respbuf);
/* send HELO (or EHLO, depending on the service type) */
- smtp_helo (transport, ex);
+ if (!transport->smtp_is_esmtp) {
+ /* If we did not auto-detect ESMTP, we should still send EHLO */
+ transport->smtp_is_esmtp = TRUE;
+ if (!smtp_helo (transport, ex)) {
+ /* Okay, apprently this server doesn't support ESMTP */
+ transport->smtp_is_esmtp = FALSE;
+ smtp_helo (transport, ex);
+ }
+ } else {
+ smtp_helo (transport, ex);
+ }
/* check to see if AUTH is required, if so...then AUTH ourselves */
if (transport->smtp_is_esmtp && transport->esmtp_supported_authtypes) {
@@ -239,11 +250,11 @@ static GList
GList *ret = NULL;
gchar *start, *end;
- if (!(start = strstr (buffer, " AUTH ")))
+ if (!(start = strstr (buffer, "AUTH")))
return NULL;
/* advance to the first token */
- for (start += 6; *start && *start != ' '; start++);
+ for (start += 4; *start && *start != ' ' && *start != '='; start++);
for ( ; *start; ) {
/* advance to the end of the token */