Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.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.075 X-Spam-Evidence: '*H*': 0.85; '*S*': 0.00; 'subject:Python': 0.06; 'subject:script': 0.09; '(apologies': 0.16; '23,': 0.16; 'ah,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'record,': 0.16; 'subject:mails': 0.16; 'wrote:': 0.18; 'example.': 0.24; 'passes': 0.24; 'sends': 0.24; "shouldn't": 0.24; 'sort': 0.25; 'posts': 0.26; 'skip:" 40': 0.26; 'header:In- Reply-To:1': 0.27; 'record': 0.27; 'chris': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'txt': 0.31; 'lists': 0.32; 'checked': 0.32; 'python.org': 0.32; 'supposed': 0.32; 'whom': 0.33; 'problem': 0.35; 'case,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'subject:Simple': 0.36; 'doing': 0.36; 'subject:?': 0.36; 'example,': 0.37; 'email addr:python.org': 0.37; 'being': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'mailing': 0.39; 'read': 0.60; 'matter': 0.61; 'simply': 0.61; "you're": 0.61; 'email name:python-list': 0.65; 'here': 0.66; 'jul': 0.74; 'theirs.': 0.84; 'address;': 0.91; 'technique': 0.93; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=88WNWkAbtuO7V9FpjuREVUFXRvTxny2ccZgGeqTVKlE=; b=nADDHPgwNXKYUATeTpqlZCOADTVh0zT9fuYduCs36qHnQqGUAgcHP/BtXOhCW2ITj7 q6Nb6hqdZUzznwEMzrGdDRuLJTs1L1SA4BxPCR+8fBKwPsNOyw7UvHzdc0jTRKMKriYk aXEKppJ188KM0PrBLgkiKtpN5nfXbhCZvYj1YwfUQLlckIsk1wuF22IVm2EqUBdts/+Z QRFjSW2kaWnbQIhLPJxTftryQK/uiIa0BQV61aTGqrvkV1YgePbx2mCslUQLD9HtE1kJ p5ugc4hkgtvhS3Xwn9PmShPN4mfyFLYfdziUqLoDOasI/4t0nvSzg06eq0lE/paaRooT mmeA== MIME-Version: 1.0 X-Received: by 10.220.48.17 with SMTP id p17mr10539801vcf.97.1374571836927; Tue, 23 Jul 2013 02:30:36 -0700 (PDT) In-Reply-To: References: <368qu85msgfhuk2j2s13qj0bqn4rkcint9@4ax.com> <51ED3CEB.1070706@gmail.com> Date: Tue, 23 Jul 2013 19:30:36 +1000 Subject: Re: Simple Python script as SMTP server for outgoing e-mails? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1374571839 news.xs4all.nl 15973 [2001:888:2000:d::a6]:44030 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:51077 On Tue, Jul 23, 2013 at 7:19 PM, Chris Angelico wrote: > Ah, there's a solution to this one. You simply use your own > envelope-from address; SPF shouldn't be being checked for the From: > header. There's an example, by the way, of this exact technique right here - python-list@python.org sends mail to me with an envelope-from of "python-list-bounces+rosuav=gmail.com@python.org" - which passes SPF, since python.org has a TXT record designating the sending IP as one of theirs. It doesn't matter that invalid.invalid (your supposed domain) doesn't have an SPF record, nor would it be a problem if it had one that said "v=spf1 -all", because that domain wasn't checked. Mailing lists are doing the same sort of forwarding that you're doing. (Apologies to those who read this as a newsgroup, for whom this won't be as parallel an example. But it's still the case, just not for the posts you receive.) ChrisA