[Patches] [Patch #101103] smtplib.py doesn't calculate fqdn correctly

noreply@sourceforge.net noreply@sourceforge.net
Thu, 10 Aug 2000 05:56:40 -0700


Patch #101103 has been updated. 

Project: 
Category: library
Status: Accepted
Summary: smtplib.py doesn't calculate fqdn correctly

Follow-Ups:

Date: 2000-Aug-06 19:08
By: bwarsaw

Comment:
A bug report submitted to the Mailman project[1], describes the situation where smtplib.py may choose a non-FQDN hostname for HELO/EHLO.  Here is a patch to use the algorithm described in the socket module documentation.

[1] http://sourceforge.net/bugs/?func=detailbug&bug_id=110935&group_id=103
-------------------------------------------------------

Date: 2000-Aug-10 03:23
By: nowonder

Comment:
Looks alright to me. Works fine, too.

Remark:
In case there is no fqdn in [hostname]+aliases, this routine selects the last entry in aliases (or hostname if aliases is empty). I guess that is okay (aliases being what they are), but if not adding "else: name = hostname" to the for-loop will do the trick of selecting hostname in those cases.

Meta-remark:
I would like to change the Status to Accepted, but the Patch Manager Guidelines state I have to be morally equivalent to Guido to do that. So I better leave it at Open. Quoting from these guidelines: "Is the Guido bottleneck avoidable?"
-------------------------------------------------------

Date: 2000-Aug-10 05:56
By: gvanrossum

Comment:
Check it in.

I agree with your suggestion to change the patch.

Please also change ``string.find(name, '.') >= 0'' into the much clearer ``'.' in name''.
-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=101103&group_id=5470