Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'socket': 0.05; '21,': 0.07; 'parameter': 0.07; 'referring': 0.07; 'python': 0.09; 'specifying': 0.09; 'subject:Source': 0.09; 'to:addr:comp.lang.python': 0.09; 'underlying': 0.09; 'wrong,': 0.09; 'cc:addr:python-list': 0.10; 'suggest': 0.11; '(the': 0.15; '(note': 0.16; 'bind': 0.16; 'function?': 0.16; 'hello:': 0.16; 'imap4': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'specify': 0.17; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'machine': 0.24; 'pass': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'separate': 0.27; 'interface': 0.27; 'this?': 0.28; 'chris': 0.28; 'run': 0.28; 'address)': 0.29; 'source': 0.29; "i'm": 0.29; 'url:python': 0.32; 'could': 0.32; 'docs': 0.33; 'received:google.com': 0.34; 'nov': 0.35; 'received:209.85': 0.35; 'url:org': 0.36; 'url:library': 0.36; 'client': 0.36; 'address.': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'url:docs': 0.38; 'address': 0.60; 'from:no real name:2**0': 0.60; '20,': 0.65; 'subject:Client': 0.84 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=path:newsgroups:date:in-reply-to:complaints-to:injection-info :nntp-posting-host:references:user-agent:x-google-web-client :x-google-ip:mime-version:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=a6NobyJ7jZ2SaX2T2v5IWNEU6FHi9P2qHHLLf0t+7Rk=; b=lzizKmMNIF4AgCUs+CuYoRpwyMdobP2d0uMHNoeWYkVJkvnO2wDBsqQyR6u2l1Vvf5 fnxUp8Zn6YKmsYc61vn5rH/qR+/allf0BfzI9ybuPVDy5bJcant0lSiO9vaMAQf9KFjt xu+j2zaYAJTwb8fsYalG2K9LL9VaE7izFL3AZZNDNAK+XkhpnkVj9eIahp4AKALmsscN KdtbCvDBPfwY49II3oXRNndprrozFjAYfIIjFSMeEGiFwgWUpjGHK/z5l29vwKfs7jwf CUkCvH7hL6zeqyl6xfYQMFlx02Tqhr0aF2t9fQnI0Vw6+dVDxXonN2IFX9b2wpXmAtQX mqTg== Newsgroups: comp.lang.python Date: Tue, 20 Nov 2012 14:00:42 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=147.203.99.20; posting-account=EjjbUAoAAACUM4MjU1iSfrSUM9caQEYG References: <72731eb3-1521-46f0-8601-8a2df58849d8@googlegroups.com> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 147.203.99.20 MIME-Version: 1.0 Subject: Re: Choosing Source Address to Bind Socket to in IMAP Client From: brintoul@controlledthinking.com To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQnTVye8WaVGt8X3Cj1bXvKNngxv8baOZ8amKjPoQyfrSLzDXnRDRIDvMpFh7aTRw+MOPmC2 Cc: python-list@python.org 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: , Message-ID: Lines: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1353448846 news.xs4all.nl 6846 [2001:888:2000:d::a6]:59571 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33671 On Tuesday, November 20, 2012 1:48:46 PM UTC-8, Chris Angelico wrote: > On Wed, Nov 21, 2012 at 8:14 AM, wrote: > > > Hello: > > > > > > I have a multihomed machine that I would like to run the Python imaplib's IMAP4 client on. I would like to be able to specify which interface the underlying socket will bind to as its source address. How could I best do this? > > > > You're referring to this function? > > > > http://docs.python.org/3.3/library/imaplib.html#imaplib.IMAP4 > > > > The docs suggest that you can simply pass it a parameter to specify > > the address to bind to. (Note that you bind to addresses, not > > interfaces. Figuring out which interface has which address is a > > separate issue.) > > > > ChrisA Unless I'm reading that wrong, that's specifying the address/host to connect to (the destination address) not the source address...