Re: [AD] Problem with the syncmail script

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2004-02-14, Eric Botcazou <ebotcazou@xxxxxxxxxx> wrote:
> > Can anyone with a good knowledge of Python take a look at the syncmail
> > script, which appears to have been broken for a couple of weeks?
> 
> Not many Python fans around there...
> 
> I've (temporarily?) redirected the syncmail script to syncmailwww.

The day doesn't have enough hours for me. The syncmail script was
written with python 1.5 in mind, and now sourceforge has updated to
2.2.2, which is unluckily more pedant than the previous version.
The problem seems to be that the former connect() method of the smtplib
call would ignore an empty string as hostname, but the new version tries
to connect to a name with an empty string.

The following interactive session shows that the former behaviour can be
restored passing the mail hostname in the constructor:

[gradha@xxxxxxxxxx] [~]$ python
Python 2.2.2 (#1, Feb 24 2003, 19:13:11)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import smtplib
>>> conn = smtplib.SMTP()
>>> conn.connect()
(220, 'sc8-pr-shell1.sourceforge.net ESMTP Exim 4.20 Sat, 14 Feb 2004
06:18:53 -0800')
>>> conn.connect("", 25)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.2/smtplib.py", line 276, in connect
    for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
socket.gaierror: (-2, 'Name or service not known')
>>> conn = smtplib.SMTP("", 25)
>>> conn.connect()
(220, 'sc8-pr-shell1.sourceforge.net ESMTP Exim 4.20 Sat, 14 Feb 2004
06:19:14 -0800')
>>>

So I have moved the parameters to the constructor. See if it works.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/