[Mailman-Developers] change the envelope sender with Sendmail.py?

Harald Meland Harald.Meland@usit.uio.no
09 May 2000 19:51:33 +0200


--=-=-=

[Harald Meland]

> [Brian Edmonds]
> 
> > The change is on line 91 of Handlers/Sendmail.py[1], where msg.GetSender
> > needs to become mlist.GetAdminEmail.
> 
> As I mentioned some weeks ago on this same issue, I think it would be
> better to override the GetSender() method appropriately for the
> various subclasses of Message.
> 
> If you hardcode in GetAdminEmail as envelope sender, you can get
> "interesting" results when combined with MTA sender verification and
> e.g. newly created lists.  It will also cause e.g. password reminder
> bounces to go to some unsuspecting (public) list's admin and not to
> mailman-owner.

Some might consider that a feature, of course ;)

I finally got round to backporting these changes to CVS mailman:


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=mailman-envelope-sender.diff

Index: Mailman//Message.py
===================================================================
RCS file: /export/public/cvsroot/mailman/Mailman/Message.py,v
retrieving revision 1.29
diff -u -r1.29 Message.py
--- Message.py	2000/05/08 22:23:17	1.29
+++ Message.py	2000/05/09 17:48:04
@@ -183,3 +183,7 @@
         self['From'] = sender
         self['To'] = recip
         self.recips = [recip]
+        self.notification_sender = sender
+
+    def GetSender(self):
+        return self.notification_sender
Index: Mailman//Handlers/SMTPDirect.py
===================================================================
RCS file: /export/public/cvsroot/mailman/Mailman/Handlers/SMTPDirect.py,v
retrieving revision 1.8
diff -u -r1.8 SMTPDirect.py
--- SMTPDirect.py	2000/05/08 17:28:19	1.8
+++ SMTPDirect.py	2000/05/09 17:48:05
@@ -49,7 +49,7 @@
         try:
             # make sure the connect happens, which won't be done by the
             # constructor if SMTPHOST is false
-            envsender = mlist.GetAdminEmail()
+            envsender = msg.GetSender()
             refused = conn.sendmail(envsender, recips, str(msg))
         finally:
             t1 = time.time()
Index: Mailman//Handlers/Sendmail.py
===================================================================
RCS file: /export/public/cvsroot/mailman/Mailman/Handlers/Sendmail.py,v
retrieving revision 1.7
diff -u -r1.7 Sendmail.py
--- Sendmail.py	2000/05/08 17:28:19	1.7
+++ Sendmail.py	2000/05/09 17:48:05
@@ -53,7 +53,7 @@
         # Nobody to deliver to!
         return
     # Use -f to set the envelope sender
-    cmd = mm_cfg.SENDMAIL_CMD + ' -f ' + mlist.GetAdminEmail() + ' '
+    cmd = mm_cfg.SENDMAIL_CMD + ' -f ' + msg.GetSender() + ' '
     # make sure the command line is of a manageable size
     recipchunks = []
     currentchunk = []

--=-=-=


As usual, I haven't tested the patch with CVS Mailman -- it's just a
backporting of the code we've been running here during the last
months.
-- 
Harald

--=-=-=--