Update of /cvsroot/tmda/tmda/TMDA
In directory usw-pr-cvs1:/tmp/cvs-serv14305/TMDA

Modified Files:
        ChangeLog Defaults.py SMTP.py 
Log Message:
New feature: support optional SMTP authentication through SMTPAUTHUSER
and SMTPAUTHPASSWORD.  Requires Python 2.2 or higher due to the fact
that the login() method was added to smtplib in this release.


Index: ChangeLog
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/ChangeLog,v
retrieving revision 1.222
retrieving revision 1.223
diff -u -r1.222 -r1.223
--- ChangeLog   21 Aug 2002 22:37:41 -0000      1.222
+++ ChangeLog   22 Aug 2002 00:33:01 -0000      1.223
@@ -1,5 +1,10 @@
 2002-08-21  Jason R. Mastaler  <[EMAIL PROTECTED]>
 
+       * Defaults.py (SMTPAUTHUSER, SMTPAUTHPASSWORD): New variables.
+       
+       * SMTP.py (Connection.__connect): Add support for SMTP
+       authentication.
+       
        * Defaults.py (MAX_AUTORESPONSES_PER_DAY, RESPONSE_DIR): New
        variables.
 

Index: Defaults.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/Defaults.py,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -r1.138 -r1.139
--- Defaults.py 21 Aug 2002 22:37:41 -0000      1.138
+++ Defaults.py 22 Aug 2002 00:33:01 -0000      1.139
@@ -240,6 +240,32 @@
 if not vars().has_key('SMTPHOST') and OUTGOINGMAIL == 'smtp':
     SMTPHOST = "localhost"
 
+# SMTPAUTHUSER
+# The username to authenticate with if your SMTP server requires
+# authentication.  You must also define SMTPAUTHPASSWORD if you use
+# this option.  Requires Python 2.2 or above.
+#
+# Examples:
+#
+# SMTPAUTHUSER = "johndoe"
+#
+# No default.
+if not vars().has_key('SMTPAUTHUSER') and OUTGOINGMAIL == 'smtp':
+    SMTPAUTHUSER = None
+
+# SMTPAUTHPASSWORD
+# The password to authenticate with if your SMTP server requires
+# authentication.  You must also define SMTPAUTHUSER if you use this
+# option.  Requires Python 2.2 or above.
+#
+# Examples:
+#
+# SMTPAUTHPASSWORD = "6Yu_9iKzs"
+#
+# No default.
+if not vars().has_key('SMTPAUTHPASSWORD') and OUTGOINGMAIL == 'smtp':
+    SMTPAUTHPASSWORD = None
+
 # SMTP_MAX_SESSIONS_PER_CONNECTION
 # An integer specifying a ceiling on the number of SMTP sessions to
 # perform on a single socket connection, when OUTGOINGMAIL is

Index: SMTP.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/SMTP.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SMTP.py     16 May 2002 22:11:42 -0000      1.1
+++ SMTP.py     22 Aug 2002 00:33:01 -0000      1.2
@@ -45,7 +45,10 @@
         self.__conn = smtplib.SMTP()
         self.__conn.connect(Defaults.SMTPHOST)
         self.__numsessions = Defaults.SMTP_MAX_SESSIONS_PER_CONNECTION
-
+        # Optional SMTP Authentication.
+        if Defaults.SMTPAUTHUSER and Defaults.SMTPAUTHPASSWORD:
+            self.__conn.login(Defaults.SMTPAUTHUSER, Defaults.SMTPAUTHPASSWORD)
+            
     def sendmail(self, envsender, recips, msgtext):
         try:
             results = self.__conn.sendmail(envsender, recips, msgtext)

_______________________________________
tmda-cvs mailing list
http://tmda.net/lists/listinfo/tmda-cvs

Reply via email to