Reorganized folder structure
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
locals {
|
||||
persistent_folder = var.persistent_folder
|
||||
mail_path = "${local.persistent_folder}/mail"
|
||||
mailboxes_path = "${local.mail_path}/mailboxes"
|
||||
getmail_path = "${local.mail_path}/getmail"
|
||||
postfix_path = "${local.mail_path}/postfix"
|
||||
|
||||
getmail_jobs = flatten([
|
||||
for account in var.email_accounts : [
|
||||
for mailbox in account.mailboxes : {
|
||||
name = "${account.recipient}-${mailbox}"
|
||||
recipient = "${account.recipient}+${mailbox}"
|
||||
domain = account.domain
|
||||
server = account.receive.server
|
||||
port = account.receive.port
|
||||
username = account.username
|
||||
password = account.password
|
||||
mailbox = mailbox
|
||||
delete_after = coalesce(account.delete_after, 30)
|
||||
}
|
||||
]
|
||||
])
|
||||
|
||||
postfix_env_vars = {
|
||||
# Email configuration
|
||||
SMTP_HOST = var.relay_smtp_host
|
||||
SMTP_PORT = var.relay_smtp_port
|
||||
MY_PRIMARY_DOMAIN = var.primary_domain
|
||||
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
|
||||
}
|
||||
|
||||
password_hashes = {
|
||||
for account in var.email_accounts : account.username => data.external.password_hasher[account.username].result.hex_encoded_bcrypt_hash
|
||||
}
|
||||
|
||||
postfix_secrets = {
|
||||
SMTP_USER = {
|
||||
key = "username"
|
||||
name = kubernetes_secret.relay_mail_credentials.metadata[0].name
|
||||
}
|
||||
|
||||
SMTP_PASSWORD = {
|
||||
key = "password"
|
||||
name = kubernetes_secret.relay_mail_credentials.metadata[0].name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user