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

Healthcheck does not work when smtpd_upstream_proxy_protocol is enabled #226

Open
imro2 opened this issue Jan 30, 2025 · 2 comments
Open

Comments

@imro2
Copy link

imro2 commented Jan 30, 2025

Could not get the health-check to work properly after I enabled proxy protocol. Had to copy the healthcheck.sh locally, and modify the postifix check to read like this:

check_postfix() {
    printf "PROXY TCP4 192.168.2.1 1.2.3.4 12345 54321\nEHLO healthcheck\nquit\n" | \
    { while read l ; do sleep 1; echo $l; done } | \
    nc -w 2 127.0.0.1 587 | \
    grep -qE "^220.*ESMTP Postfix"
}

And add this to my compose

    volumes:
      - ./healthcheck.sh:/healthcheck.sh
    healthcheck:
      test:
        - CMD-SHELL
        - /healthcheck.sh
@bokysan
Copy link
Owner

bokysan commented Jan 30, 2025

@imro2
Copy link
Author

imro2 commented Jan 31, 2025

This might not be worth your time or feasible as there are more than one version of the proxy protocol. You would have to account for both or change the the health check accordingly. The other option to work around this issue is to disable health check all together.

    healthcheck:
      disable: true

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