ansible-role-disposable-mail/templates/dovecot.conf.j2

80 lines
2.0 KiB
Plaintext
Raw Permalink Normal View History

2023-07-22 22:53:56 +00:00
# https://doc.dovecot.org/settings/core/
auth_mechanisms = plain scram-sha-256
protocols = imap
listen = {{ imap_bind_address }}
# /usr/share/doc/dovecot/example-config/conf.d/10-master.conf
# disable plaintext imap
service imap-login {
inet_listener imap {
port = 0
}
inet_listener imaps {
port = 993
ssl = yes
}
}
# authenticate using a hash in a password file
# https://doc.dovecot.org/configuration_manual/authentication/passwd_file/#authentication-passwd-file
# Generate a password:
# doveadm pw -s BLF-CRYPT
passdb {
driver = passwd-file
2024-05-29 17:45:00 +00:00
args = username_format=%u scheme=blf-crypt {{ dovecot_passwd_file }}
2023-07-22 22:53:56 +00:00
auth_verbose=yes
}
# after authentication, use the system user account details
# https://doc.dovecot.org/configuration_manual/authentication/user_databases_userdb/#authentication-user-database
userdb {
driver = passwd-file
2024-05-29 17:45:00 +00:00
args = username_format=%u {{ dovecot_passwd_file }}
2023-07-22 22:53:56 +00:00
default_fields = uid={{ postfix_maildir_user }} gid={{ postfix_maildir_user }}
# override_fields =
# skip = never
# result_failure = continue
# result_internalfail = continue
# result_success = return-ok
# auth_verbose = default
}
# IMAP
ssl=yes
ssl_cert=<{{ postfix_smtpd_tls_cert_file }}
ssl_key=<{{ postfix_smtpd_tls_key_file }}
ssl_dh=<{{ postfix_smtpd_tls_dh1024_param_file }}
#verbose_ssl=yes
2024-05-29 17:45:00 +00:00
{% if postfix_virtual_domains|length > 0 %}
{% for domain in postfix_virtual_domains %}
# SNI configuration for {{ domain.name }}
local_name {{ domain.name }} {
ssl_cert = <{{ domain.cert }}
ssl_key = <{{ domain.key }}
}
{% endfor %}
{% endif %}
2023-07-22 22:53:56 +00:00
# SASL
service auth {
unix_listener /var/spool/postfix/private/auth {
mode = 0660
user = postfix
group = postfix
}
}
# https://doc.dovecot.org/configuration_manual/home_directories_for_virtual_users/#ways-to-set-up-home-directory
# https://doc.dovecot.org/admin_manual/filesystem_permission/
2024-05-29 17:45:00 +00:00
mail_location = maildir:{{ postfix_virtual_mailbox_base }}/%d/%n
mail_home=/srv/mail/%d/%Lu
2023-07-22 22:53:56 +00:00
# https://doc.dovecot.org/admin_manual/logging/#dovecot-logging
#mail_debug=yes