1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-16 10:59:53 +02:00
Mailu/core/nginx/dovecot/proxy.conf

157 lines
3.4 KiB
Plaintext
Raw Normal View History

2023-04-20 15:36:17 +02:00
###############
# General
###############
log_path = /dev/stderr
2023-04-21 09:13:11 +02:00
auth_verbose=yes
mail_debug=yes
2023-04-21 10:29:28 +02:00
login_log_format_elements = user=<%u> method=%m rip=%r rport=%b lip=%l lport=%a mpid=%e %c
2023-06-05 08:47:22 +02:00
protocols = sieve imap pop3 lmtp submission
2023-04-20 15:36:17 +02:00
postmaster_address = {{ POSTMASTER }}@{{ DOMAIN }}
hostname = {{ HOSTNAMES.split(",")[0] }}
2023-06-05 08:47:22 +02:00
submission_host = {{ SMTP_ADDRESS }}
submission_relay_host = {{ SMTP_ADDRESS }}
submission_relay_port = 10025
submission_relay_trusted = yes
submission_relay_ssl = no
submission_max_mail_size = {{ MESSAGE_SIZE_LIMIT }}
submission_backend_capabilities = 8BITMIME DSN VRFY
submission_client_workarounds = mailbox-for-path whitespace-before-path
# disable BURL
imap_urlauth_host=
lmtp_proxy = yes
lmtp_client_workarounds = whitespace-before-path mailbox-for-path
2023-04-20 15:36:17 +02:00
default_internal_user = dovecot
default_login_user = mail
default_internal_group = dovecot
haproxy_trusted_networks = {% if REAL_IP_FROM %}{% for from_ip in REAL_IP_FROM.split(',') %}{{ from_ip }} {% endfor %}{% endif %}
###############
# Authentication
###############
auth_username_chars =
auth_mechanisms = plain login
2023-04-21 08:59:42 +02:00
{%- if TLS %}
2023-04-20 15:36:17 +02:00
ssl = required
ssl_cert = <{{ TLS[0] }}
ssl_key = <{{ TLS[1] }}
2023-04-21 08:59:42 +02:00
{%- if TLS_FLAVOR in ['letsencrypt','mail-letsencrypt'] %}
2023-04-20 15:36:17 +02:00
ssl_alt_cert = <{{ TLS[2] }}
ssl_alt_key = <{{ TLS[3] }}
{% endif %}
# intermediate configuration
ssl_min_protocol = TLSv1.2
2023-06-05 08:47:22 +02:00
ssl_cipher_list = ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305
2023-04-20 15:36:17 +02:00
ssl_prefer_server_ciphers = no
2023-04-23 09:11:58 +02:00
ssl_options = no_compression no_ticket
2023-04-20 15:36:17 +02:00
{% else %}
disable_plaintext_auth = no
2023-06-05 08:47:22 +02:00
ssl = no
2023-04-20 15:36:17 +02:00
{% endif %}
passdb {
driver = lua
args = file=/etc/dovecot/login.lua blocking=yes
}
service auth-worker {
2023-04-21 08:59:42 +02:00
user = dovenull
group = dovenull
2023-06-05 08:47:22 +02:00
unix_listener auth-worker {
}
}
service anvil {
unix_listener anvil-auth-penalty {
mode = 0
}
2023-04-20 15:36:17 +02:00
}
service managesieve-login {
executable = managesieve-login
inet_listener sieve {
port = 4190
2023-04-21 08:59:42 +02:00
{%- if PROXY_PROTOCOL in ['all', 'mail'] %}
2023-04-20 15:36:17 +02:00
haproxy = yes
{% endif %}
}
inet_listener sieve-webmail {
port = 14190
}
2023-04-20 15:36:17 +02:00
}
2023-06-05 08:47:22 +02:00
protocol imap {
mail_max_userip_connections = 20
imap_idle_notify_interval = 29mins
}
service imap-login {
inet_listener imap {
port = 143
{%- if PROXY_PROTOCOL in ['all', 'mail'] %}
haproxy = yes
{% endif %}
}
inet_listener imaps {
port = 993
{%- if TLS %}
ssl = yes
{% endif %}
{%- if PROXY_PROTOCOL in ['all', 'mail'] %}
haproxy = yes
{% endif %}
}
inet_listener imap-webmail {
port = 10143
}
}
service pop3-login {
inet_listener pop3 {
port = 110
{%- if PROXY_PROTOCOL in ['all', 'mail'] %}
haproxy = yes
{% endif %}
}
inet_listener pop3s {
port = 995
{%- if TLS %}
ssl = yes
{% endif %}
{%- if PROXY_PROTOCOL in ['all', 'mail'] %}
haproxy = yes
{% endif %}
}
}
recipient_delimiter = {{ RECIPIENT_DELIMITER }}
service lmtp {
user = $default_internal_user
inet_listener lmtp {
port = 2525
}
}
service submission-login {
inet_listener submission {
port = 587
{%- if PROXY_PROTOCOL in ['all', 'mail'] %}
haproxy = yes
{% endif %}
}
inet_listener submissions {
port = 465
{%- if TLS %}
ssl = yes
{% endif %}
{%- if PROXY_PROTOCOL in ['all', 'mail'] %}
haproxy = yes
{% endif %}
}
inet_listener submission-webmail {
port = 10025
}
}