danruto / python-ntlm

Automatically exported from code.google.com/p/python-ntlm
0 stars 0 forks source link

Patch that adds IMAP NTLM authentication #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Implemented a IMAPNtlmAuthHandler class for using NTML with IMAP.

Example:

from imaplib import IMAP4
from ntlm.IMAPNtlmAuthHandler import IMAPNtlmAuthHandler

imap = IMAP4("my.imap.server")
imap.authenticate("NTLM", IMapNtlmAuthHandler(r"DOMAIN\username", "password"))

Notes:
* I moved the base64 encoding/decoding to the HTTPNtlmAuthHandler.py module
* I only did the change for 2.6, not 3.0

Original issue reported on code.google.com by bernt.br...@gmail.com on 8 Dec 2009 at 1:32

Attachments:

GoogleCodeExporter commented 9 years ago
Forgot to set type when submitting. Should be Type-Enhancement. Don't know how 
to
edit that. Project admin: Please edit the issue type.

Original comment by bernt.br...@gmail.com on 8 Dec 2009 at 1:34

GoogleCodeExporter commented 9 years ago
The patch needs a patch...

Forgot an import in HTTPNtlmAuthHandler.py:

diff --git a/HTTPNtlmAuthHandler.py b/HTTPNtlmAuthHandler.py
index 6983c48..22c3d70 100644
--- a/HTTPNtlmAuthHandler.py
+++ b/HTTPNtlmAuthHandler.py
@@ -16,6 +16,7 @@ import base64
 import httplib, socket
 from urllib import addinfourl
 import ntlm
+import string

 class AbstractNtlmAuthHandler:
     def __init__(self, password_mgr=None, debuglevel=0):

Original comment by bernt.br...@gmail.com on 8 Dec 2009 at 8:53

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Check Issue 14 for updated patches if you have troubles patching.

Original comment by lev.abas...@gmail.com on 21 Feb 2012 at 9:07