mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-04-25 17:25:57 +03:00
[GH-ISSUE #5161] SMTP falsely prefers IPv4 over IPv6 #2085
Labels
No labels
SSO
Third party
better for forum
bug
bug
documentation
duplicate
enhancement
future Vault
future Vault
future Vault
good first issue
help wanted
low priority
notes
pull-request
question
troubleshooting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vaultwarden#2085
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @imp1sh on GitHub (Nov 5, 2024).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/5161
Vaultwarden Support String
Your environment (Generated via diagnostics page)
Config (Generated via diagnostics page)
Show Running Config
Environment settings which are overridden: DOMAIN, SIGNUPS_ALLOWED, ADMIN_TOKEN, SMTP_HOST, SMTP_SECURITY, SMTP_PORT, SMTP_FROM, SMTP_USERNAME, SMTP_PASSWORD
Vaultwarden Build Version
1.32.3-2f20ad86 (testing tag)
Deployment method
Official Container Image
Custom deployment method
No response
Reverse Proxy
nginx 1.22.1
Host/Server Operating System
Linux
Operating System Version
Debian 12
Clients
Web Vault
Client Version
Firefox 132.0
Steps To Reproduce
Configure SMTP settings with DNS name that both resolves IPv6 and IPv4 address.
As in RFC 6724 it is required that IPv6 is being preferred over IPv4.
Expected Result
Instead of trying to connect to the SMTP host via IPv4 first, it should prefer IPv6. BTW it's a GUA address, no ULA.
Actual Result
The application tries to connect via IPv4 first.
Logs
Screenshots or Videos
No response
Additional Context
No response
@BlackDex commented on GitHub (Nov 5, 2024):
I think this isn't something specific to Vaultwarden, but more to the mall library/crate https://github.com/lettre/lettre.
It also isn't something we control in Vaultwarden.
@imp1sh commented on GitHub (Nov 5, 2024):
https://github.com/lettre/lettre/issues/1003
@stefan0xC commented on GitHub (Nov 5, 2024):
Do you have IPv6 enabled in docker? Because I don't think that this is the applications fault but should depend on your system setup and I don't think that docker by default can resolve ipv6 addresses.
edit: at least podman cannot do this as far as i've tested it:
(and running my vaultwarden instance locally it seems to connect just fine to the ipv6 address according to the smtp server)
@imp1sh commented on GitHub (Nov 6, 2024):
Docker sucks with IPv6 tbh
I'm using podman though and my setup is fully tested and functional with IPv6
@stefan0xC commented on GitHub (Nov 6, 2024):
Can you run something like
curl ifconfig.meorcurl my.ip.fiinside the container to check whether your system prefers IPv6 over IPv4?@imp1sh commented on GitHub (Nov 6, 2024):
This gives me the IPv4 address when I'm inside a container. But I don't understand... I can both connect to container services inbound via IPv6 and outbound v6 communication basically also works.
Outside of the container it resolves correctly to the IPv6 adress... Weird stuff
@stefan0xC commented on GitHub (Nov 6, 2024):
Well, I'm glad we could narrow it down a bit. So it might be specific to podman and the way it resolves DNS or how you set it up? In any case I don't think I can help any further as I have not enabled IPv6 in podman myself yet and this is probably something you should ask the podman community directly.
@paolobarbolini commented on GitHub (Nov 6, 2024):
On the lettre side we don't do dualstack properly, so it's going to use whichever IP address the resolver returns first.
As for running
curlin the container I suggest adding-6so you are extra sure about it trying to use IPv6. If it doesn't connect you know your container doesn't have an IPv6 address. I don't know much about podman but I know docker only recently released changes that made IPv6 more useful, or at least easier to use, so it could be just that podman has to do the same steps or maybe simply doesn't enable it by default.@stefan0xC commented on GitHub (Nov 6, 2024):
@paolobarbolini
Would that be wrong? I mean that's how the RFC explains how it typically works as well, is it not?
@imp1sh commented on GitHub (Nov 6, 2024):
I might have linked the wrong RFC. When it comes to precedence question RFC 6555 is the relevant one.
@paolobarbolini commented on GitHub (Nov 6, 2024):
Yeah what I meant is that we don't implement happy eyeballs at all