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.
diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py
index 9f8a054..70654c5 100644
--- a/Lib/test/test_smtplib.py
+++ b/Lib/test/test_smtplib.py
@@ -72,6 +72,14 @@
         smtp = smtplib.SMTP(HOST, self.port)
         smtp.close()
 
+    def testSourceAddress(self):
+        mock_socket.reply_with(b"220 Hola mundo")
+        # connects
+        smtp = smtplib.SMTP(HOST, self.port,
+                source_address=('127.0.0.1',19876))
+        self.assertEqual(smtp.source_address, ('127.0.0.1', 19876))
+        smtp.close()
+
     def testBasic2(self):
         mock_socket.reply_with(b"220 Hola mundo")
         # connects, include port in host name
@@ -206,6 +214,15 @@
         smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3)
         smtp.quit()
 
+    def testSourceAddress(self):
+        # connect
+        smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3,
+                            source_address=('127.0.0.1', 19876))
+        self.assertEqual(smtp.source_address, ('127.0.0.1', 19876))
+        self.assertEqual(smtp.local_hostname, 'localhost')
+        print(dir(smtp))
+        smtp.quit()
+
     def testNOOP(self):
         smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=3)
         expected = (250, b'Ok')