Skip to content

Commit e66ae4a

Browse files
author
Justus Pendleton
committed
allow admin to specify port and local hostname for SMTP connections
1 parent 9921976 commit e66ae4a

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

doc/customizing.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Customising Roundup
33
===================
44

5-
:Version: $Revision: 1.218 $
5+
:Version: $Revision: 1.219 $
66

77
.. This document borrows from the ZopeBook section on ZPT. The original is at:
88
http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
@@ -240,6 +240,15 @@ Section **mail**
240240
SMTP login password.
241241
Set this if your mail host requires authenticated access.
242242

243+
port -- default *25*
244+
SMTP port on mail host.
245+
Set this if your mail host runs on a different port.
246+
247+
local_hostname -- default *blank*
248+
The fully qualified domain name (FQDN) to use during SMTP sessions. If left
249+
blank, the underlying SMTP library will attempt to detect your FQDN. If your
250+
mail host requires something specific, specify the FQDN to use.
251+
243252
tls -- ``no``
244253
If your SMTP mail host provides or requires TLS (Transport Layer Security)
245254
then you may set this option to 'yes'.

roundup/configuration.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Roundup Issue Tracker configuration support
22
#
3-
# $Id: configuration.py,v 1.44 2007-09-01 16:30:11 forsberg Exp $
3+
# $Id: configuration.py,v 1.45 2007-09-02 05:54:46 jpend Exp $
44
#
55
__docformat__ = "restructuredtext"
66

@@ -12,6 +12,7 @@
1212
import re
1313
import sys
1414
import time
15+
import smtplib
1516

1617
import roundup.date
1718

@@ -614,6 +615,12 @@ def str2value(self, value):
614615
"If username is not empty, password (below) MUST be set!"),
615616
(Option, "password", NODEFAULT, "SMTP login password.\n"
616617
"Set this if your mail host requires authenticated access."),
618+
(IntegerNumberOption, "port", smtplib.SMTP_PORT,
619+
"Default port to send SMTP on.\n"
620+
"Set this if your mail server runs on a different port."),
621+
(NullableOption, "local_hostname", '',
622+
"The local hostname to use during SMTP transmission.\n"
623+
"Set this if your mail server requires something specific."),
617624
(BooleanOption, "tls", "no",
618625
"If your SMTP mail host provides or requires TLS\n"
619626
"(Transport Layer Security) then set this option to 'yes'."),

roundup/mailer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Sending Roundup-specific mail over SMTP.
22
"""
33
__docformat__ = 'restructuredtext'
4-
# $Id: mailer.py,v 1.18 2006-08-11 01:41:25 richard Exp $
4+
# $Id: mailer.py,v 1.19 2007-09-02 05:54:46 jpend Exp $
55

66
import time, quopri, os, socket, smtplib, re, sys, traceback
77

@@ -190,8 +190,8 @@ class SMTPConnection(smtplib.SMTP):
190190
''' Open an SMTP connection to the mailhost specified in the config
191191
'''
192192
def __init__(self, config):
193-
194-
smtplib.SMTP.__init__(self, config.MAILHOST)
193+
smtplib.SMTP.__init__(self, config.MAILHOST, port=config['MAIL_PORT'],
194+
local_hostname=config['MAIL_LOCAL_HOSTNAME'])
195195

196196
# start the TLS if requested
197197
if config["MAIL_TLS"]:

0 commit comments

Comments
 (0)