Re: Add "Received:" header to email msg in correct position?

2014-05-09 Thread Grant Edwards
On 2014-05-08, Tim Chase wrote: > On 2014-05-08 18:39, Grant Edwards wrote: >> > Looks like a Zippy the Pinhead quote to me... >> >> Yep. > > I'm kinda disappointed having the curtain pulled back like that. I'd > just assumed it was some nifty tool that turned a GPG/PGP signature > into MadLib

Re: Add "Received:" header to email msg in correct position?

2014-05-08 Thread Ethan Furman
On 05/08/2014 11:39 AM, Grant Edwards wrote: Yep. I've removed a few of them from the file over the years because some people were offended by them. And I'll continue to do so... Thanks, much appreciated. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Add "Received:" header to email msg in correct position?

2014-05-08 Thread Tim Chase
On 2014-05-08 18:39, Grant Edwards wrote: > > Looks like a Zippy the Pinhead quote to me... > > Yep. I'm kinda disappointed having the curtain pulled back like that. I'd just assumed it was some nifty tool that turned a GPG/PGP signature into MadLibs™-style fill-in-the-blank and then flowed in

Re: Add "Received:" header to email msg in correct position?

2014-05-08 Thread Grant Edwards
On 2014-05-08, Skip Montanaro wrote: > On Thu, May 8, 2014 at 8:46 AM, Ethan Furman wrote: >> Some filtering of your sigs would be appreciated. > > Looks like a Zippy the Pinhead quote to me... > > http://rosinstrument.com/cgi-bin/fortune.pl/21?97 Yep. I've removed a few of them from the file o

Re: Add "Received:" header to email msg in correct position?

2014-05-08 Thread Skip Montanaro
On Thu, May 8, 2014 at 8:46 AM, Ethan Furman wrote: > Some filtering of your sigs would be appreciated. Looks like a Zippy the Pinhead quote to me... http://rosinstrument.com/cgi-bin/fortune.pl/21?97 Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: Add "Received:" header to email msg in correct position?

2014-05-08 Thread Ethan Furman
On 05/08/2014 06:28 AM, Grant Edwards wrote: Yow! All this time I've at been VIEWING a RUSSIAN MIDGET SODOMIZE a HOUSECAT! Some filtering of your sigs would be appreciated. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Add "Received:" header to email msg in correct position?

2014-05-08 Thread Chris Angelico
On Thu, May 8, 2014 at 11:28 PM, Grant Edwards wrote: > I also don't remember off the top of my head what you're > supposed to do with headers that get too long (I think you just stick > in a \r\n followed by some whitespace and then continue the header, > but I'd have to look that up and then tes

Re: Add "Received:" header to email msg in correct position?

2014-05-08 Thread Grant Edwards
On 2014-05-07, Ian Kelly wrote: > On May 7, 2014 9:13 AM, "Chris Angelico" wrote: >> >> On Thu, May 8, 2014 at 1:06 AM, Burak Arslan > wrote: >> > Seeing how discussion is still going on about this, I'd like to state >> > once more what I said above in other words: You just need to do this: >> >

Re: Add "Received:" header to email msg in correct position?

2014-05-08 Thread Antoon Pardon
On 07-05-14 16:32, Grant Edwards wrote: >> So I'm not sure that what you want to do is the polite thing to do. > Why not? Nevermind, I originally hadn't thought things completly through. -- Antoon Pardon -- https://mail.python.org/mailman/listinfo/python-list

Re: Add "Received:" header to email msg in correct position?

2014-05-07 Thread Ian Kelly
On May 7, 2014 9:13 AM, "Chris Angelico" wrote: > > On Thu, May 8, 2014 at 1:06 AM, Burak Arslan wrote: > > Seeing how discussion is still going on about this, I'd like to state > > once more what I said above in other words: You just need to do this: > > > > "Received: blah\r\n" + message.to_str

Re: Add "Received:" header to email msg in correct position?

2014-05-07 Thread Chris Angelico
On Thu, May 8, 2014 at 1:06 AM, Burak Arslan wrote: > Seeing how discussion is still going on about this, I'd like to state > once more what I said above in other words: You just need to do this: > > "Received: blah\r\n" + message.to_string() > > or better: > > socket.write("Received: blah\r\n") >

Re: Add "Received:" header to email msg in correct position?

2014-05-07 Thread Burak Arslan
On 05/06/14 18:26, Grant Edwards wrote: > On 2014-05-06, Burak Arslan wrote: >> On 05/06/14 12:47, Chris Angelico wrote: >>> On Tue, May 6, 2014 at 7:15 PM, alister >>> wrote: On Mon, 05 May 2014 19:51:15 +, Grant Edwards wrote: > I'm working on a Python app that receives an e-

Re: Add "Received:" header to email msg in correct position?

2014-05-07 Thread Grant Edwards
On 2014-05-07, Antoon Pardon wrote: > On 07-05-14 10:11, Emre Hasegeli wrote: >> Antoon Pardon > >: >> >> > I'm working on a Python app that receives an e-mail message via >> SMTP, >> > does some trivial processing on it, and forwards it to another

Re: Add "Received:" header to email msg in correct position?

2014-05-07 Thread Grant Edwards
On 2014-05-07, Antoon Pardon wrote: > On 05-05-14 21:51, Grant Edwards wrote: >> I'm working on a Python app that receives an e-mail message via SMTP, >> does some trivial processing on it, and forwards it to another SMTP >> server. >> >> I'd like to do the polite thing and add a "Received:" heade

Re: Add "Received:" header to email msg in correct position?

2014-05-07 Thread Antoon Pardon
On 07-05-14 10:11, Emre Hasegeli wrote: > Antoon Pardon >: > > > I'm working on a Python app that receives an e-mail message via > SMTP, > > does some trivial processing on it, and forwards it to another SMTP > > server. > > > > I'd like

Re: Add "Received:" header to email msg in correct position?

2014-05-07 Thread Emre Hasegeli
Antoon Pardon : > I'm working on a Python app that receives an e-mail message via SMTP, > > does some trivial processing on it, and forwards it to another SMTP > > server. > > > > I'd like to do the polite thing and add a "Received:" header, but I > > can't figure out how to get Python's email mod

Re: Add "Received:" header to email msg in correct position?

2014-05-07 Thread Antoon Pardon
On 05-05-14 21:51, Grant Edwards wrote: > I'm working on a Python app that receives an e-mail message via SMTP, > does some trivial processing on it, and forwards it to another SMTP > server. > > I'd like to do the polite thing and add a "Received:" header, but I > can't figure out how to get Pytho

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Chris Angelico
On Wed, May 7, 2014 at 4:16 AM, Terry Reedy wrote: > If the prepend requirement is covered by > > "The email package is a library for managing email messages, including MIME > and other RFC 2822-based message documents. It is specifically not designed > to do any sending of email messages to SMTP

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Terry Reedy
On 5/5/2014 4:58 PM, Grant Edwards wrote: On 2014-05-05, Ethan Furman wrote: I don't know that it matters, but which Python version? I usually does these days. Sorry, should have mentioned it: 2.7.5 email has been improved with successive 3.x versions. https://docs.python.org/3/library/

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Grant Edwards
On 2014-05-06, Burak Arslan wrote: > > On 05/06/14 12:47, Chris Angelico wrote: >> On Tue, May 6, 2014 at 7:15 PM, alister >> wrote: >>> On Mon, 05 May 2014 19:51:15 +, Grant Edwards wrote: >>> I'm working on a Python app that receives an e-mail message via SMTP, does some trivial p

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread alister
On Tue, 06 May 2014 14:15:08 +, Grant Edwards wrote: > > I'd like to do it the right way whether it's required by the letter of > the law or not. So do I , although i might have left a cosmetic issue until the rest of the app was functioning as desired. As wiser minds than mine have now conf

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Burak Arslan
On 05/06/14 12:47, Chris Angelico wrote: > On Tue, May 6, 2014 at 7:15 PM, alister > wrote: >> On Mon, 05 May 2014 19:51:15 +, Grant Edwards wrote: >> >>> I'm working on a Python app that receives an e-mail message via SMTP, >>> does some trivial processing on it, and forwards it to another S

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Yimr Zero
If you use Python 2.7, you should add urllib, urllib2 modules. If you use Python 3, the two modules mentioned above are included in urllib. -- https://mail.python.org/mailman/listinfo/python-list

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Chris Angelico
On Wed, May 7, 2014 at 12:15 AM, Grant Edwards wrote: > On 2014-05-06, alister wrote: >> On Mon, 05 May 2014 19:51:15 +, Grant Edwards wrote: >> >>> I'm working on a Python app that receives an e-mail message via SMTP, >>> does some trivial processing on it, and forwards it to another SMTP >>

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Grant Edwards
On 2014-05-06, Grant Edwards wrote: > On 2014-05-06, alister wrote: >> On Mon, 05 May 2014 19:51:15 +, Grant Edwards wrote: >> >>> I'm working on a Python app that receives an e-mail message via SMTP, >>> does some trivial processing on it, and forwards it to another SMTP >>> server. >>> >>>

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Grant Edwards
On 2014-05-06, alister wrote: > On Mon, 05 May 2014 19:51:15 +, Grant Edwards wrote: > >> I'm working on a Python app that receives an e-mail message via SMTP, >> does some trivial processing on it, and forwards it to another SMTP >> server. >> >> I'd like to do the polite thing and add a "Re

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Grant Edwards
On 2014-05-06, Steven D'Aprano wrote: > On Tue, 06 May 2014 02:13:09 +, Grant Edwards wrote: > >> There's is a somewhat messy way to do it by calling msg.items() to >> retrieve all the current headers, removing all of them, and then adding >> them all back (includeing the new one) in the order

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Chris Angelico
On Tue, May 6, 2014 at 8:26 PM, alister wrote: > On Tue, 06 May 2014 19:47:54 +1000, Chris Angelico wrote: > >> On Tue, May 6, 2014 at 7:15 PM, alister >> wrote: >>> On Mon, 05 May 2014 19:51:15 +, Grant Edwards wrote: >>> I'm working on a Python app that receives an e-mail message via S

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread alister
On Tue, 06 May 2014 19:47:54 +1000, Chris Angelico wrote: > On Tue, May 6, 2014 at 7:15 PM, alister > wrote: >> On Mon, 05 May 2014 19:51:15 +, Grant Edwards wrote: >> >>> I'm working on a Python app that receives an e-mail message via SMTP, >>> does some trivial processing on it, and forward

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Chris Angelico
On Tue, May 6, 2014 at 7:15 PM, alister wrote: > On Mon, 05 May 2014 19:51:15 +, Grant Edwards wrote: > >> I'm working on a Python app that receives an e-mail message via SMTP, >> does some trivial processing on it, and forwards it to another SMTP >> server. >> >> I'd like to do the polite thi

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread alister
On Mon, 05 May 2014 19:51:15 +, Grant Edwards wrote: > I'm working on a Python app that receives an e-mail message via SMTP, > does some trivial processing on it, and forwards it to another SMTP > server. > > I'd like to do the polite thing and add a "Received:" header, but I > can't figure o

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Steven D'Aprano
On Tue, 06 May 2014 02:13:09 +, Grant Edwards wrote: > There's is a somewhat messy way to do it by calling msg.items() to > retrieve all the current headers, removing all of them, and then adding > them all back (includeing the new one) in the order I want them. Does msg.items() return the ac

Re: Add "Received:" header to email msg in correct position?

2014-05-05 Thread Grant Edwards
On 2014-05-05, Tim Chase wrote: > On 2014-05-05 20:58, Grant Edwards wrote: >> On 2014-05-05, Ethan Furman wrote: >> > On 05/05/2014 12:51 PM, Grant Edwards wrote: >> >> I'd like to do the polite thing and add a "Received:" header, >> >> but I can't figure out how to get Python's email module to

Re: Add "Received:" header to email msg in correct position?

2014-05-05 Thread Tim Chase
On 2014-05-05 20:58, Grant Edwards wrote: > On 2014-05-05, Ethan Furman wrote: > > On 05/05/2014 12:51 PM, Grant Edwards wrote: > >> I'd like to do the polite thing and add a "Received:" header, > >> but I can't figure out how to get Python's email module to add > >> it in the correct place. It a

Re: Add "Received:" header to email msg in correct position?

2014-05-05 Thread Grant Edwards
On 2014-05-05, Ethan Furman wrote: > On 05/05/2014 12:51 PM, Grant Edwards wrote: [...] >> I'd like to do the polite thing and add a "Received:" header, but I >> can't figure out how to get Python's email module to add it in the >> correct place. It always ends up at the "bottom" of the headers

Re: Add "Received:" header to email msg in correct position?

2014-05-05 Thread Ethan Furman
On 05/05/2014 12:51 PM, Grant Edwards wrote: I'm working on a Python app that receives an e-mail message via SMTP, does some trivial processing on it, and forwards it to another SMTP server. I'd like to do the polite thing and add a "Received:" header, but I can't figure out how to get Python's

Add "Received:" header to email msg in correct position?

2014-05-05 Thread Grant Edwards
I'm working on a Python app that receives an e-mail message via SMTP, does some trivial processing on it, and forwards it to another SMTP server. I'd like to do the polite thing and add a "Received:" header, but I can't figure out how to get Python's email module to add it in the correct place. I