Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smtplib does not fully support IPv6 in EHLO #47711

Open
dmorr mannequin opened this issue Jul 28, 2008 · 7 comments
Open

smtplib does not fully support IPv6 in EHLO #47711

dmorr mannequin opened this issue Jul 28, 2008 · 7 comments
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir topic-email type-bug An unexpected behavior, bug, or error

Comments

@dmorr
Copy link
Mannequin

dmorr mannequin commented Jul 28, 2008

BPO 3461
Nosy @warsaw, @giampaolo, @bitdancer
Files
  • python_smtplib.patch
  • smtplib.patch
  • 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:

    assignee = None
    closed_at = None
    created_at = <Date 2008-07-28.22:08:43.930>
    labels = ['type-bug', '3.8', 'expert-email', '3.10', 'library', '3.9']
    title = 'smtplib does not fully support IPv6 in EHLO'
    updated_at = <Date 2020-11-11.00:41:13.914>
    user = 'https://bugs.python.org/dmorr'

    bugs.python.org fields:

    activity = <Date 2020-11-11.00:41:13.914>
    actor = 'iritkatriel'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)', 'email']
    creation = <Date 2008-07-28.22:08:43.930>
    creator = 'dmorr'
    dependencies = []
    files = ['11000', '17863']
    hgrepos = []
    issue_num = 3461
    keywords = ['patch']
    message_count = 7.0
    messages = ['70372', '109271', '109288', '109414', '109422', '110133', '110137']
    nosy_count = 4.0
    nosy_names = ['barry', 'giampaolo.rodola', 'dmorr', 'r.david.murray']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'test needed'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue3461'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    @dmorr
    Copy link
    Mannequin Author

    dmorr mannequin commented Jul 28, 2008

    On an IPv6-only machine, smtplib does not send an IPv6 address in the
    EHLO. It sends "EHLO [0.0.0.0]" instead. For example, on a v6-only
    network with stateless autoconfiguration enabled (a common
    configuration), smtplib will show this error.

    Further, SMTP's __init__() method tries to determine the value of EHLO
    parameter before the socket is established. But it can't know what
    value to use before the socket is setup (e.g., should it use a
    hostname, a v4 address literal, or a v6 address literal).

    The attached patch moves the self.local_hostname processing into the
    connect() method, and updates it to use IPv6-aware resolver interfaces.

    @dmorr dmorr mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jul 28, 2008
    @BreamoreBoy
    Copy link
    Mannequin

    BreamoreBoy mannequin commented Jul 4, 2010

    I intended testing this but the patch file appears to have a dangling else at the bottom, or am I missing something?

    @dmorr
    Copy link
    Mannequin Author

    dmorr mannequin commented Jul 5, 2010

    You're right. My mistake when I made the patch. I've attached a new one without the trailing else

    @BreamoreBoy
    Copy link
    Mannequin

    BreamoreBoy mannequin commented Jul 6, 2010

    Ran test_smtplib.py for Python 2.7 and 3.1.2 on Windows Vista all tests passed.

    @bitdancer
    Copy link
    Member

    The patch still needs unit tests.

    @dmorr
    Copy link
    Mannequin Author

    dmorr mannequin commented Jul 12, 2010

    I'm not sure how to best write a unit test for this. The patch should only be invoked if the client doesn't have a name-served hostname and has IPv6 enabled. Also, there are several IPv4-isms in the smtplib tests.

    @giampaolo
    Copy link
    Contributor

    You might want to take a look at Lib/test/test_ftplib.py which contains IPv6 tests including the necessary logic to decide whether or not running them.

    @iritkatriel iritkatriel added 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes labels Nov 11, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    7h3Rabbit added a commit to Webperf-se/webperf_core that referenced this issue Dec 6, 2022
    Trying to apply patch python/cpython#47711 so we get IPv6 support
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes 3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir topic-email type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants