feat(mail): add stunnel support for Dovecot and Postfix with configuration and certificate management

This commit is contained in:
2025-05-10 15:37:00 +02:00
parent a0ac55e746
commit 5d2f50feb9
10 changed files with 168 additions and 20 deletions
+8 -2
View File
@@ -5,6 +5,8 @@ locals {
getmail_path = "${local.mail_path}/getmail"
postfix_path = "${local.mail_path}/postfix"
stunnel_tag = "latest"
getmail_jobs = flatten([
for account in var.email_accounts : [
for mailbox in account.mailboxes : {
@@ -29,8 +31,6 @@ locals {
MY_DESTINATION = join(",", [for account in var.email_accounts : account.domain])
MY_NETWORKS = "127.0.0.0/8"
MAILNAME = "smtp.${var.primary_domain}"
DOVECOT_AUTH_ADDRESS = "dovecot-auth.mail.svc.cluster.local"
DOVECOT_AUTH_PORT = 31000
DOVECOT_LMTP_ADDRESS = "dovecot-lmtp.mail.svc.cluster.local"
DOVECOT_LMTP_PORT = 31024
LOG_TO_STDOUT = 0
@@ -82,6 +82,12 @@ locals {
dovecot_config_checksum = sha256(local.dovecot_config)
dovecot_users_checksum = sha256(local.dovecot_users)
dovecot_sieve_checksum = sha256(local.dovecot_sieve)
dovecot_stunnel_config = file("${path.module}/resources/dovecot/stunnel.conf")
dovecot_stunnel_config_checksum = sha256(local.dovecot_stunnel_config)
postfix_stunnel_config = file("${path.module}/resources/postfix/stunnel.conf")
postfix_stunnel_config_checksum = sha256(local.postfix_stunnel_config)
}
data "external" "password_hasher" {