DNSRecord renders the TXT record the user must publish. Returns the hostname (left of the apex) and the record value. Example for selector "e2a202605" + domain "mail.acme.com": name = "e2a202605._domainkey.mail.acme.com" value = "v=DKIM1; k=rsa; p=MIIBIjANBgkq..."
(selector, domain, publicKeyDNS string)
| 132 | // name = "e2a202605._domainkey.mail.acme.com" |
| 133 | // value = "v=DKIM1; k=rsa; p=MIIBIjANBgkq..." |
| 134 | func DNSRecord(selector, domain, publicKeyDNS string) (string, string) { |
| 135 | name := fmt.Sprintf("%s._domainkey.%s", selector, domain) |
| 136 | value := fmt.Sprintf("v=DKIM1; k=rsa; p=%s", publicKeyDNS) |
| 137 | return name, value |
| 138 | } |
| 139 | |
| 140 | // ExtractPublicKeyFromTXT pulls the "p=" payload out of a TXT record's |
| 141 | // raw value, trimming any whitespace mail systems sometimes inject when |
no outgoing calls