Another commit log that didn't get through.

David

-----Forwarded Message-----

From: Mail Delivery System <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Mail delivery failed: returning message to sender
Date: 25 Dec 2002 03:32:31 -0800

This message was created automatically by mail delivery software (Exim).

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  [EMAIL PROTECTED]
    No route to host:
    retry timeout exceeded

------ This is a copy of the message, including all the headers. ------

Return-path: <[EMAIL PROTECTED]>
Received: from sc8-pr-cvs1-b.sourceforge.net ([10.5.1.7] 
helo=sc8-pr-cvs1.sourceforge.net)
        by sc8-sf-netmisc.sourceforge.net with esmtp (Exim 3.36 #1 (Debian))
        id 18PhCF-0004Dv-00
        for <[EMAIL PROTECTED]>; Sat, 21 Dec 2002 02:49:31 -0800
Received: from guerizec by sc8-pr-cvs1.sourceforge.net with local (Exim 3.22 #1 
(Debian))
        id 18PhCE-0003FW-00
        for <[EMAIL PROTECTED]>; Sat, 21 Dec 2002 02:49:30 -0800
To: [EMAIL PROTECTED]
Subject: CVS: tmda/TMDA Auth.py,1.1,1.2
Message-Id: <[EMAIL PROTECTED]>
From: David Guerizec <[EMAIL PROTECTED]>
Date: Sat, 21 Dec 2002 02:49:30 -0800

Update of /cvsroot/tmda/tmda/TMDA
In directory sc8-pr-cvs1:/tmp/cvs-serv10896/TMDA

Modified Files:
        Auth.py 
Log Message:
New version, major changes:

- Protocol is now v0.2 between tmda-manager and tmda-gui (net. mode)
    Added command line switches with getopt, this makes it more
    manageable for future extensions.

- Auth now have an authenticate() function which accepts a type of
  authentication (remote, prog or file).

- tmda-gui has been enhanced to have persistant settings (position of
  splitters, max number of messages in the pending list, refresh
  interval, default address for the moment)
  
- tmda-gui can now read Defaults variables (no write yet)


Enjoy!
  


Index: Auth.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/Auth.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Auth.py     14 Dec 2002 02:07:37 -0000      1.1
+++ Auth.py     21 Dec 2002 10:49:28 -0000      1.2
@@ -70,7 +70,7 @@
     username = None
     authfile = os.path.join(os.path.expanduser('~'), '.tmda', 'tofmipd')
 
-
+authtype = 'file'
 
 def warning(msg='', exit=1):
     delimiter = '*' * 70
@@ -250,6 +250,7 @@
         try:
             M.login(username, password)
             M.logout()
+            M.close()
             return 1
         except:
             print >> DEBUGSTREAM, "imap authentication for %s@%s failed" % \
@@ -306,6 +307,18 @@
             remoteauth['proto']
     return 0
 
+def authenticate_plain(username, password, type=None):
+    if type == None:
+        type = authtype
+    if type == 'remote':
+        return run_remoteauth(username, password)
+    if type == 'prog':
+        return run_authprog(username, password)
+    if type == 'file':
+        ## FIXME: implement /etc/tofmipd auth
+        return 0
+    
+    raise AuthError, "Unknown authentication type '%s'." % type
 
 def authfile2dict(authfile):
     """Iterate over a tmda-ofmipd authentication file, and return a
@@ -354,6 +367,8 @@
             if status != 0:
                 raise IOError, 'it seems that user %s experienced problems!' \
                                % auth_username
+            return 1
+    return 0
 

 pw_uid = None


_________________________________________________
tmda-workers mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-workers

Reply via email to