Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin3!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed2a.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.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'receives': 0.04; 'subject:position': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'smtp,': 0.16; 'subject:Add': 0.16; 'do.': 0.18; 'app': 0.19; 'module': 0.19; "python's": 0.19; 'seems': 0.21; 'cc:addr:python.org': 0.22; 'headers': 0.24; 'server.': 0.24; 'cc:2**0': 0.24; '>': 0.26; 'header:In-Reply-To:1': 0.27; 'correct': 0.29; 'message-id:@mail.gmail.com': 0.30; "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; 'received:google.com': 0.35; 'add': 0.35; 'there': 0.35; 'smtp': 0.36; 'subject:?': 0.36; 'application': 0.37; 'skip:& 10': 0.38; 'ends': 0.38; 'skip:& 20': 0.39; 'does': 0.39; 'sure': 0.39; 'how': 0.40; 'received:': 0.65; 'header:Reply-To:1': 0.67; 'reply- to:no real name:2**0': 0.71; 'pardon': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hasegeli.com; s=google; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=SiRNk7H9AsZUpEyIuYgg1uqcxr6PPvOWBK2QhX9qgl4=; b=exmSHtL+b79/K1nXT37eew6tYy4A6mIvzL0LecFVo/w1wDynxyfrVXEMEFfQdImJcc OBgqBtXmC2Za505mevs28swMNMuH+IPM8GY85azHNjVBpKilQTyJtMcfVDnd5CJ4MRVn iI9mRfWzblH05FoYD4FmHvqextmuNfLx/I3JA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=SiRNk7H9AsZUpEyIuYgg1uqcxr6PPvOWBK2QhX9qgl4=; b=QZLtL+KA9/C5+0830CuuT1JOuIoH0/4gbYqmapSNKhL6fPZpU1B4MLWBquez9kdMG8 0heGYNIcMeiJyDbt/si1yHzSQdVxkptBLh+BK8Car+d8G6C7fD014NUahFN32Dq1X3/K JFfU5gc1e+859MQXp9EYh+qmmWtmcn9pFif1F6pb8vb30IRwj1tgJbdo9RLqP7mfq/Nw JCK4u7PpLKdNIZiPq/fYi5/MCtPXHWWm8V8nhwkkC0+IwJaqShaQhj70OrWXEBnD8Oqh lrrTHX0bNL7+gV2n/PPLiV/WsYxJm60vVn2pMxB1YwyrZZzPY6pbkcqqIlVhdXxYP4RR 39/g== X-Gm-Message-State: ALoCoQkXZa3qlYXkTRCxh4DxLtNq7mSkmsOCeca/6D8Jp8K9VFKr8/sWrV2glxLcb5ObRvp4nm/z MIME-Version: 1.0 X-Received: by 10.58.120.46 with SMTP id kz14mr6396855veb.25.1399450291061; Wed, 07 May 2014 01:11:31 -0700 (PDT) In-Reply-To: <5369D9A5.4040706@rece.vub.ac.be> References: <5369D9A5.4040706@rece.vub.ac.be> Date: Wed, 7 May 2014 11:11:30 +0300 Subject: Re: Add "Received:" header to email msg in correct position? From: Emre Hasegeli To: Antoon Pardon Content-Type: multipart/alternative; boundary=089e0111c0027afb0f04f8cae942 X-Mailman-Approved-At: Wed, 07 May 2014 10:34:50 +0200 Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: emre@hasegeli.com 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: 52 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1399451691 news.xs4all.nl 2903 [2001:888:2000:d::a6]:34267 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:71011 --089e0111c0027afb0f04f8cae942 Content-Type: text/plain; charset=UTF-8 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 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. So I'm not sure > that what you want to do is the polite thing to do. > This application seems like an SMTP server. --089e0111c0027afb0f04f8cae942 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Antoon Pardon <antoon.pa= rdon@rece.vub.ac.be>:

> I'm working on a Python app that receives an e-mail message via SM= TP,
> 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:" he= ader, but I
> can't figure out how to get Python's email module to add it in= the
> correct place. =C2=A0It always ends up at the "bottom" of th= e headers below
> From: To: etc. =C2=A0It's supposed to go at the above all the Rece= ived:
> headers that where there when I received it.

I thought that was the job of the SMTP servers, not of email
applications. So I'm not sure
that what you want to do is the polite thing to do.

This application seems like an SMTP server= .

--089e0111c0027afb0f04f8cae942--