diff --git a/dnsconfig.js b/dnsconfig.js index 5ee924a87..78a19680d 100644 --- a/dnsconfig.js +++ b/dnsconfig.js @@ -140,6 +140,14 @@ for (var subdomain in domains) { if (domainData.record.URL) { records.push(A(subdomainName, IP("192.0.2.1"), CF_PROXY_ON)); } + + // Handle Email Forwarding + if (domainData.email_forwarding) { + records.push(MX(subdomainName, 34, "route1.mx.cloudflare.net.")); + records.push(MX(subdomainName, 62, "route2.mx.cloudflare.net.")); + records.push(MX(subdomainName, 36, "route3.mx.cloudflare.net.")); + records.push(TXT(subdomainName, "\"" + "v=spf1 include:_spf.mx.cloudflare.net ~all" + "\"")); + } } var options = {