{"thread":{"id":"1288","subject":"[PATCH 1/1] Support configurable SMTP port for stg mail.","startedAt":"2005-07-21T20:20:58Z","lastAt":"2005-07-21T20:55:46Z","messageCount":2,"participants":["Bryan larsen","Catalin Marinas"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"6297","messageId":"20050721202058.8047.77221.stgit@h164.c77.b0.tor.eicat.ca","threadId":"1288","inReplyTo":null,"subject":"[PATCH 1/1] Support configurable SMTP port for stg mail.","fromName":"Bryan larsen","fromEmail":"bryanlarsen@yahoo.com","sentAt":"2005-07-21T20:20:58Z","receivedAt":"2005-07-21T20:20:58Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"The example configuration file makes it appear that the SMTP port is configurable.  Make it so.\n\nSigned-off-by: Bryan Larsen <bryan.larsen@gmail.com>\n---\n\n stgit/commands/mail.py |    8 +++++++-\n 1 files changed, 7 insertions(+), 1 deletions(-)\n\ndiff --git a/stgit/commands/mail.py b/stgit/commands/mail.py\n--- a/stgit/commands/mail.py\n+++ b/stgit/commands/mail.py\n@@ -68,8 +68,14 @@ def __parse_addresses(string):\n def __send_message(smtpserver, from_addr, to_addr_list, msg, sleep):\n     \"\"\"Send the message using the given SMTP server\n     \"\"\"\n+    if smtpserver.find(':')==-1:\n+        smtpport=25\n+    else:\n+        smtpport=int(smtpserver[smtpserver.find(':')+1:])\n+        smtpserver=smtpserver[:smtpserver.find(':')]\n+\n     try:\n-        s = smtplib.SMTP(smtpserver)\n+        s = smtplib.SMTP(smtpserver, smtpport)\n     except Exception, err:\n         raise CmdException, str(err)\n \n"},{"id":"6300","messageId":"1121979346.7654.3.camel@localhost.localdomain","threadId":"1288","inReplyTo":"20050721202058.8047.77221.stgit@h164.c77.b0.tor.eicat.ca","subject":"Re: [PATCH 1/1] Support configurable SMTP port for stg mail.","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2005-07-21T20:55:46Z","receivedAt":"2005-07-21T20:55:46Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On Thu, 2005-07-21 at 16:20 -0400, Bryan larsen wrote:\n> The example configuration file makes it appear that the SMTP port is configurable.  Make it so.\n\nThe documentation for smtplib.SMTP says that the smtpserver parameter is\npassed to connect(). This latter function parses the smtpserver for\n'server:port' like strings and does the right thing. I tried it with\nPython 2.3 and it seems to work fine without this patch.\n\nThanks anyway.\n\n-- \nCatalin\n"}]}