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

config: update listen regex to allow IPv6 addresses #85

Merged
merged 1 commit into from Apr 12, 2023
Merged

config: update listen regex to allow IPv6 addresses #85

merged 1 commit into from Apr 12, 2023

Conversation

ghost
Copy link

@ghost ghost commented Apr 9, 2023

The current regex for validating SMTP/HTTP listen addresses doesn't allow for IPv6 addresses.

This tweak changes the default to listen on both v4 and v6 by default, and updates the regexp so that it matches v4 and v6.

@axllent
Copy link
Owner

axllent commented Apr 11, 2023

Thanks for this, it makes sense, at least from the perspective of being able to set an IPv6 address (validation). I'm not sure about the default config value change though (simply due to the default startup message) as I think that is probably quite confusing for the average user:

INFO[2023/04/11 15:14:40] [smtp] starting on [::]:1025                 
INFO[2023/04/11 15:14:40] [http] starting server on http://[::]:8025/

Is your local machine running on IPv6, or did you change the default 0.0.0.0 in the config just in case of someone having IPv6 locally?

@ghost
Copy link
Author

ghost commented Apr 11, 2023

I changed the default while I was testing as I thought it was a reasonable default - going from listening on all v4 addresses to listening on all v4 & v6 addresses.

Happy to revert that bit if you'd prefer to keep the current default!

@ghost
Copy link
Author

ghost commented Apr 11, 2023

For context, yes - I'm using this on a machine with v4 & v6 addresses to catch mail being sent over both v4 and v6.

I've tested receiving mail on my test machine and also accessing the web UI over v4 and v6 and both seem to work fine.

@axllent axllent merged commit efc9c10 into axllent:develop Apr 12, 2023
@axllent
Copy link
Owner

axllent commented Apr 12, 2023

Thanks - I have merged this in, however Mailpit will now "overwrite" the logging to say 0.0.0.0: if it is set to [::] to try avoid any confusion. I realise that in doing so it may itself cause some confusion, but hopefully less than the other way around :) I am also concerned that [::] may not work on systems where IPv6 isn't "a thing", however I couldn't replicate that on my end so I'm hoping it's OK. If it does cause issues then I may have to revert to 0.0.0.0.

@ghost ghost deleted the ipv6 branch April 12, 2023 20:51
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

Successfully merging this pull request may close these issues.

2 participants