CVS: tmda/TMDA Defaults.py,1.199,1.200 Util.py,1.114,1.115

"Jason R. Mastaler" <[email protected]> Wed, 18 Feb 2004 13:38:00 -0800
Newsgroups gmane.mail.spam.tmda.cvs
Message-ID <[email protected]>
Update of /cvsroot/tmda/tmda/TMDA
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13610

Modified Files:
	Defaults.py Util.py 
Log Message:
bugfix from release-1-0 branch

Index: Defaults.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/Defaults.py,v
retrieving revision 1.199
retrieving revision 1.200
diff -u -r1.199 -r1.200
--- Defaults.py	9 Feb 2004 00:23:58 -0000	1.199
+++ Defaults.py	18 Feb 2004 21:37:58 -0000	1.200
@@ -325,14 +325,9 @@
 # Example:
 # BOUNCE_ENV_SENDER = "[email protected]"
 #
-# Default is an empty envelope sender <>.
+# Default is "<>", a null envelope sender.
 if not vars().has_key('BOUNCE_ENV_SENDER'):
-    if MAIL_TRANSPORT == 'sendmail' and \
-           MAIL_TRANSFER_AGENT in ('qmail', 'postfix'):
-        # qmail/Postfix's /usr/sbin/sendmail doesn't like -f '<>'
-        BOUNCE_ENV_SENDER = ''
-    else:
-        BOUNCE_ENV_SENDER = '<>'
+    BOUNCE_ENV_SENDER = '<>'
 
 # BOUNCE_TEXT_FILTER_INCOMING
 # Text for the failure notice returned to the sender when a 'bounce'

Index: Util.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/Util.py,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -r1.114 -r1.115
--- Util.py	17 Feb 2004 21:12:35 -0000	1.114
+++ Util.py	18 Feb 2004 21:37:58 -0000	1.115
@@ -562,6 +562,26 @@
     envsender is the envelope sender address.
     """
     import Defaults
+    # Sending mail with a null envelope sender address <> is not done
+    # the same way across the different supported MTAs, nor across the
+    # two mail transports (SMTP and /usr/sbin/sendmail).
+    #
+    # The most common method is to use the string '<>'.  There are two
+    # exceptions where an empty string must be used instead.
+    #
+    # 1) When running qmail/courier and using the sendmail transport.
+    # qmail munges the envelope sender address into <"<>"@domain.dom
+    # if "sendmail -f <>" is used.
+    #
+    # 2) When running Postfix and using the sendmail transport.
+    # Old versions of Postfix apparently also have trouble with
+    # "sendmail -f <>", though Postfix 2.0.x does not.
+    if envsender == '':
+        envsender = '<>'
+    if envsender == '<>' and \
+           Defaults.MAIL_TRANSFER_AGENT in ('postfix', 'qmail') and \
+           Defaults.MAIL_TRANSPORT == 'sendmail':
+        envsender = ''
     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