summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 278afda)
raw | patch | inline | side by side (parent: 278afda)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 2 Feb 2010 05:15:10 +0000 (05:15 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 2 Feb 2010 05:15:10 +0000 (05:15 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4449 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
doc/acknowledgements.txt | patch | blob | history | |
roundup/mailgw.py | patch | blob | history | |
roundup/scripts/roundup_mailgw.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 96fedf3f2a5f65e860e9e0dd13d31630b4e10fbe..6b66a3c2054a466e4f6985a16b8627c84cc09ca3 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
2010-XX-XX 1.4.12 (rXXXX)
+Features:
+- Support IMAP CRAM-MD5, thanks Jochen Maes
+
Fixes:
- Proper handling of 'Create' permissions in both mail gateway (earlier
commit r4405 by Richard), web interface, and xmlrpc. This used to
index 13793dc70879f3d9273fcde73b467b8c8fd477eb..c7cdcc2c97db849d3cfb42cb46a90ec74b187f49 100644 (file)
--- a/doc/acknowledgements.txt
+++ b/doc/acknowledgements.txt
David Linke,
Martin v. Löwis,
Fredrik Lundh,
+Jochen Maes,
Will Maier,
Ksenia Marasanova,
Georges Martin,
diff --git a/roundup/mailgw.py b/roundup/mailgw.py
index 97848a72ca541d599de85678d85fd32df6c225be..a098f85b260b22419a9b2e6b1410937125247ee9 100644 (file)
--- a/roundup/mailgw.py
+++ b/roundup/mailgw.py
fcntl.flock(f.fileno(), FCNTL.LOCK_UN)
return 0
- def do_imap(self, server, user='', password='', mailbox='', ssl=0):
+ def do_imap(self, server, user='', password='', mailbox='', ssl=0,
+ cram=0):
''' Do an IMAP connection
'''
import getpass, imaplib, socket
return 1
try:
- server.login(user, password)
+ if cram:
+ server.login_cram_md5(user, password)
+ else:
+ server.login(user, password)
except imaplib.IMAP4.error, e:
self.logger.exception('IMAP login failure')
return 1
index 3325091a4e0d4692fec5896b11af5d5b5464bc35..603af5f559529351030eb5ae88badc86ad684823 100644 (file)
This supports the same notation as IMAP.
imaps username:password@server [mailbox]
+IMAPS_CRAM:
+ Connect to an IMAP server over ssl using CRAM-MD5 authentication.
+ This supports the same notation as IMAP.
+ imaps_cram username:password@server [mailbox]
+
""")%{'program': args[0]}
return 1
source, specification = args[1:3]
# time out net connections after a minute if we can
- if source not in ('mailbox', 'imaps'):
+ if source not in ('mailbox', 'imaps', 'imaps_cram'):
if hasattr(socket, 'setdefaulttimeout'):
socket.setdefaulttimeout(60)
elif source == 'apop':
return handler.do_apop(server, username, password)
elif source.startswith('imap'):
- ssl = source.endswith('s')
+ ssl = cram = 0
+ if source.endswith('s'):
+ ssl = 1
+ elif source.endswith('s_cram'):
+ ssl = cram = 1
mailbox = ''
if len(args) > 3:
mailbox = args[3]
- return handler.do_imap(server, username, password, mailbox, ssl)
+ return handler.do_imap(server, username, password, mailbox, ssl,
+ cram)
return usage(argv, _('Error: The source must be either "mailbox",'
- ' "pop", "pops", "apop", "imap" or "imaps"'))
+ ' "pop", "pops", "apop", "imap", "imaps" or "imaps_cram'))
def run():
sys.exit(main(sys.argv))