[Mailman-Users] SMTPDirect issues (Name or service not known)
msapiro at value.net
Fri Jun 10 18:36:46 CEST 2005
Meike Aulbach wrote:
>Now these are the default values, but I tried a lot of other values
>on them, e.g. 'mx-name', 'mx-IP', '127.0.0.1' for SMTPHOST, 25 for
>SMTPPORT). After every change to the values in mm_cfg.py I did a
>restart of mailman. (/etc/init.d/mailman restart on Debian, or is
>there anything else that needs to be restarted?)
No, that's all that needs to be done after mm_cfg.py changes.
>localhost, mx-name etc. are in fact resolvable. Their IP-addresses
>are in /etc/hosts, /etc/host.conf is set to order hosts,bind.
See the post at
The similar issue there was due to /etc/hosts not being readable by
other than root.
>I connected to python manually like suggested in the thread on this
>list only recently ([Mailman-Users] Mailman just doesn"t send the
>Python 2.3.5 (#2, Feb 9 2005, 00:38:15)
>[GCC 3.3.5 (Debian 1:3.3.5-8)] on linux2
>Type "help", "copyright", "credits" or "license" for more information.
>>>> import smtplib
>>>> SMTPHOST = 'localhost'
>>>> SMTPPORT = 0
>>>> x = smtplib.SMTP()
>(220, 'mx.zzzzz.net ESMTP Exim 4.50 Fri, 10 Jun 2005 09:58:50 +0200')
>So the default values (localhost,0) _should_ work for me, but apparently
>they don't. I tried the manual python connect with mx-name and additionally
>sent out an e-mail with the smtplib-module, and I simply cannot
>reproduce the "Name or service not known" error at any step of the mail
>sending process. The hostname of the machine (/etc/hostname) is also
>in /etc/hosts and can be resolved (checked with telnet hostname 25).
Did you try doing these things as the 'mailman' user?
>I went so far and edited SMTPDirect.py just to find out whether the
>values of SMTPHOST and SMTPPORT maybe are not reached through to the
>module from mm_cfg.py:
> #self.__conn.connect(mm_cfg.SMTPHOST, mm_cfg.SMTPPORT)
> self.__conn.connect('localhost', 0)
>But mails are still not delivered. I really know nothing about python,
>so maybe this is due because SMTPDirect.py is compiled to SMTPDirect.pyo
>and SMTPDirect.pyc, so my changes to SMTPDirect.py are never regarded
>by the program?
If you change a *.py module, the next time it is used, Python will see
that it is more recent than the corresponding *.py[co] and recompile.
You probably do need to restart Mailman in case old copies are cached
in the qrunners.
>I don't really want to make changes to the SMTPDirect-
>module, so maybe anyone here can point out to me where and how I could
>go on with debugging this issue? :)
You shouldn't need to edit SMTPDirect.py to debug this. The Python code
snippet above and the more elaborate one in the post at
exactly what SMTPDirect.py does. If they don't fail it's because you
aren't running them in the same way as the mailman OutgoingRunner is
run, i.e. same python, same user, ...
Mark Sapiro <msapiro at value.net> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
More information about the Mailman-Users