IPv6 Support (Implement Happy Eyeballs) #268
Labels
No Label
IMAP
JMAP
Maildir
Retired
User Experience
User Interface
bsd
bug
contacts
currently worked on
documentation
duplicate
easy
enhancement
help wanted
invalid
linux-gnu
macos
mbox
notmuch
question
security
wishlist
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: meli/meli#268
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Description
I've recently tried out meli and found it to be the best CLI mail client I've encountered so far. However, I spend most of my time on IPv6-only networks (yes, they exist!), and meli does not manage to establish connections to my dual-stack IMAP servers, rendering it unusable for me.
I tracked down what's happening; it all comes down to this function:
melib/src/utils/connections.rs:497
:While it does iterate the DNS responses to check for v4 and v6, it only ever returns the first result, which (at least for me) always is the IPv4 address.
Observed Behavior
meli only ever connects to the first address returned by the DNS lookup, which always is an IPv4 address, unless there only is an
AAAA
record.Expected Behavior
meli should implement RFC 6555 ("Happy Eyeballs"), and attempt to establish a connection using both IPv6 and IPv4.
There is a crate called happy-eyeballs, which from a cursory glance should be able to simply replace your calls to
lookup_ip
followed byconnect
; according to the documentation it can simply replaceTcpStream::connect
and takes a hostname + port as arguments. Though apparently it doesn't implementconnect_timeout
yet.@s3lph thanks a lot for the issue and well written explanations and solution! I had forgotten about happy eyeballs.
happy-eyeballs
crate seems small, perhaps it'd be better to just implement it in our source tree instead of adding yet another dependency.@s3lph I'm back home so I will start working on this asap.
Update: I made an implementation, all the servers I tried work except for gmail's. It gives me "network unreachable", might be a problem on my end. I will investigate further.
@s3lph the happy-eyeballs crate seems to be using sockets wrong 🤔 It calls
connect
, getsEINPROGRESS
and then callsconnect
again when polling. Linux doesn't care about that but Macos returnsEISCONN The socket is already connected.
Both platforms suggestselect
ing the socket for writability instead. I will try that.