[PATCH 1/1] Support configurable SMTP port for stg mail.

From: Bryan larsen <bryanlarsen@yahoo.com>
Date: 2005-07-22 06:20:58
The example configuration file makes it appear that the SMTP port is configurable.  Make it so.

Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
---

 stgit/commands/mail.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py
--- a/stgit/commands/mail.py
+++ b/stgit/commands/mail.py
@@ -68,8 +68,14 @@ def __parse_addresses(string):
 def __send_message(smtpserver, from_addr, to_addr_list, msg, sleep):
     """Send the message using the given SMTP server
     """
+    if smtpserver.find(':')==-1:
+        smtpport=25
+    else:
+        smtpport=int(smtpserver[smtpserver.find(':')+1:])
+        smtpserver=smtpserver[:smtpserver.find(':')]
+
     try:
-        s = smtplib.SMTP(smtpserver)
+        s = smtplib.SMTP(smtpserver, smtpport)
     except Exception, err:
         raise CmdException, str(err)
 

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Fri Jul 22 06:21:07 2005

This archive was generated by hypermail 2.1.8 : 2005-07-22 06:21:08 EST