Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python,': 0.02; 'detect': 0.07; 'tries': 0.07; 'alter': 0.09; 'conf': 0.09; 'craft': 0.09; 'subject:script': 0.09; 'subject:using': 0.09; "system's": 0.09; 'tcp/ip': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'ack': 0.16; 'ah,': 0.16; 'configuring': 0.16; 'fails.': 0.16; 'hostname': 0.16; 'i.e.,': 0.16; 'localhost': 0.16; 'packets.': 0.16; 'received:mac.com': 0.16; 'somewhere.': 0.16; 'subject:send': 0.16; 'tcp': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'module': 0.19; 'received:10.0.1': 0.19; '>>>': 0.22; 'handles': 0.22; 'tests': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**1': 0.23; 'gateway': 0.24; 'proxy': 0.24; 'header': 0.24; 'cc:no real name:2**0': 0.24; 'source': 0.25; 'host': 0.29; '[1]': 0.29; "doesn't": 0.30; 'url:mailman': 0.30; 'getting': 0.31; 'lines': 0.31; 'sep': 0.31; 'url:python': 0.33; 'subject:the': 0.34; 'basic': 0.35; "can't": 0.35; 'smtp': 0.36; 'done': 0.36; 'url:listinfo': 0.36; 'possible': 0.36; 'received:10.0': 0.36; 'url:org': 0.36; 'received:10': 0.37; 'received:17': 0.38; 'pm,': 0.38; 'address.': 0.39; 'system.': 0.39; 'url:mail': 0.40; 'even': 0.60; 'read': 0.60; 'most': 0.60; "you're": 0.61; 'address': 0.63; 'exchange': 0.63; 'real': 0.63; 'maximum': 0.63; 'our': 0.64; 'to:addr:gmail.com': 0.65; 'within': 0.65; 'reply': 0.66; 'direct': 0.67; 'foreign': 0.74; 'address,': 0.75; 'header:In- reply-to:1': 0.84; 'subject:via': 0.84; '2013,': 0.91; 'carries': 0.91; 'destination': 0.91; 'outgoing': 0.91; '2013': 0.98 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794,1.0.431,0.0.0000 definitions=2013-09-17_07:2013-09-18,2013-09-17,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1308280000 definitions=main-1309170117 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: Tryign to send mail via a python script by using the local MTA From: William Ray Wing In-reply-to: Date: Tue, 17 Sep 2013 18:34:50 -0400 Content-transfer-encoding: quoted-printable References: <305a2044-a13e-47f8-9cc1-9e3482424616@googlegroups.com> <52366466$0$29988$c3e8da3$5496439d@news.astraweb.com> <5236B356.7030308@rece.vub.ac.be> <5236BD75.5080904@rece.vub.ac.be> <5236C4B7.3070601@rece.vub.ac.be> <52379718$0$29988$c3e8da3$5496439d@news.astraweb.com> To: Ferrous Cranus X-Mailer: Apple Mail (2.1508) Cc: python-list@python.org, William Ray Wing 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: 46 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1379460925 news.xs4all.nl 15982 [2001:888:2000:d::a6]:33967 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:54338 On Sep 17, 2013, at 5:42 PM, Ferrous Cranus = wrote: > On 17/9/2013 7:30 =CE=BC=CE=BC, Denis McMahon wrote: >> On Tue, 17 Sep 2013 18:17:43 +0300, Ferrous Cranus wrote: >>=20 >>> So cant this be done in python or not? >>> or is a mtetr of configuring the MTA? conf file? >>=20 >> Python can not control data that is added to the message after it has >> left the python program. If you want to retain maximum possible = control >> of the mail process from within python, you need to use a python = module >> that handles the smtp exchange with the destination mta, however even >> then you can not control the content of header lines added by that >> destination mta, which will invariably include the real[1] ip address = of >> your system. >>=20 >> [1] The ip address that it is sending ack packets to as part of the = smtp >> session, so unless you're using a proxy somewhere, this will be your >> system's ip address. Can't fake it. If the other system doesn't know = your >> ip address, it can't send acks, and the tcp session fails. >>=20 > Ah, now we are getting somewhere. >=20 > So the foreign MTA tests for real time connectivity with the local MTA = and it tries to detect a working host and ip address. >=20 > So even if we alter the hostname and the ip address of our localhost = then the smtp procedure will fail correct? > --=20 > https://mail.python.org/mailman/listinfo/python-list I think you need to read up on some of the most basic fundamentals of = tcp/ip networking, i.e., the basis of the global internet. EVERY = network packet (and I do mean every) packet in an IP network carries = both a source and a destination address in its header. These are = fundamentally necessary in order to allow the gateway router at the = originating site to direct an outgoing packet to its destination, and = allow the receiving host at the destination site to craft reply packets. -Bill=