1
0
mirror of https://github.com/OfflineIMAP/offlineimap.git synced 2024-06-29 07:50:51 +02:00

Implement RFC 2595 LOGINDISABLED

Warn the user and abort when we attempt a plaintext login, but the
server has explicitly disabled plaintext logins.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth 2011-09-16 13:57:55 +02:00
parent 19ff636390
commit 1ac9dc7fb4
2 changed files with 10 additions and 5 deletions

View File

@ -20,6 +20,10 @@ New Features
future. Starting with this version, OfflineImap will be future. Starting with this version, OfflineImap will be
forward-compatible with the per-account locking style. forward-compatible with the per-account locking style.
* Implement RFC 2595 LOGINDISABLED. Warn the user and abort when we
attempt a plaintext login but the server has explicitly disabled
plaintext logins rather than crashing.
Changes Changes
------- -------
@ -30,8 +34,3 @@ Bug Fixes
* New emails are not created with "-rwxr-xr-x" but as "-rw-r--r--" * New emails are not created with "-rwxr-xr-x" but as "-rw-r--r--"
anymore, fixing a regression in 6.3.4. anymore, fixing a regression in 6.3.4.
Pending for the next major release
==================================
* UIs get shorter and nicer names. (API changing)

View File

@ -262,6 +262,12 @@ class IMAPServer:
except imapobj.error, val: except imapobj.error, val:
self.plainauth(imapobj) self.plainauth(imapobj)
else: else:
# Use plaintext login, unless
# LOGINDISABLED (RFC2595)
if 'LOGINDISABLED' in imapobj.capabilities:
raise OfflineImapError("Plaintext login "
"disabled by server. Need to use SSL?",
OfflineImapError.ERROR.REPO)
self.plainauth(imapobj) self.plainauth(imapobj)
# Would bail by here if there was a failure. # Would bail by here if there was a failure.
success = 1 success = 1