Kaydet (Commit) bda10c81 authored tarafından Guido van Rossum's avatar Guido van Rossum

In helo() and ehlo(), Don't fail when gethostbyaddr() fails -- just

keep whatever gethostname() returns.  After a suggestion by Doug Wyatt.
üst d6512808
......@@ -290,7 +290,11 @@ class SMTP:
"""
name=string.strip(name)
if len(name)==0:
name=socket.gethostbyaddr(socket.gethostname())[0]
name = socket.gethostname()
try:
name = socket.gethostbyaddr(name)[0]
except socket.error:
pass
self.putcmd("helo",name)
(code,msg)=self.getreply()
self.helo_resp=msg
......@@ -303,7 +307,11 @@ class SMTP:
"""
name=string.strip(name)
if len(name)==0:
name=socket.gethostbyaddr(socket.gethostname())[0]
name = socket.gethostname()
try:
name = socket.gethostbyaddr(name)[0]
except socket.error:
pass
self.putcmd("ehlo",name)
(code,msg)=self.getreply()
# According to RFC1869 some (badly written)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment