[Mailman-Developers] Userdefined HELO with SMTPDirect

Palomäki Kai Kai.Palomaki at vlp.fi
Tue Feb 15 11:22:50 CET 2005


Hello,

It would be useful in some situations (for example Mailman and Postfix
running on same host) to define custom HELO when using Mailman SMTPDirect
delivery module.

I made simple patch to achieve this. But since my experience with Python
is minimal I don't know if this is "the right way(tm)".


diff -u -r mailman-2.1.6b3/Mailman/Defaults.py.in mailman-2.1.6b3-patched/Mailman/Defaults.py.in
--- mailman-2.1.6b3/Mailman/Defaults.py.in      2005-01-22 08:55:28.000000000 +0200
+++ mailman-2.1.6b3-patched/Mailman/Defaults.py.in      2005-02-13 12:59:28.000000000 +0200
@@ -422,6 +422,11 @@
 SMTPHOST = 'localhost'
 SMTPPORT = 0                                      # default from smtplib

+# SMTP HELO sent by Mailman, when DELIVERY_MODULE is 'SMTPDirect'. Default
+# is FQDN of localhost (as returned by socket.getfqdn())
+# SMTPHELO = 'my.own.fqdn.hostname'
+SMTPHELO = None
+
 # Command for direct command pipe delivery to sendmail compatible program,
 # when DELIVERY_MODULE is 'Sendmail'.
 SENDMAIL_CMD = '/usr/lib/sendmail'
diff -u -r mailman-2.1.6b3/Mailman/Handlers/SMTPDirect.py mailman-2.1.6b3-patched/Mailman/Handlers/SMTPDirect.py
--- mailman-2.1.6b3/Mailman/Handlers/SMTPDirect.py      2004-01-23 01:02:07.000000000 +0200
+++ mailman-2.1.6b3-patched/Mailman/Handlers/SMTPDirect.py      2005-02-13 12:29:59.000000000 +0200
@@ -59,7 +59,7 @@
         self.__conn = None

     def __connect(self):
-        self.__conn = smtplib.SMTP()
+        self.__conn = smtplib.SMTP('', 0, mm_cfg.SMTPHELO)
         self.__conn.connect(mm_cfg.SMTPHOST, mm_cfg.SMTPPORT)
         self.__numsessions = mm_cfg.SMTP_MAX_SESSIONS_PER_CONNECTION


More information about the Mailman-Developers mailing list