Choosing Source Address to Bind Socket to in IMAP Client

brintoul at controlledthinking.com brintoul at controlledthinking.com
Tue Nov 20 23:12:30 CET 2012


On Tuesday, November 20, 2012 1:59:34 PM UTC-8, Prasad, Ramit wrote:
> brintoul at controlledthinking.com 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?
> 
> 
> 
> One assumes by programming.
> 
> 
> 
> > 
> 
> > Thanks for any help...
> 
> 
> 
> You are quite welcome. :)
> 
> 
> 
> On a less flippant note, maybe some links would help you 
> 
> get started.
> 
> 
> 
> http://www.doughellmann.com/PyMOTW/imaplib/
> 
> http://yuji.wordpress.com/2011/06/22/python-imaplib-imap-example-with-gmail/ 
> 
> http://docs.python.org/2/library/imaplib.html
> 
> 
> 
> 
> 
> ~Ramit
> 
> 
> 
> 
> 
> This email is confidential and subject to important disclaimers and
> 
> conditions including on offers for the purchase or sale of
> 
> securities, accuracy and completeness of information, viruses,
> 
> confidentiality, legal privilege, and legal entity disclaimers,
> 
> available at http://www.jpmorgan.com/pages/disclosures/email.

While I appreciate your attempt at humor, this is not information which helps me.  Perhaps you are not familiar with the basics of socket programming. This is all fine and dandy, and it is good to "know what you don't know".  If you're interested, look at the third argument to "create_connection": http://docs.python.org/2/library/socket.html


More information about the Python-list mailing list