Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!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; 'argument': 0.04; 'socket': 0.05; 'completeness': 0.07; 'override': 0.07; 'python': 0.09; 'received:155': 0.09; 'subclass': 0.09; 'subject:Source': 0.09; 'underlying': 0.09; 'cc:addr:python-list': 0.10; 'bind': 0.16; 'disclaimers': 0.16; 'disclaimers,': 0.16; 'from:addr:jpmorgan.com': 0.16; 'imap4': 0.16; 'received:155.180': 0.16; 'received:159.53': 0.16; 'received:159.53.110': 0.16; 'received:159.53.110.174': 0.16; 'received:bankone.net': 0.16; 'received:exchad.jpmchase.net': 0.16; 'received:jpmchase.com': 0.16; 'received:jpmchase.net': 0.16; 'received:sj2.jpmchase.com': 0.16; 'received:svr.bankone.net': 0.16; 'securities,': 0.16; 'url:disclosures': 0.16; 'url:jpmorgan': 0.16; 'wrote:': 0.17; 'specify': 0.17; 'question.': 0.20; 'object.': 0.22; 'cc:2**0': 0.23; 'received:169.254': 0.24; 'machine': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'skip:" 20': 0.26; 'accuracy': 0.27; 'interface': 0.27; 'this?': 0.28; 'fine': 0.28; 'run': 0.28; 'received:169': 0.29; 'source': 0.29; 'connection': 0.30; 'url:python': 0.32; 'help,': 0.32; 'could': 0.32; 'third': 0.34; 'programming.': 0.35; 'url:org': 0.36; 'url:library': 0.36; 'client': 0.36; 'charset:us-ascii': 0.36; 'address.': 0.36; 'subject:: ': 0.38; 'url:docs': 0.38; 'your': 0.60; 'helps': 0.63; 'information': 0.63; 'information,': 0.63; 'url:email': 0.63; 'more': 0.63; 'legal': 0.65; 'subject': 0.66; 'purchase': 0.67; 'sale': 0.76; 'received:169.254.8': 0.84; 'subject:Client': 0.84 X-DKIM: OpenDKIM Filter v2.1.3 sj2.jpmchase.com qAKMfHC9014646 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpmorgan.com; s=smtpout; t=1353451278; bh=c23LySbDsBB+AdP/4eyD9SI7VmHbtXGK+DwplgdfjFM=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Transfer-Encoding:MIME-Version:Content-Type; b=BKfIiId4KTJm8oD/TR5qiRoVHRLLtaJsAR+1lJoSAi2s5Ld4vBJbd1BiTV0NEP4YK 6JDM49Df7RWbrqcrfMw2LI4z7v9Sq6tSkJMtsq67Fy6Ysirs4ILzWlo3aVIbPyLc+s RLsdlhMeGym0ph6RX1qn73wOGlYE+VGHg4ETQjYk= From: "Prasad, Ramit" To: "brintoul@controlledthinking.com" Subject: RE: Choosing Source Address to Bind Socket to in IMAP Client Thread-Topic: Choosing Source Address to Bind Socket to in IMAP Client Thread-Index: AQHNx2wh2PneXNU4Eki5xNtcfprKPJfzTHJQ Date: Tue, 20 Nov 2012 22:41:13 +0000 References: <72731eb3-1521-46f0-8601-8a2df58849d8@googlegroups.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.67.79.47] Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-DLP-FWD: Yes Content-Type: text/plain; charset="us-ascii" 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: , Newsgroups: comp.lang.python Message-ID: Lines: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1353451280 news.xs4all.nl 6847 [2001:888:2000:d::a6]:40216 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33678 brintoul@controlledthinking=2Ecom wrote:=0D=0A> > > I have a multihomed mac= hine that I would like to run the Python imaplib's IMAP4 client on=2E I wo= uld like to be=0D=0A> > > able to specify which interface the underlying so= cket will bind to as its source address=2E How could I best do=0D=0A> > > = this?=0D=0A[snip]=0D=0A=0D=0A> While I appreciate your attempt at humor, th= is is not information which helps me=2E Perhaps you are not familiar=0D=0A= > with the basics of socket programming=2E This is all fine and dandy, and = it is good to "know what you don't know"=2E=0D=0A> If you're interested, lo= ok at the third argument to "create_connection":=0D=0A> http://docs=2Epytho= n=2Eorg/2/library/socket=2Ehtml=0D=0A=0D=0AApologies, I misread your questi= on=2E =0D=0A=0D=0AAccording to the imaplib docs, you can subclass IMAP4 and= override =0D=0A`IMAP4=2Eopen` to create the socket and bind it to the desi= red interface=2E=0D=0AYou could also connect using IMAP4 and then close/reo= pen the socket=0D=0Ainside the IMAP4 connection object=2E =0D=0A=0D=0A=0D= =0AI hope that is more help,=0D=0ARamit=0D=0A=0D=0A=0D=0AThis email is conf= idential and subject to important disclaimers and=0D=0Aconditions including= on offers for the purchase or sale of=0D=0Asecurities, accuracy and comple= teness of information, viruses,=0D=0Aconfidentiality, legal privilege, and = legal entity disclaimers,=0D=0Aavailable at http://www=2Ejpmorgan=2Ecom/pag= es/disclosures/email=2E