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

Bind to both IPv4 and IPv6 if possible #79

Open
moggers87 opened this issue Jun 13, 2018 · 6 comments
Open

Bind to both IPv4 and IPv6 if possible #79

moggers87 opened this issue Jun 13, 2018 · 6 comments
Labels
enhancement It's not a bug, but it could be a feature
Milestone

Comments

@moggers87
Copy link
Owner

It appears that Salmon does not listen to IPv4 when run under Python 3:

salmon    3047   inboxen    6u     IPv6   102157        0t0        TCP localhost:8823 (LISTEN)

It's possible that it was only binding to IPv4 previously, but this is an unexpected change either way.

@moggers87
Copy link
Owner Author

This might be a Centos 6 issue - it binds to IPv4 on Fedora under both Pythons 2 and 3.

@moggers87
Copy link
Owner Author

Might be a result of https://bugs.python.org/issue14758

@moggers87
Copy link
Owner Author

Alright, so after a bit more reading:

IPv6 is only supported in Python 3 via smtpd; Python 2 explicitly sets AF_INET and Python 3 uses the first result from getaddrinfo (which could be AF_INET or AF_INET6)

lmtpd only supports AF_INET and AF_UNIX, i.e. no IPv6 support at all.

The lack of good IPv6 support over LMTP is not too much of an issue IMO, but the non-deterministic nature of IPv4-or-v6 in Python 3's smtpd is a problem and one we'll probably have to solve ourselves.

/me goes off a grumbles about core devs

@moggers87
Copy link
Owner Author

Also, check that we can support dual-stack IPv4/IPv6. pyftplib has some code we could borrow, assuming the license is compatible

@moggers87 moggers87 changed the title Salmon doesn't bind to 127.0.0.1 under Python 3 IPv6 Jul 21, 2018
@moggers87 moggers87 changed the title IPv6 Bind to both IPv4 and IPv6 if possible Dec 1, 2019
@moggers87 moggers87 added enhancement It's not a bug, but it could be a feature and removed bug labels Dec 1, 2019
@moggers87
Copy link
Owner Author

This is not actually a bug, it's just the way the underlying smtp library works.

@moggers87
Copy link
Owner Author

lmtpd now supports binding to IPv6, using the same method as Python3's smtpd

@moggers87 moggers87 added this to the 4.0 milestone Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement It's not a bug, but it could be a feature
Projects
None yet
Development

No branches or pull requests

1 participant