Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: Add "Received:" header to email msg in correct position? Date: Wed, 7 May 2014 14:32:43 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 26 Message-ID: References: NNTP-Posting-Host: dsl.comtrol.com X-Trace: reader1.panix.com 1399473163 21931 64.122.56.22 (7 May 2014 14:32:43 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Wed, 7 May 2014 14:32:43 +0000 (UTC) User-Agent: slrn/1.0.1 (Linux) Xref: csiph.com comp.lang.python:71025 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:" 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. > > I thought that was the job of the SMTP servers, not of email > applications. Exactly. And the SMTP server I'm writing uses the email module to manipulate headers as messages are processed. > So I'm not sure that what you want to do is the polite thing to do. Why not? -- Grant Edwards grant.b.edwards Yow! Th' MIND is the Pizza at Palace of th' SOUL gmail.com