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

1 messages from 2005-07-21 to 2005-07-21. Participants: Bryan larsen.
Thread: https://gitlist.dev/t/1287

## Bryan larsen, 2005-07-21 20:18

Subject: [PATCH 1/1] Support configurable SMTP port for stg mail.
Message-ID: <20050721201832.8000.49433.stgit@h164.c77.b0.tor.eicat.ca>
URL: https://gitlist.dev/e/20050721201832.8000.49433.stgit%40h164.c77.b0.tor.eicat.ca

```
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 |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py
--- a/stgit/commands/mail.py
+++ b/stgit/commands/mail.py
@@ -68,6 +68,12 @@ 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)
     except Exception, err:

```
