CVS: tmda/TMDA ChangeLog, 1.290, 1.291 Defaults.py, 1.187, 1.188 Util.py, 1.108, 1.109

"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-serv18348/TMDA

Modified Files:
	ChangeLog Defaults.py Util.py 
Log Message:
Change the default value for OUTGOINGMAIL to 'sendmail', and also
rename OUTGOINGMAIL to MAIL_TRANSPORT.  Rationale:

I made SMTP transport the default for OUTGOINGMAIL in the past for two
reasons:

1) Since our /usr/sbin/sendmail implementation went through the shell,
   there was a potential security risk with incoming mail.  If someone
   embedded the right shell commands in their Return-Path, they could
   get executed by TMDA inadvertently.

2) Argument quoting and escaping issues when TMDA tried to respond to
   a really malformed address that confused the shell.

However, the new implementation doesn't use the shell at all, so the
above problems should hopefully be non-issues.

In addition, there were the following problems with the SMTP
default:

a) qmail doesn't let localhost relay by default, so we get 1001
   questions on tmda-users first about why TMDA isn't sending any
   mail, and then about how to setup qmail's obscure relaying
   mechanism.  This is FAQ 3.3.  The user probably just ends up
   setting OUTGOINGMAIL to 'sendmail' to fix things.

b) With Sendmail/Postfix/Exim, if TMDA tries to respond to a bogus
   local address, the MTA refuses the transmission during the SMTP
   transaction resulting in an LOGFILE_DEBUG traceback.  This is FAQ
   3.7 essentially.  The user probably ends up setting OUTGOINGMAIL to
   'sendmail' to fix things.

Reversing the default should solve both of these issues, with no
additional problems created.

The name "OUTGOINGMAIL" proved non-intuitive and confusing, so
it is renamed to something less ambiguous.


Index: ChangeLog
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/ChangeLog,v
retrieving revision 1.290
retrieving revision 1.291
diff -u -r1.290 -r1.291
--- ChangeLog	10 Oct 2003 03:29:39 -0000	1.290
+++ ChangeLog	13 Oct 2003 19:33:24 -0000	1.291
@@ -1,3 +1,8 @@
+2003-10-13  Jason R. Mastaler  <[email protected]>
+
+	* Defaults.py (OUTGOINGMAIL): Change default to 'sendmail'.
+	(MAIL_TRANSPORT): OUTGOINGMAIL renamed.
+
 2003-10-09  Jason R. Mastaler  <[email protected]>
 
 	* Util.py (sendmail): If using /usr/sbin/sendmail, pass a tuple of

Index: Defaults.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/Defaults.py,v
retrieving revision 1.187
retrieving revision 1.188
diff -u -r1.187 -r1.188
--- Defaults.py	10 Oct 2003 03:29:39 -0000	1.187
+++ Defaults.py	13 Oct 2003 19:33:24 -0000	1.188
@@ -178,7 +178,7 @@
 if not vars().has_key('ALLOW_MODE_640'):
     ALLOW_MODE_640 = 0
 
-# OUTGOINGMAIL
+# MAIL_TRANSPORT
 # Final delivery method for all outgoing mail (server and client).
 # Possible values include:
 # 
@@ -189,14 +189,14 @@
 #
 # "sendmail"
 #    Deliver messages via the command line interface to the sendmail
-#    program (/usr/sbin/sendmail).
+#    program (e.g, /usr/sbin/sendmail).
 #
-# Default is "smtp"
-if not vars().has_key('OUTGOINGMAIL'):
-    OUTGOINGMAIL = "smtp"
+# Default is "sendmail"
+if not vars().has_key('MAIL_TRANSPORT'):
+    MAIL_TRANSPORT = "sendmail"
 
 # SMTPHOST
-# SMTP host and optional port, when OUTGOINGMAIL is "smtp".
+# SMTP host and optional port, when MAIL_TRANSPORT is "smtp".
 # If the hostname or IP address ends with a colon (":") followed by a
 # number, that suffix will be stripped off and the number interpreted
 # as the port number to use.  Otherwise, the standard SMTP port (25)
@@ -210,7 +210,7 @@
 # SMTPHOST = "mailhost.company.com:1234"
 #
 # Default is "localhost" (port 25 on the local host)
-if not vars().has_key('SMTPHOST') and OUTGOINGMAIL == 'smtp':
+if not vars().has_key('SMTPHOST') and MAIL_TRANSPORT == 'smtp':
     SMTPHOST = "localhost"
 
 # SMTPAUTH_USERNAME
@@ -223,7 +223,7 @@
 # SMTPAUTH_USERNAME = "johndoe"
 #
 # No default.
