[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-07-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 26839edf3cc1 by Senthil Kumaran in branch 'default': Fix closes Issue11281 - smtplib.STMP gets source_address parameter, which adds the ability to bind to specific source address on a machine with multiple interfaces. Patch by Paulo Scardine. http

[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-06-27 Thread Paulo Scardine
Paulo Scardine added the comment: Is there anything I should improve in order to get this patch commited? -- resolution: -> remind ___ Python tracker ___ __

[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-28 Thread Paulo Scardine
Paulo Scardine added the comment: Sorry for the last post, I had the impression that I forgot to attach the patch. I'm slow this Monday. -- ___ Python tracker ___ _

[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-28 Thread Paulo Scardine
Paulo Scardine added the comment: oops... -- Added file: http://bugs.python.org/file20945/smtp_lib_source_address.patch ___ Python tracker ___ __

[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-28 Thread Paulo Scardine
Paulo Scardine added the comment: Patch attached. -- Added file: http://bugs.python.org/file20944/smtp_lib_source_address.patch ___ Python tracker ___ __

[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-25 Thread Paulo Scardine
Paulo Scardine added the comment: Giampaolo, Thanks for your kind review, I will send a patch with suggested changes this weekend. Grazie, -- Paulo -- ___ Python tracker ___

[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-25 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: You are right, I haven't thought about that. -- ___ Python tracker ___ ___ Python-bugs-list mail

[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Paulo Scardine
Paulo Scardine added the comment: > There's no need to store the source address as an instance attribute. > Just pass it as-is to socket.create_connection() in __init__ and > connect methods and then get rid of it. Ok, what if user initialize with something like smtplib.SMTP(source_address=('

[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Follow my comments: > + source_address=('', 0)): Make that default to None instead and pass it as-is to socket.create_connection(). > +self.source_address = source_address There's no need to store the source address as an instance

[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Paulo Scardine
Changes by Paulo Scardine : Removed file: http://bugs.python.org/file20844/patch.diff ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Paulo Scardine
Paulo Scardine added the comment: Ok, I changed to a single parameter matching socket.create_connection(). I made my best to update tests and docs, but I don't have a clue if it is right. -- Added file: http://bugs.python.org/file20854/smtp_lib_source_address.patch ___

[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: We already have 3 places where a tuple is used: socket.socket.bind socket.create_connection http.client.HTTPConnection Changing this notation in smtplib for such a rarely used feature is not worth the effort, imo. Also, I would not add two new SMTP attribu

[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Paulo Scardine
Paulo Scardine added the comment: My first idea was to make the argument a tuple to match socket.create_connection(), but SMTP uses host and port arguments, for consistency it's better havin separate source_ip and source_port arguments. As a side effect, it makes easier to specify only source

[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Yes, you must update Doc/library/smtplib.rst and write tests. If you're not the one who's gonna commit the patch you can ignore Doc/whatsnew/3.3.srt and Misc/NEWS changes. Updating the docstring is usually optional but I see smtplib module is already well

[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Paulo Scardine
Paulo Scardine added the comment: @Giampaolo: should I change the text in Doc/library/smtplib.rst or it is infered from the docstrings? -- ___ Python tracker ___ __

[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Paulo Scardine
Paulo Scardine added the comment: Also, it is my first patch and I have no clue about what I'm doing, I don't expect to get it right in the first try - please point any mistakes. -- ___ Python tracker ___

[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: > Seems like the signature of Lib.test.mock_socket.create_connection does > not match socket.create_connection since 2.7. You can add a fake parameter which does nothing. > What is the notation for the new keyword arguments? fun(a, b, c=None, d=None) ---

[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Paulo Scardine
Paulo Scardine added the comment: Seems like the signature of Lib.test.mock_socket.create_connection does not match socket.create_connection since 2.7. I need help with the docs; the last argument is positional and optional, using the `[ ]' notation. What is the notation for the new keyword a

[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: > I would like to add source_ip and source_port parameters to > smtplib.SMTP, default to '' and 0 respectively. It would be better to provide a unique source_address parameter defaulting to None, for consistency with socket.create_connection() expecting a

[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: +1, this has been done for other modules such as ftplib as well and probably could be done for others such as httplib and poplib. -- nosy: +giampaolo.rodola ___ Python tracker

[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread R. David Murray
R. David Murray added the comment: This sounds like a reasonable feature request. If you would like to propose a patch against trunk (py3k, what will become 3.3), I will take a look at it. -- nosy: +r.david.murray stage: -> needs patch type: -> feature request versions: +Python 3.3

[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-21 Thread Paulo Scardine
New submission from Paulo Scardine : In smtplib there is now way to bind to an specific source address on a machine with multiple interfaces; also, there no way to control the source port for the connection. Since 2.7, socket.create_connection accepts a source_address parameter, a (host, port