CVS: tmda/TMDA Util.py,1.109,1.110
"Jason R. Mastaler" <[email protected]>
| Newsgroups | gmane.mail.spam.tmda.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/tmda/tmda/TMDA
In directory sc8-pr-cvs1:/tmp/cvs-serv9521/TMDA
Modified Files:
Util.py
Log Message:
Slight performance improvement. Process Defaults.MAIL_TRANSPORT ==
'sendmail' cases first since this is the default setting.
Index: Util.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/Util.py,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -r1.109 -r1.110
--- Util.py 13 Oct 2003 19:33:24 -0000 1.109
+++ Util.py 14 Oct 2003 00:02:11 -0000 1.110
@@ -558,12 +558,7 @@
envsender is the envelope sender address.
"""
import Defaults
- if Defaults.MAIL_TRANSPORT == 'smtp':
- import SMTP
- server = SMTP.Connection()
- server.sendmail(envsender, envrecip, msgstr)
- server.quit()
- elif Defaults.MAIL_TRANSPORT == 'sendmail':
+ if Defaults.MAIL_TRANSPORT == 'sendmail':
# You can avoid the shell by passing a tuple of arguments as
# the command instead of a string. This will cause the
# popen2.Popen3() code to execvp() "/usr/bin/sendmail" with
@@ -571,6 +566,11 @@
cmd = (Defaults.SENDMAIL_PROGRAM, '-i',
'-f', envsender, '--', envrecip)
pipecmd(cmd, msgstr)
+ elif Defaults.MAIL_TRANSPORT == 'smtp':
+ import SMTP
+ server = SMTP.Connection()
+ server.sendmail(envsender, envrecip, msgstr)
+ server.quit()
else:
raise Errors.ConfigError, \
"Invalid MAIL_TRANSPORT method: " + Defaults.MAIL_TRANSPORT