Choosing Source Address to Bind Socket to in IMAP Client
brintoul at controlledthinking.com
brintoul at controlledthinking.com
Tue Nov 20 17:00:42 EST 2012
On Tuesday, November 20, 2012 1:48:46 PM UTC-8, Chris Angelico wrote:
> On Wed, Nov 21, 2012 at 8:14 AM, <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?
>
>
>
> 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...
More information about the Python-list
mailing list