simplify config with TLS, PORTS and PROXY_PROTOCOL

This commit is contained in:
Florent Daigniere
2024-04-06 17:28:38 +02:00
parent efb3892b09
commit e0b64a9e54
6 changed files with 81 additions and 32 deletions

View File

@@ -75,11 +75,12 @@ service anvil {
}
}
{%- if PORT_4190 %}
service managesieve-login {
executable = managesieve-login
inet_listener sieve {
port = 4190
{%- if PROXY_PROTOCOL in ['all', 'all-but-http', 'mail'] %}
{%- if PROXY_PROTOCOL_MANAGESIEVE %}
haproxy = yes
{% endif %}
}
@@ -87,6 +88,7 @@ service managesieve-login {
port = 14190
}
}
{% endif %}
protocol imap {
mail_max_userip_connections = 20
@@ -94,42 +96,46 @@ protocol imap {
}
service imap-login {
{%- if PORT_143 %}
inet_listener imap {
port = 143
{%- if PROXY_PROTOCOL in ['all', 'all-but-http', 'mail'] %}
{%- if PROXY_PROTOCOL_IMAP %}
haproxy = yes
{% endif %}
}
{% endif %}
{%- if TLS_993 and PORT_993 %}
inet_listener imaps {
port = 993
{%- if TLS %}
ssl = yes
{% endif %}
{%- if PROXY_PROTOCOL in ['all', 'all-but-http', 'mail'] %}
{%- if PROXY_PROTOCOL_IMAPS %}
haproxy = yes
{% endif %}
}
{% endif %}
inet_listener imap-webmail {
port = 10143
}
}
service pop3-login {
{%- if PORT_110 %}
inet_listener pop3 {
port = 110
{%- if PROXY_PROTOCOL in ['all', 'all-but-http', 'mail'] %}
{%- if PROXY_PROTOCOL_POP3 %}
haproxy = yes
{% endif %}
}
{% endif %}
{%- if TLS_995 and PORT_995 %}
inet_listener pop3s {
port = 995
{%- if TLS %}
ssl = yes
{% endif %}
{%- if PROXY_PROTOCOL in ['all', 'all-but-http', 'mail'] %}
{%- if PROXY_PROTOCOL_POP3S %}
haproxy = yes
{% endif %}
}
{% endif %}
}
recipient_delimiter = {{ RECIPIENT_DELIMITER }}
@@ -141,21 +147,23 @@ service lmtp {
}
service submission-login {
{%- if PORT_587 %}
inet_listener submission {
port = 587
{%- if PROXY_PROTOCOL in ['all', 'all-but-http', 'mail'] %}
{%- if PROXY_PROTOCOL_SUBMISSION %}
haproxy = yes
{% endif %}
}
{% endif %}
{%- if TLS_465 and PORT_465 %}
inet_listener submissions {
port = 465
{%- if TLS %}
ssl = yes
{% endif %}
{%- if PROXY_PROTOCOL in ['all', 'all-but-http', 'mail'] %}
{%- if PROXY_PROTOCOL_SUBMISSIONS %}
haproxy = yes
{% endif %}
}
{% endif %}
inet_listener submission-webmail {
port = 10025
}