-if not vars().has_key('SMTPAUTH_USERNAME') and OUTGOINGMAIL == 'smtp':
+if not vars().has_key('SMTPAUTH_USERNAME') and MAIL_TRANSPORT == 'smtp':
     SMTPAUTH_USERNAME = None
 
 # SMTPAUTH_PASSWORD
@@ -236,7 +236,7 @@
 # SMTPAUTH_PASSWORD = "6Yu_9iKzs"
 #
 # No default.
-if not vars().has_key('SMTPAUTH_PASSWORD') and OUTGOINGMAIL == 'smtp':
+if not vars().has_key('SMTPAUTH_PASSWORD') and MAIL_TRANSPORT == 'smtp':
     SMTPAUTH_PASSWORD = None
 
 # SMTPSSL
@@ -246,7 +246,7 @@
 # support.  Requires Python 2.2 or greater.
 #
 # Default is 0 (turned off)
-if not vars().has_key('SMTPSSL') and OUTGOINGMAIL == 'smtp':
+if not vars().has_key('SMTPSSL') and MAIL_TRANSPORT == 'smtp':
     SMTPSSL = 0
 
 # SMTPSSL_KEYFILE
@@ -255,7 +255,7 @@
 #
 # No default.
 if not vars().has_key('SMTPSSL_KEYFILE') and \
-       OUTGOINGMAIL == 'smtp' and SMTPSSL:
+       MAIL_TRANSPORT == 'smtp' and SMTPSSL:
     SMTPSSL_KEYFILE = None
 
 # SMTPSSL_CERTFILE
@@ -265,12 +265,12 @@
 #
 # No default.
 if not vars().has_key('SMTPSSL_CERTFILE') and \
-       OUTGOINGMAIL == 'smtp' and SMTPSSL:
+       MAIL_TRANSPORT == 'smtp' and SMTPSSL:
     SMTPSSL_CERTFILE = 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
+# perform on a single socket connection, when MAIL_TRANSPORT is
 # "smtp".  Some MTAs have limits.  Set this to 0 to do as many
 # as we like (i.e. your MTA has no limits).  Set this to some number
 # great than 0 and TMDA will close the SMTP connection and re-open it
@@ -278,14 +278,14 @@
 #
 # Default is 0
 if not vars().has_key('SMTP_MAX_SESSIONS_PER_CONNECTION') and \
-       OUTGOINGMAIL == 'smtp':
+       MAIL_TRANSPORT == 'smtp':
     SMTP_MAX_SESSIONS_PER_CONNECTION = 0
 
 # SENDMAIL_PROGRAM
 # The path to the sendmail program, or sendmail compatibility
-# interface when OUTGOINGMAIL is "sendmail".
+# interface when MAIL_TRANSPORT is "sendmail".
 # Defaults to one of the two standard locations.
-if not vars().has_key('SENDMAIL_PROGRAM') and OUTGOINGMAIL == 'sendmail':
+if not vars().has_key('SENDMAIL_PROGRAM') and MAIL_TRANSPORT == 'sendmail':
     for sendmail in ('/usr/sbin/sendmail', '/usr/lib/sendmail'):
         if os.path.exists(sendmail):
             SENDMAIL_PROGRAM = sendmail
@@ -317,7 +317,7 @@
 #
 # Default is an empty envelope sender <>.
 if not vars().has_key('BOUNCE_ENV_SENDER'):
-    if OUTGOINGMAIL == 'sendmail' and \
+    if MAIL_TRANSPORT == 'sendmail' and \
            MAIL_TRANSFER_AGENT in ('qmail', 'postfix'):
         # qmail/Postfix's /usr/sbin/sendmail doesn't like -f '<>'
         BOUNCE_ENV_SENDER = ''

Index: Util.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/Util.py,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -r1.108 -r1.109
--- Util.py	10 Oct 2003 03:29:39 -0000	1.108
+++ Util.py	13 Oct 2003 19:33:24 -0000	1.109
@@ -558,12 +558,12 @@
     envsender is the envelope sender address.
     """
     import Defaults
-    if Defaults.OUTGOINGMAIL == 'smtp':
+    if Defaults.MAIL_TRANSPORT == 'smtp':
         import SMTP
         server = SMTP.Connection()
         server.sendmail(envsender, envrecip, msgstr)
         server.quit()
-    elif Defaults.OUTGOINGMAIL == 'sendmail':
+    elif 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
@@ -573,7 +573,7 @@
         pipecmd(cmd, msgstr)
     else:
         raise Errors.ConfigError, \
-              "Invalid OUTGOINGMAIL method: " + Defaults.OUTGOINGMAIL
+              "Invalid MAIL_TRANSPORT method: " + Defaults.MAIL_TRANSPORT
 
 
 def decode_header(str):
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.