From fd4e47a7360439ac8f0b42ad1f4ad9f57a91a565 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 9 Jun 2000 18:58:57 +0000 Subject: [PATCH] Will now always send EHLO first, if that fails it will fall back on HELO. 2000-06-09 Jeffrey Stedfast * 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. --- camel/ChangeLog | 6 ++++++ camel/providers/imap/camel-imap-folder.c | 16 +++++++++++++++- camel/providers/smtp/camel-smtp-transport.c | 19 +++++++++++++++---- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index b0f9b68..cec20c7 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,9 @@ +2000-06-09 Jeffrey Stedfast + + * 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. + 2000-06-07 Jeffrey Stedfast * providers/imap/camel-imap-summary.c: Now builds (not that it's worth much yet). diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index b1e6fc9..3e60478 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -635,7 +635,20 @@ message_changed (CamelMimeMessage *m, int type, CamelImapFolder *mf) static CamelMimeMessage * imap_get_message_by_uid (CamelFolder *folder, const gchar *uid, CamelException *ex) { - /* NOTE: extremely easy to do in IMAP - just needa code it ;-) */ + CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder); + CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store); + CamelImapStream *imap_stream; + CamelMimeMessage *message; + gchar *cmdid, *cmdbuf; + + +} + +#if 0 +static CamelMimeMessage * +imap_get_message_by_uid (CamelFolder *folder, const gchar *uid, CamelException *ex) +{ + /* NOTE: oh boy, this is gonna be complicated */ CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder); CamelStreamMem *message_stream = NULL; CamelMimeMessage *message = NULL; @@ -726,6 +739,7 @@ imap_get_message_by_uid (CamelFolder *folder, const gchar *uid, CamelException * return NULL; } +#endif GPtrArray * imap_get_summary (CamelFolder *folder, CamelException *ex) diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c index 1ce7d8b..74ab08d 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 */ -- 2.7.4