[Zope] Traceback Lines for Send Mail Error

Asad Habib ahabib at engin.umich.edu
Mon Jul 25 15:19:12 EDT 2005


Thanks Dieter. You hit the nail on the head. socket.gethostname() is not
returning the full canonical name of the machine. But how do I correct
this? Any idea?

- Asad


On Mon, 25 Jul 2005, Dieter Maurer wrote:

> Asad Habib wrote at 2005-7-25 09:24 -0400:
> >Well, nothing has changed in the mail server setup so I don't know why
> >this error is being thrown.
>
> I have been wrong. The message does not originate from your
> mail server.
>
> >Where can I access smtplib (I cannot locate
> >this Python library in my Zope hierarchy)?
>
> "smtplib" is part of the Python runtime library.
>
> >Someone else also reported
> >receiving this error as I discovered on Google but the issue was not
> >resolved. Any help would be appreciated.
>
> Looking at the "smtplib" source and your traceback reveals:
>
>   "smtplib.SMTP.__init__" is trying to determine the
>   local hostname. The code looks like this:
>
>         if local_hostname is not None:
>             self.local_hostname = local_hostname
>         else:
>             # RFC 2821 says we should use the fqdn in the EHLO/HELO verb, and
>             # if that can't be calculated, that we should use a domain literal
>             # instead (essentially an encoded IP address like [A.B.C.D]).
>             fqdn = socket.getfqdn()
>             if '.' in fqdn:
>                 self.local_hostname = fqdn
>             else:
>                 # We can't find an fqdn hostname, so use a domain literal
>                 addr = socket.gethostbyname(socket.gethostname())
> # your exception is raised in the line above
>                 self.local_hostname = '[%s]' % addr
>
>
> This means that you local system is in a strange state.
> Probably, it is unable to determine its hostname.
>
> Try (in an interactive Python interpreter):
>
>     import socket
>     socket.gethostname()
>     socket.gethostbyname(socket.gethostname())
>
>
> --
> Dieter
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>


More information about the Zope mailing list