mirror of
https://github.com/mjl-/mox.git
synced 2025-01-14 01:06:27 +03:00
don't generate duplicate spf record if hostname is equal to domain name, e.g. postmaster@mail.domain.
the assumption has been that the hostname is something like mail.<domain>, when setting up mox with the quickstart for user@<domain>. but users can use the quickstart for postmaster@mail.<domain> as well. for issue #46 by x8x, thanks for reporting!
This commit is contained in:
parent
61a5eb61a4
commit
f4c20673ff
1 changed files with 10 additions and 4 deletions
|
@ -453,18 +453,24 @@ func DomainRecords(domConf config.Domain, domain dns.Domain) ([]string, error) {
|
||||||
"; Once your setup is working, you may want to increase the TTL.",
|
"; Once your setup is working, you may want to increase the TTL.",
|
||||||
"$TTL 300",
|
"$TTL 300",
|
||||||
"",
|
"",
|
||||||
|
}
|
||||||
|
|
||||||
"; For the machine, only needs to be created for the first domain added.",
|
if d != h {
|
||||||
fmt.Sprintf(`%-*s IN TXT "v=spf1 a -all"`, 20+len(d), h+"."), // ../rfc/7208:2263 ../rfc/7208:2287
|
records = append(records,
|
||||||
"",
|
"; For the machine, only needs to be created once, for the first domain added.",
|
||||||
|
fmt.Sprintf(`%-*s IN TXT "v=spf1 a -all"`, 20+len(d), h+"."), // ../rfc/7208:2263 ../rfc/7208:2287
|
||||||
|
"",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
records = append(records,
|
||||||
"; Deliver email for the domain to this host.",
|
"; Deliver email for the domain to this host.",
|
||||||
fmt.Sprintf("%s. MX 10 %s.", d, h),
|
fmt.Sprintf("%s. MX 10 %s.", d, h),
|
||||||
"",
|
"",
|
||||||
|
|
||||||
"; Outgoing messages will be signed with the first two DKIM keys. The other two",
|
"; Outgoing messages will be signed with the first two DKIM keys. The other two",
|
||||||
"; configured for backup, switching to them is just a config change.",
|
"; configured for backup, switching to them is just a config change.",
|
||||||
}
|
)
|
||||||
var selectors []string
|
var selectors []string
|
||||||
for name := range domConf.DKIM.Selectors {
|
for name := range domConf.DKIM.Selectors {
|
||||||
selectors = append(selectors, name)
|
selectors = append(selectors, name)
|
||||||
|
|
Loading…
Reference in a new issue