fetchmail-friends
[Top] [All Lists]

[fetchmail] IMAP STARTTLS

2002-09-04 18:20:11
Hello,

I found that Matt Kraai's patch for supporting STLS over POP3 was
included in fetchmail 5.9.9. I tried to do something similar for IMAP,
but get "Unknown login or authentication error", although I do see
(with a sniffer) fetchmail issuing STARTTLS command and server answering
"OK STARTTLS completed". Can someone knowing fetchmail code better tell
me what needs to be done else?

Regards,
Nerijus

--- fetchmail-5.9.13-orig/imap.c        Tue Jun  4 15:55:05 2002
+++ fetchmail-5.9.13/imap.c        Thu Sep  5 02:55:02 2002
@@ -356,6 +356,22 @@
     }
 #endif /* KERBEROS_V4 */
 
+#ifdef SSL_ENABLE
+    if ((ctl->server.authenticate == A_ANY)
+        && strstr(capabilities, "STARTTLS"))
+    {
+           char *realhost;
+
+           realhost = ctl->server.via ? ctl->server.via : 
ctl->server.pollname;           gen_transact(sock, "STARTTLS");
+           if 
(SSLOpen(sock,ctl->sslcert,ctl->sslkey,ctl->sslproto,ctl->sslcertck, 
ctl->sslcertpath,ctl->sslfingerprint,realhost,ctl->server.pollname) == -1)
+           {
+               report(stderr,
+                      GT_("SSL connection failed.\n"));
+               return(PS_AUTHFAIL);
+           }
+    }
+#endif /* SSL_ENABLE */
+
     /*
      * No such luck.  OK, now try the variants that mask your password
      * in a challenge-response.



<Prev in Thread] Current Thread [Next in Thread>