mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Make it possible to disable the raw SPF optimizer debug record (#795)
Open to other configuration opens for how best to make this optional. Or potentially making this an opt in configuration item which would be a breaking change. The main reason that someone would want to disable this is if their raw SPF record goes over the 255 characters. This is potentially another place that could get some multi string support. But as it is only used for debugging purposes it seems like there should be a way to outright disable it too.
This commit is contained in:
@@ -741,7 +741,7 @@ function SPF_BUILDER(value) {
|
||||
if (!value.label) {
|
||||
value.label = '@';
|
||||
}
|
||||
if (!value.raw) {
|
||||
if (!value.raw && value.raw !== '') {
|
||||
value.raw = '_rawspf';
|
||||
}
|
||||
|
||||
@@ -752,10 +752,13 @@ function SPF_BUILDER(value) {
|
||||
// If flattening is requested, generate a TXT record with the raw SPF settings.
|
||||
if (value.flatten && value.flatten.length > 0) {
|
||||
p.flatten = value.flatten.join(',');
|
||||
if (value.ttl) {
|
||||
r.push(TXT(value.raw, rawspf, TTL(value.ttl)));
|
||||
} else {
|
||||
r.push(TXT(value.raw, rawspf));
|
||||
// Only add the raw spf record if it isn't an empty string
|
||||
if (value.raw !== '') {
|
||||
if (value.ttl) {
|
||||
r.push(TXT(value.raw, rawspf, TTL(value.ttl)));
|
||||
} else {
|
||||
r.push(TXT(value.raw, rawspf));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user