
Ok, I have been trying to use this in several places without success. I have added to the Decorate.py and even tried to add it to my custom module used for a global incoming gateway. I replaced the re.sub line with:
re.sub('AZ', 'new text', pl)
In the message that I send, I only put AZ in the body of the message. I do not get any errors, but nothing happens to the message. The AZ does not get replaced.
Is there something else I need to do to get this working. I am about to use procmail to do this, which I really wanted to avoid, as it will add another step to the process.
-Rob
-----Original Message----- From: Mark Sapiro [mailto:msapiro@value.net] Sent: Friday, May 05, 2006 10:20 AM To: Rob Jackson; mailman-users@python.org Subject: Re: [Mailman-Users] Custom footer based on sender's email
That is the thing, it will be the same everytime. It is a message automatically generated from a message board, unfortunatly, we are out-sourcing the message board and they are not capable to change the footer on a user level.
You can delete the incoming footer in the same place you add the new one. You can do something like
pl = msg.get_payload(decode=True)
re.sub(pattern_matching_old_footer, replacement_footer, pl)
msg.set_payload(pl)
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan