Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #70954
| References | <lk8q3j$3mg$2@reader1.panix.com> <tK1av.250678$q95.71799@fx22.am4> <mailman.9693.1399369682.18130.python-list@python.org> <5N2av.257203$q95.207421@fx22.am4> |
|---|---|
| Date | 2014-05-06 20:41 +1000 |
| Subject | Re: Add "Received:" header to email msg in correct position? |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.9695.1399372909.18130.python-list@python.org> (permalink) |
On Tue, May 6, 2014 at 8:26 PM, alister <alister.nospam.ware@ntlworld.com> wrote: > On Tue, 06 May 2014 19:47:54 +1000, Chris Angelico wrote: > >> On Tue, May 6, 2014 at 7:15 PM, alister >> <alister.nospam.ware@ntlworld.com> wrote: >>> On Mon, 05 May 2014 19:51:15 +0000, 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 email module to add it in the >>>> correct place. It always ends up at the "bottom" of the headers below >>>> From: To: etc. It's supposed to go at the above all the Received: >>>> headers that where there when I received it. >>> >>> Is this required or just being polite? >>> what I mean is does the standard state the headers must be in a >>> particular order or can they appear anywhere, you may be spending time >>> trying to resolve an issue that does not need fixing. >> >> Yes, it's required. RFC 2821 [1] section 3.8.2 says "prepend". >> >> ChrisA >> >> [1] http://www.ietf.org/rfc/rfc2821.txt > > oh well, so much for the easy route :-) > This suggests the email module could do with amending so that headers can > be pretended as appended. Even if it's special-cased as a dedicated "prepend received header" method, that would probably do. I can't think of any other headers where you need to specifically order them rather than appending. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Add "Received:" header to email msg in correct position? Grant Edwards <invalid@invalid.invalid> - 2014-05-05 19:51 +0000
Re: Add "Received:" header to email msg in correct position? Ethan Furman <ethan@stoneleaf.us> - 2014-05-05 13:01 -0700
Re: Add "Received:" header to email msg in correct position? Grant Edwards <invalid@invalid.invalid> - 2014-05-05 20:58 +0000
Re: Add "Received:" header to email msg in correct position? Tim Chase <python.list@tim.thechases.com> - 2014-05-05 16:09 -0500
Re: Add "Received:" header to email msg in correct position? Grant Edwards <invalid@invalid.invalid> - 2014-05-06 02:13 +0000
Re: Add "Received:" header to email msg in correct position? Steven D'Aprano <steve@pearwood.info> - 2014-05-06 08:22 +0000
Re: Add "Received:" header to email msg in correct position? Grant Edwards <invalid@invalid.invalid> - 2014-05-06 14:12 +0000
Re: Add "Received:" header to email msg in correct position? Terry Reedy <tjreedy@udel.edu> - 2014-05-06 14:16 -0400
Re: Add "Received:" header to email msg in correct position? Chris Angelico <rosuav@gmail.com> - 2014-05-07 10:13 +1000
Re: Add "Received:" header to email msg in correct position? alister <alister.nospam.ware@ntlworld.com> - 2014-05-06 09:15 +0000
Re: Add "Received:" header to email msg in correct position? Chris Angelico <rosuav@gmail.com> - 2014-05-06 19:47 +1000
Re: Add "Received:" header to email msg in correct position? alister <alister.nospam.ware@ntlworld.com> - 2014-05-06 10:26 +0000
Re: Add "Received:" header to email msg in correct position? Chris Angelico <rosuav@gmail.com> - 2014-05-06 20:41 +1000
Re: Add "Received:" header to email msg in correct position? Grant Edwards <invalid@invalid.invalid> - 2014-05-06 14:15 +0000
Re: Add "Received:" header to email msg in correct position? Grant Edwards <invalid@invalid.invalid> - 2014-05-06 14:19 +0000
Re: Add "Received:" header to email msg in correct position? Chris Angelico <rosuav@gmail.com> - 2014-05-07 00:26 +1000
Re: Add "Received:" header to email msg in correct position? alister <alister.nospam.ware@ntlworld.com> - 2014-05-06 15:16 +0000
Re: Add "Received:" header to email msg in correct position? Burak Arslan <burak.arslan@arskom.com.tr> - 2014-05-06 18:11 +0300
Re: Add "Received:" header to email msg in correct position? Grant Edwards <invalid@invalid.invalid> - 2014-05-06 15:26 +0000
Re: Add "Received:" header to email msg in correct position? Burak Arslan <burak.arslan@arskom.com.tr> - 2014-05-07 18:06 +0300
Re: Add "Received:" header to email msg in correct position? Chris Angelico <rosuav@gmail.com> - 2014-05-08 01:11 +1000
Re: Add "Received:" header to email msg in correct position? Ian Kelly <ian.g.kelly@gmail.com> - 2014-05-07 16:29 -0600
Re: Add "Received:" header to email msg in correct position? Grant Edwards <invalid@invalid.invalid> - 2014-05-08 13:28 +0000
Re: Add "Received:" header to email msg in correct position? Chris Angelico <rosuav@gmail.com> - 2014-05-08 23:47 +1000
Re: Add "Received:" header to email msg in correct position? Ethan Furman <ethan@stoneleaf.us> - 2014-05-08 06:46 -0700
Re: Add "Received:" header to email msg in correct position? Skip Montanaro <skip@pobox.com> - 2014-05-08 09:50 -0500
Re: Add "Received:" header to email msg in correct position? Grant Edwards <invalid@invalid.invalid> - 2014-05-08 18:39 +0000
Re: Add "Received:" header to email msg in correct position? Tim Chase <python.list@tim.thechases.com> - 2014-05-08 13:48 -0500
Re: Add "Received:" header to email msg in correct position? Grant Edwards <invalid@invalid.invalid> - 2014-05-09 14:28 +0000
Re: Add "Received:" header to email msg in correct position? Ethan Furman <ethan@stoneleaf.us> - 2014-05-08 17:00 -0700
Re: Add "Received:" header to email msg in correct position? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2014-05-07 08:58 +0200
Re: Add "Received:" header to email msg in correct position? Grant Edwards <invalid@invalid.invalid> - 2014-05-07 14:32 +0000
Re: Add "Received:" header to email msg in correct position? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2014-05-08 09:44 +0200
Re: Add "Received:" header to email msg in correct position? Emre Hasegeli <emre@hasegeli.com> - 2014-05-07 11:11 +0300
Re: Add "Received:" header to email msg in correct position? Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2014-05-07 10:57 +0200
Re: Add "Received:" header to email msg in correct position? Grant Edwards <invalid@invalid.invalid> - 2014-05-07 14:33 +0000
csiph-web