Skip to content

support reverse proxies other than haproxy#62

Closed
MichaelSp wants to merge 6 commits intodocker-mailserver:masterfrom
MichaelSp:service-ports
Closed

support reverse proxies other than haproxy#62
MichaelSp wants to merge 6 commits intodocker-mailserver:masterfrom
MichaelSp:service-ports

Conversation

@MichaelSp
Copy link
Copy Markdown
Contributor

@MichaelSp MichaelSp commented Aug 8, 2022

move proxy_trusted_networks from haproxy to service section since it's not only applicable for haproxy configuration.

In my case, I'm running traefik as described in:
https://docker-mailserver.github.io/docker-mailserver/edge/examples/tutorials/mailserver-behind-proxy/

move `proxy_trusted_networks` from `haproxy` to `service` section since it's not only applicable for haproxy configuration.

In my case, I'm running traefik as described in:
https://docker-mailserver.github.io/docker-mailserver/edge/examples/tutorials/mailserver-behind-proxy/

Signed-off-by: Michael Sprauer <[email protected]>
@MichaelSp MichaelSp requested a review from funkypenguin as a code owner August 8, 2022 15:24
Signed-off-by: Michael Sprauer <[email protected]>
@funkypenguin
Copy link
Copy Markdown
Contributor

Thanks @MichaelSp, this looks like a great addition!

TBH, the only reason we originally went with HAProxy was its support for PROXY PROTOCOL, and at the time, Traefik could only do HTTP. I'm a big fan of Traefik!)

Have you considered / tested PROXY PROTOCOL support in this PR?

Thanks!
D

@MichaelSp
Copy link
Copy Markdown
Contributor Author

MichaelSp commented Sep 2, 2022

Yes, I'm running the master branch since ~3 weeks in production now. And Yes, I'm using traefik.

This branch includes:

So far no issues.

@funkypenguin
Copy link
Copy Markdown
Contributor

Sorry for the delay here - to confirm, proxy protocol support is working, and the original source IP is being received / processed by postfix, spamassassin, etc?

@MichaelSp
Copy link
Copy Markdown
Contributor Author

postfix and dovecot work just fine, I haven't check spamassassin etc.
I'll try to look into it on the WE

@funkypenguin
Copy link
Copy Markdown
Contributor

Thank you :) The important thing to check is that postfix records the original sender's IP, since it's required in the mail headers for spamassassin to do RBL-based filtering.

You could just confirm by examining the headers of any email received by the platform. You'll know it's not working if all emails seem to come from Traefik's pod IPs :)

@MichaelSp
Copy link
Copy Markdown
Contributor Author

Just confirmed it. I can see the real IP in postfix and dovecot in IPv4 and IPv6.

@MichaelSp
Copy link
Copy Markdown
Contributor Author

@funkypenguin I observed another ~2month in prod without any issues.

@funkypenguin
Copy link
Copy Markdown
Contributor

Gah. I just realized that my review comments from 2 months prior have been "pending" all this time, so you probably didn't see my question about testing rainloop.. completing the review now...

Copy link
Copy Markdown
Contributor

@funkypenguin funkypenguin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question re testing for rainloop

postfix-main.cf: |
{{/* Enable proxy protocol for postscreen / dovecot */}}
{{- if .Values.haproxy.enabled }} # Necessary to permit proxy protocol from haproxy to postscreen
{{- if or .Values.service.behind_proxy .Values.rainloop.enabled }} # Necessary to permit proxy protocol from haproxy to postscreen
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not understanding why we're testing for rainloop here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MichaelSp can you remind me why we're testing for rainloop here?

Copy link
Copy Markdown
Contributor Author

@MichaelSp MichaelSp Mar 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh now you got me. I have no idea, I just did some search/replace. But I tried to find an answer. According to this doc you need to enable this for all reverse-proxy setups so that postscreen is able to identify the correct remote address.
And why the or? We have a reverse-proxy setup either explicitly defined Values.service.behind_proxy or implicitly via .Values.rainloop.enabled

MichaelSp and others added 2 commits March 19, 2023 16:16
# Conflicts:
#	charts/docker-mailserver/Chart.yaml
#	charts/docker-mailserver/README.md
@cfis
Copy link
Copy Markdown
Collaborator

cfis commented Feb 2, 2024

Closing, but added a documentation ticket for Traefik. See docker-mailserver/docker-mailserver#3865

@cfis cfis closed this Feb 2, 2024
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.

3 participants