Mark Sapiro wrote:

> One way to do this would be if the 'forward' box is checked and the
> action is 'reject' the forwarded message would be a multipart/mixed
> message with a text/plain part containing the reject reason and a
> message/rfc822 part containing the original post instead of a
> message/rfc822 message containing just the original post.
> 
> The drawback is it changes the format of the forwarded message in the
> 'reject' case. I would like to know if this would be a problem for
> anyone.


I'm still interested in knowing if this would cause problems for anyone,
but I have developed a patch to the 2.1.14 base Mailman/ListAdmin.py to
implement the above. The patch is attached as forward.patch.txt.

-- 
Mark Sapiro <[email protected]>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

--- test-mailman-2.1/Mailman/ListAdmin.py       2009-12-21 10:50:22.000000000 
-0800
+++ test-mailman/Mailman/ListAdmin.py   2011-03-05 17:19:50.453125000 -0800
@@ -31,6 +31,7 @@
 from cStringIO import StringIO
 
 import email
+from email.MIMEText import MIMEText
 from email.MIMEMessage import MIMEMessage
 from email.Generator import Generator
 from email.Utils import getaddresses
@@ -337,8 +338,22 @@
                     lang=lang)
             finally:
                 i18n.set_translation(otrans)
-            fmsg.set_type('message/rfc822')
-            fmsg.attach(copy)
+            if rejection == 'Refused' and comment:
+                # If we're rejecting and we have a comment, include it.
+                fmsg_comment = MIMEText(_(
+"""A moderator rejected this message with the reason
+
+"%(comment)s"
+
+The original message is attached.
+"""), _charset=Utils.GetCharSet(lang))
+                fmsg_message = MIMEMessage(copy)
+                fmsg.set_type('multipart/mixed')
+                fmsg.attach(fmsg_comment)
+                fmsg.attach(fmsg_message)
+            else:
+                fmsg.set_type('message/rfc822')
+                fmsg.attach(copy)
             fmsg.send(self)
         # Log the rejection
         if rejection:
------------------------------------------------------
Mailman-Users mailing list [email protected]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Reply via email to