Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃摟 Self-hosted e-mail configuration #4

Merged
merged 7 commits into from Oct 14, 2019
129 domain.tf
@@ -18,10 +18,21 @@ resource "digitalocean_record" "milanvit_net_ns" {
}

resource "digitalocean_record" "milanvit_net_a" {
for_each = {
"apex" = {
name = "@",
value = digitalocean_droplet.web.ipv4_address
},
"mail" = {
name = "mail",
value = digitalocean_droplet.web.ipv4_address
}
}

type = "A"
domain = digitalocean_domain.milanvit_net.name
name = "@"
value = digitalocean_droplet.web.ipv4_address
name = each.value.name
value = each.value.value

ttl = var.dns_ttl
}
@@ -55,21 +66,11 @@ resource "digitalocean_record" "milanvit_net_caa" {

resource "digitalocean_record" "milanvit_net_mx" {
for_each = {
"zoho-1" = {
"mail" = {
name = "@",
value = "mx.zoho.eu.",
value = "mail.milanvit.net.",
priority = 10
},
"zoho-2" = {
name = "@",
value = "mx2.zoho.eu.",
priority = 20
},
"zoho-3" = {
name = "@",
value = "mx3.zoho.eu.",
priority = 50
},
"mailgun-1" = {
name = "mg",
value = "mxa.mailgun.org.",
@@ -103,19 +104,23 @@ resource "digitalocean_record" "milanvit_net_txt" {
},
"spf" = {
name = "@",
value = "v=spf1 include:zoho.eu ~all"
value = "v=spf1 mx ~all"
}
"zoho-verification" = {
name = "@",
value = "zoho-verification=zb15208526.zmverify.zoho.eu"
"dkim" = {
name = "dkim._domainkey",
value = "v=DKIM1; k=rsa; t=s; s=email; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwLQCm/CYESXG4F6Rk9A74l1SHWhvmDErMnBiubeBEe4dOM7T6rL8MlfUXxt6+v6TSoJptoLFycRkMC7v5CP3MQw30fz2VAYz2h4eIzcI7583hVZiIbsEiz0dwBINLGf9NoaV1lTuaXPB0sY81bzg2Hc5q3sbO+do7oqSAFcYkFeraALTscrhRLxNWhKLPyrtpP4ty7aJ90CqICewCGmFiPHBP4EBuu5thGUN3U5T4sCfzrHDJCMgg1UyFpuKZZQ7eO9exs/7xYjpj26bRA+IoGBp+Iia5gqJuaOVEiXOPTE8rfRyur1DA0gVP29peHTZTIH85iy0It7CChIuiws5gwIDAQAB"
},
"dmarc" = {
name = "_dmarc",
value = "v=DMARC1; p=none; fo=1; rua=mailto:milanvit@milanvit.net; ruf=mailto:milanvit@milanvit.net"
},
"zoho-domainkey" = {
name = "zoho._domainkey",
value = "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCLy+Ai660bgkkqna15ztNlLoQ8JfDdMpeoZW5znT4nyORqUNjOhbWWNiQsm3KXFo0fW5LVvpFpLcGg5hoMxerCEkD7NpFw6dQX8iA+2+okC7wzcRR5SZ4WTWo6RUvoBE5t5kksRYKqmlqp5wNDDJcWH9oFXjXTWapln8HDE1/XIwIDAQAB"
"carddav-srv-helper" = {
name = "_carddavs._tcp",
value = "path=/SOGo/dav/"
},
"caldav-srv-helper" = {
name = "_caldavs._tcp",
value = "path=/SOGo/dav/"
},
"mailgun-spf" = {
name = "mg",
@@ -141,13 +146,13 @@ resource "digitalocean_record" "milanvit_net_cname" {
name = "*",
value = "@"
},
"connect" = {
name = "connect",
value = "customer-connect.zoho.eu."
"autoconfig" = {
name = "autoconfig",
value = "mail.milanvit.net."
},
"mail" = {
name = "mail-old",
value = "business.zoho.eu."
"autodiscover" = {
name = "autodiscover",
value = "mail.milanvit.net."
},
"mail-mailgun" = {
name = "email.mg",
@@ -169,6 +174,76 @@ resource "digitalocean_record" "milanvit_net_cname" {

resource "digitalocean_record" "milanvit_net_srv" {
for_each = {
"imap" = {
name = "_imap._tcp",
value = "mail.milanvit.net.",
priority = 0,
port = 143,
weight = 1
},
"imaps" = {
name = "_imaps._tcp",
value = "mail.milanvit.net.",
priority = 0,
port = 993,
weight = 1
},
"pop3" = {
name = "_pop3._tcp",
value = "mail.milanvit.net.",
priority = 0,
port = 110,
weight = 1
},
"pop3s" = {
name = "_pop3s._tcp",
value = "mail.milanvit.net.",
priority = 0,
port = 995,
weight = 1
},
"submission" = {
name = "_submission._tcp",
value = "mail.milanvit.net.",
priority = 0,
port = 587,
weight = 1
},
"smtps" = {
name = "_smtps._tcp",
value = "mail.milanvit.net.",
priority = 0,
port = 465,
weight = 1
},
"sieve" = {
name = "_sieve._tcp",
value = "mail.milanvit.net.",
priority = 0,
port = 4190,
weight = 1
},
"autodiscover" = {
name = "_autodiscover._tcp",
value = "mail.milanvit.net.",
priority = 0,
port = 443,
weight = 1
},
"carddavs" = {
name = "_carddavs._tcp",
value = "mail.milanvit.net.",
priority = 0,
port = 443,
weight = 1
},
"caldavs" = {
name = "_caldavs._tcp",
value = "mail.milanvit.net.",
priority = 0,
port = 443,
weight = 1
},
"xmpp-1" = {
name = "_xmpp-server._tcp",
value = "xmpp-server.l.google.com.",
@@ -4,7 +4,7 @@ data "digitalocean_ssh_key" "tricia" {

resource "digitalocean_droplet" "web" {
image = "ubuntu-18-04-x64"
name = "milanvit.net"
name = "mail.milanvit.net"
region = "ams3"
size = "s-1vcpu-2gb"

ProTip! Use n and p to navigate between commits in a pull request.
You can鈥檛 perform that action at this time.