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

[Feature] Set healthcheck port in configuration options #186

Open
undefinedid opened this issue Mar 4, 2024 · 2 comments
Open

[Feature] Set healthcheck port in configuration options #186

undefinedid opened this issue Mar 4, 2024 · 2 comments

Comments

@undefinedid
Copy link

I'm actually using your image in many different places and in many different ways, even in production in my workplace. I could hardly do without it! So thank you for maintaining it!

In my homelab, I use it as a local relay, non-authenticated.
It uses port 25 to catch local emails, and relays them on the secure port 587 of a cloud provider.

My container constantly says it is unhealthy, because of my local port 587 is not open.

I think the source of this behavior is located here: healthcheck.sh#L10

Do you think it could be possible to pass healthcheck some options, via environment variables, in a future version?
I'm mainly thinking of the listening port but it may be helpful to pass other settings.

Thank you for your work and for your help.

@bokysan
Copy link
Owner

bokysan commented Mar 5, 2024

Sure, that can be changed to use a variable. Although, usually you don't need to change the (internal) listening ports of services, as you can map them to your preferred ports on the outside in Docker as well as Kubernetes.

I'd be interested to understand why you have the need to change the listening port in the first place?

@undefinedid
Copy link
Author

Thank you for your answer.
I didn't touch anything regarding the port used by Postfix. Settings are those deployed by the image on the first launch.
Even /etc/postfix/master.cf is untouched:

smtp      inet  n       -       n       -       -       smtpd

I think my docker-compose and my environment variables make the process bind the port 25 naturally, as their is no authentication and no SSL/TLS at all on the input.

And as in my previous experiences with baremetal installs or with other container images, it didn't trigger me as it is the expected behavior for clients or servers to use this port unauthenticated.

But as you mentioned it, I could map port 25 on the host to port 587 inside the Postfix container to make it status healthy.
I'm just not very familiar when both input and output are on the same port, 587.

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

2 participants