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

2006-06-29 Thread Mark Sapiro
Rob Jackson wrote: >Due to a change in the Message board, the messages come through as >multipart/mixed. > >If I try to run this in the multipart/mixed section of Decorate.py, I get: > >TypeError: expected string or buffer. Not surprising, since the payload of a multipart message is not the text

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

2006-06-29 Thread Rob Jackson
: Rob Jackson [mailto:[EMAIL PROTECTED] Sent: Monday, May 15, 2006 2:49 PM To: 'Rob Jackson'; 'Mark Sapiro'; mailman-users@python.org Subject: RE: [Mailman-Users] Custom footer based on sender's email I found a fix the the problem. Charset is set to UTF-8, and I chang

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

2006-05-15 Thread Rob Jackson
lman-users@python.org Subject: Re: [Mailman-Users] Custom footer based on sender's email Ok, I got this piece kind of working, but there is a problem with this. This is my search and replace string, and the search at this point doesn't matter. pl = re.sub('lksjdfsdf', 'new text&

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

2006-05-15 Thread Rob Jackson
er, it will come through clean, and not garbled. I am stumped! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Sapiro Sent: Thursday, May 11, 2006 3:53 PM To: mailman-users@python.org Subject: Re: [Mailman-Users] Custom footer based on sender's email Mar

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

2006-05-11 Thread Mark Sapiro
Mark Sapiro wrote: >Rob Jackson wrote: > >>+pl = msg.get_payload(decode=True) >>+re.sub('AZ', 'new text', pl) >>+msg.set_payload(pl) > >It looks OK to me. Actually, it's not OK. I overlooked the fact that Python strings are immutable and re.sub doesn't (can't) change them in place.

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

2006-05-11 Thread Mark Sapiro
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.0 -0700 >+++ Decorate.py 2006-05-11 12:14:22.0 -0600 >@@ -20,6 +20,7 @@ > from types import ListType > from email.MIMEText import

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

2006-05-11 Thread Mark Sapiro
Rob Jackson wrote: > >I used to be getting an error when I had it other >places, and then when I moved it to the end, the error went away, Because you were no longer executing the code. >well it is >back now that I am actualy hitting the code before it exits. Here is my >error. Thanks for hel

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

2006-05-11 Thread Rob Jackson
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rob Jackson Sent: Thursday, May 11, 2006 12:07 PM To: 'Mark Sapiro'; mailman-users@python.org Subject: Re: [Mailman-Users] Custom footer based on sender's email I was aware of the if not header and not footer: retu

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

2006-05-11 Thread Rob Jackson
king at other examples throught the program and have been unable to determine how I need to do this. Thanks -Rob -Original Message- From: Mark Sapiro [mailto:[EMAIL PROTECTED] Sent: Thursday, May 11, 2006 11:46 AM To: Rob Jackson; mailman-users@python.org Subject: RE: [Mailman-Users] Custom

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

2006-05-11 Thread Mark Sapiro
Rob Jackson wrote: > >Here it is. > >+++ /u1/mailman/Mailman/Handlers/Decorate.py2006-05-10 >11:36:43.0 -0600 >@@ -188,6 +188,12 @@ > del msg['content-disposition'] > msg['Content-Type'] = 'multipart/mixed' > >+#Testing to replace footer >+pl = msg.get_payload(decode=Tru

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

2006-05-11 Thread Rob Jackson
ate, what, extradict={}): -Original Message- From: Mark Sapiro [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 10, 2006 12:42 PM To: Rob Jackson; mailman-users@python.org Subject: RE: [Mailman-Users] Custom footer based on sender's email Rob Jackson wrote: >This is the diff on the De

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

2006-05-10 Thread Mark Sapiro
Rob Jackson wrote: >This is the diff on the Decorate.py > >191,196d190 >< #Testing to replace footer >< pl = msg.get_payload(decode=True) >< re.sub('AZ', 'new text', pl) >< msg.set_payload(pl) >< >< Please either give me a unified context diff (diff -u) or at least tell me what

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

2006-05-10 Thread Rob Jackson
ter < pl = msg.get_payload(decode=True) < re.sub('AZ', 'new text', pl) < msg.set_payload(pl) < < -Original Message- From: Mark Sapiro [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 10, 2006 11:27 AM To: Rob Jackson; mailman-users@python.org Subj

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

2006-05-10 Thread Mark Sapiro
Rob Jackson wrote: >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 s

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

2006-05-10 Thread Rob Jackson
o the process. -Rob -Original Message- From: Mark Sapiro [mailto:[EMAIL PROTECTED] 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

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

2006-05-05 Thread Mark Sapiro
>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 n

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

2006-05-05 Thread Rob Jackson
PROTECTED] Sent: Thursday, May 04, 2006 2:08 PM To: Rob Jackson Cc: mailman-users@python.org Subject: Re: [Mailman-Users] Custom footer based on sender's email In a flurry of recycled electrons, Rob Jackson wrote: > Was hoping to use some regular expression and just remove some lines. >

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

2006-05-04 Thread Carl Zwanzig
In a flurry of recycled electrons, Rob Jackson wrote: > Was hoping to use some regular expression and just remove some lines. The > lines I need to remove will always be the same. The problem is that it won't always the the same. As you see below, now the footer has "> " in front of each line.

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

2006-05-04 Thread Rob Jackson
: Re: [Mailman-Users] Custom footer based on sender's email On 5/4/06, Rob Jackson <[EMAIL PROTECTED]> wrote: > Actually I just learned that not only do I need to add a footer, I > have to remove the current footer of the incoming message. The logic behind this might be difficult.

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

2006-05-04 Thread Patrick Bogen
On 5/4/06, Rob Jackson <[EMAIL PROTECTED]> wrote: > Actually I just learned that not only do I need to add a footer, I have to > remove the current footer of the incoming message. The logic behind this might be difficult. How to know where the user's message starts and their footer begins? -- - P

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

2006-05-04 Thread Rob Jackson
- From: Mark Sapiro [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 03, 2006 6:18 PM To: Rob Jackson; mailman-users@python.org Subject: Re: [Mailman-Users] Custom footer based on sender's email Rob Jackson wrote: >I need to figure out how to add a footer to an e-mail coming from a specif

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

2006-05-03 Thread Mark Sapiro
Rob Jackson wrote: >I need to figure out how to add a footer to an e-mail coming from a specific >user. I just can't seem to figure this out. I have created a module to >weed out the address, but now I need to munge the body of the message. You will need to do several things. 1) set OWNERS_

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

2006-05-03 Thread Rob Jackson
I need to figure out how to add a footer to an e-mail coming from a specific user. I just can't seem to figure this out. I have created a module to weed out the address, but now I need to munge the body of the message. -Rob -- Mailman-User