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

IPv6 support #6

Open
mildred opened this issue Aug 8, 2023 · 2 comments
Open

IPv6 support #6

mildred opened this issue Aug 8, 2023 · 2 comments

Comments

@mildred
Copy link
Contributor

mildred commented Aug 8, 2023

When the server is IPv6 only, connect fails:

Error: unhandled exception: Additional info: Name or service not known
Async traceback:
  /home/mildred/Projets/sqlemail.nim/src/submit_email.nim(112) submit_email
  /home/mildred/Projets/sqlemail.nim/src/submit_email.nim(54) send (Async)
  /home/mildred/.nimble/pkgs2/smtp-0.1.0-df9380a905e6f2f9f4228474077ca15f2ccbde29/smtp.nim(254) connect
  /home/mildred/.choosenim/toolchains/nim-2.0.0/lib/pure/net.nim(2055) connect
  /home/mildred/.choosenim/toolchains/nim-2.0.0/lib/pure/nativesockets.nim(311) getAddrInfo
  /home/mildred/.choosenim/toolchains/nim-2.0.0/lib/std/oserrors.nim(92) raiseOSError
Exception message: Additional info: Name or service not known

edit: sorry, it might be my server down instead

@mildred mildred closed this as completed Aug 8, 2023
@mildred
Copy link
Contributor Author

mildred commented Aug 10, 2023

Problem seems to be in asyncdispatch where getaddrinfo is called with AF_INET instead of AF_UNSPEC

@mildred
Copy link
Contributor Author

mildred commented Aug 11, 2023

Reopening issue. See nim-lang/Nim#22442 and forum thread. The problem is that the smtp package uses newSocket and then connect whereas to have an IPv6 compatible library one should use dial which performs the address lookup and then created the socket using the correct address family depending on if the address is IPv4 or IPv6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant