python / cpython

The Python programming language
https://www.python.org
Other
62.17k stars 29.88k forks source link

smtplib doesn't use FQDN #32875

Closed 50eff062-408a-4098-b1b2-8222303b9d0c closed 24 years ago

50eff062-408a-4098-b1b2-8222303b9d0c commented 24 years ago
BPO 210944

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields: ```python assignee = None closed_at = created_at = labels = ['library'] title = "smtplib doesn't use FQDN" updated_at = user = 'https://bugs.python.org/anonymous' ``` bugs.python.org fields: ```python activity = actor = 'nowonder' assignee = 'none' closed = True closed_date = None closer = None components = ['Library (Lib)'] creation = creator = 'anonymous' dependencies = [] files = [] hgrepos = [] issue_num = 210944 keywords = [] message_count = 2.0 messages = ['940', '941'] nosy_count = 1.0 nosy_names = ['nowonder'] pr_nums = [] priority = 'normal' resolution = None stage = None status = 'closed' superseder = None type = None url = 'https://bugs.python.org/issue210944' versions = [] ```

3772858d-27d8-44b0-a664-d68674859f36 commented 24 years ago

When talking to an SMTP server smtplib says HELO "name" where name is the result of:

name = socket.gethostbyaddr(name)[0]

Unfortunately that line isn't guarenteed to return the FQDN of the machine and so some MTAs with certain configurations (in my case postfix) reject the mail as they insist on a FQDN. Those MTAs that don't insist on a FQDN arent going to complain if they get one either so changing this behaviour seems desirable.

This code appears twice...once around line 295 and again around line 312. The fix would seem to be listed at http://www.python.org/doc/current/lib/module-socket.html.

"To find the fully qualified domain name, check hostname and the items of aliaslist for an entry containing at least one period."

I don't know enough python to provide a patch...sorry.

Thanks,

Andrew

BTW I have submitted this bug against the version in mailman as well

495c5ecb-2b62-4218-a59d-3f9b8cae27c6 commented 24 years ago

closed by patch bpo-101103