[Pythonmac-SIG] problems with smtplib?

chris mann cmann@pobox.com
Thu, 21 Oct 1999 15:54:07 -0400


on 10/21/99 3:37 PM, Just van Rossum at just@letterror.com wrote:

> At 3:02 PM -0400 10/21/99, chris mann wrote:
>> I'm having problems with the smtplib module on Mac.
>> 
>> if I run the following code on windows or linux it works fine, but fails on
>> mac:
>> import smtplib
>> s = smtplib.SMTP('smtp.myhost.com')
>> s.helo()
>> 
>> i get the following error:
>> Traceback (innermost last):
>> File "<input>", line 1, in ?
>> File "Dev:Scripting:Python 1.5.2c1:Lib:smtplib.py", line 290, in helo
>> name=socket.gethostbyaddr(socket.gethostname())[0]
>> error: host not found
>> 
>> any ideas why this is only failing on Mac?
> 
> Works for me. Can it be your network setup? Firewall?
> Can you see which of the two socket calls fail?

Could be the firewall.  Or it could be the network setup, but not sure why
it would work on Windows, but not Mac.  They both get their ip address via
DHCP (the linux box has a static ip address)

It's failing in the socket.gethostbyaddr() call.  The socket.gethostname()
call returns the ip address of the machine.

thanks
-chris