Refactor email configuration in Terraform files for improved clarity and consistency
This commit is contained in:
@@ -1,29 +1,9 @@
|
||||
locals {
|
||||
mail_path = "${local.persistent_folder}/mail"
|
||||
mailboxes_path = "${local.mail_path}/mailboxes"
|
||||
getmail_path = "${local.mail_path}/getmail"
|
||||
postfix_path = "${local.mail_path}/postfix"
|
||||
mail_backup_path = "${local.persistent_folder}/backup.mail"
|
||||
email_domain_name = "alexpires.me"
|
||||
|
||||
email_accounts = [
|
||||
{
|
||||
domain = "alexpires.me"
|
||||
recipient = "c.alexandre.pires"
|
||||
receive = {
|
||||
type = "imap"
|
||||
server = "mail-pt.securemail.pro"
|
||||
port = 993
|
||||
}
|
||||
send = {
|
||||
server = "smtp-pt.securemail.pro"
|
||||
port = 465
|
||||
}
|
||||
username = var.alexpires_me_email_username
|
||||
password = var.alexpires_me_email_password
|
||||
mailboxes = ["INBOX", "Sent", "Drafts", "Trash", "Spam"]
|
||||
}
|
||||
]
|
||||
mail_path = "${local.persistent_folder}/mail"
|
||||
mailboxes_path = "${local.mail_path}/mailboxes"
|
||||
getmail_path = "${local.mail_path}/getmail"
|
||||
postfix_path = "${local.mail_path}/postfix"
|
||||
mail_backup_path = "${local.persistent_folder}/backup.mail"
|
||||
|
||||
getmail_jobs = flatten([
|
||||
for account in local.email_accounts : [
|
||||
@@ -45,10 +25,10 @@ locals {
|
||||
# Email configuration
|
||||
SMTP_HOST = local.scaleway_smtp_host
|
||||
SMTP_PORT = 465
|
||||
MY_PRIMARY_DOMAIN = local.email_domain_name
|
||||
MY_PRIMARY_DOMAIN = local.domain_name
|
||||
MY_DESTINATION = join(",", [for account in local.email_accounts : account.domain])
|
||||
MY_NETWORKS = "127.0.0.0/8"
|
||||
MAILNAME = "smtp.alexpires.me"
|
||||
MAILNAME = "smtp.${local.domain_name}"
|
||||
DOVECOT_AUTH_ADDRESS = "dovecot-auth.mail.svc.cluster.local"
|
||||
DOVECOT_AUTH_PORT = 31000
|
||||
DOVECOT_LMTP_ADDRESS = "dovecot-lmtp.mail.svc.cluster.local"
|
||||
|
||||
Reference in New Issue
Block a user