[Mailman-Users] Custom footer based on sender's email

Mark Sapiro msapiro at value.net
Thu May 11 20:47:49 CEST 2006


Rob Jackson wrote:

>Although it still doesn't
>work.  Here is what I have now.
>
>
>--- /u1/mailman1/Mailman/Handlers/Decorate.py   2006-02-24
>17:31:06.000000000 -0700
>+++ Decorate.py 2006-05-11 12:14:22.000000000 -0600
>@@ -20,6 +20,7 @@
> from types import ListType
> from email.MIMEText import MIMEText
>
>+import re
> from Mailman import mm_cfg
> from Mailman import Utils
> from Mailman import Errors
>@@ -66,6 +67,15 @@
>     header = decorate(mlist, mlist.msg_header, 'non-digest header', d)
>     footer = decorate(mlist, mlist.msg_footer, 'non-digest footer', d)
>     # Escape hatch if both the footer and header are empty
>+
>+    sender = msgdata.get('original_sender', msg.get_sender())
>+    if sender == '<email-address>':
>+       footer = "THIS IS A GATEWAY MESSAGE"
>+
>+    pl = msg.get_payload(decode=True)
>+    re.sub('AZ', 'new text', pl)
>+    msg.set_payload(pl)
>+
>     if not header and not footer:
>         return
>
>
>
>     # Be MIME smart here.  We only attach the header and footer by


It looks OK to me. I assume by 'doesn't work' you mean there is no
error in the log, but you don't get the desired result. What do the
messages look like, both to and from the list?

-- 
Mark Sapiro <msapiro at value.net>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan




More information about the Mailman-Users mailing list