[PATCH] Add STARTTLS support
Sebastian Spaeth
Sebastian at SSpaeth.de
Tue Apr 5 13:26:50 BST 2011
First try to login with STARTTLS (if we haven't configured it to use
ssl), then try CRAM-MD5, then plaintext.
Signed-off-by: Sebastian Spaeth <Sebastian at SSpaeth.de>
---
Can you try this patch on top of master? It could be that this is all we need for starttls support.
offlineimap/imapserver.py | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/offlineimap/imapserver.py b/offlineimap/imapserver.py
index f05c743..62c1f4f 100644
--- a/offlineimap/imapserver.py
+++ b/offlineimap/imapserver.py
@@ -279,9 +279,14 @@ class IMAPServer:
#self.password = None
if not self.gssapi:
- if 'AUTH=CRAM-MD5' in imapobj.capabilities:
+ #try STARTTLS, then CRAM-MD5, then Plaintext
+ if 'STARTTLS' in imapobj.capabilities and not self.usessl:
self.ui.debug('imap',
- 'Attempting CRAM-MD5 authentication')
+ 'Attempting STARTTLS authentication')
+ imapobj.starttls()
+ elif 'AUTH=CRAM-MD5' in imapobj.capabilities:
+ self.ui.debug('imap',
+ 'Attempting CRAM-MD5 authentication')
try:
imapobj.authenticate('CRAM-MD5', self.md5handler)
except imapobj.error, val:
--
1.7.1
More information about the OfflineIMAP-project
mailing list