Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'receives': 0.04; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'subject:position': 0.09; '~ethan~': 0.09; 'python': 0.11; 'matters,': 0.16; 'smtp,': 0.16; 'subject:Add': 0.16; 'version?': 0.16; 'wrote:': 0.18; 'app': 0.19; 'module': 0.19; "python's": 0.19; 'header:User-Agent:1': 0.23; 'headers': 0.24; 'server.': 0.24; 'header:In-Reply-To:1': 0.27; 'correct': 0.29; "i'm": 0.30; 'header,': 0.31; 'trivial': 0.31; 'figure': 0.32; 'supposed': 0.32; 'another': 0.32; "i'd": 0.34; "can't": 0.35; 'but': 0.35; 'add': 0.35; 'there': 0.35; 'smtp': 0.36; 'charset:us-ascii': 0.36; 'subject:?': 0.36; 'ends': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'received:173': 0.61; 'received:': 0.65; 'edwards': 0.91 Date: Mon, 05 May 2014 13:01:29 -0700 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Add "Received:" header to email msg in correct position? References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3304.hostgator.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stoneleaf.us X-BWhitelist: no X-Source-IP: 173.12.184.233 X-Exim-ID: 1WhP4r-0004Ph-Rj X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([173.12.184.233]) [173.12.184.233]:55626 X-Source-Auth: ethan+stoneleaf.us X-Email-Count: 1 X-Source-Cap: dG9idWs7dG9idWs7Z2F0b3IzMzA0Lmhvc3RnYXRvci5jb20= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1399323113 news.xs4all.nl 2881 [2001:888:2000:d::a6]:43716 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:70934 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 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 don't know that it matters, but which Python version? -- ~Ethan~