7 lines
221 B
JavaScript
7 lines
221 B
JavaScript
// https://www.rfc-editor.org/rfc/rfc7208#section-7.1
|
|
export function validateSpfDomain(domain) {
|
|
return domain
|
|
.split(".")
|
|
.every(segment => segment.match(/^([^%]|%_|%%|%-|%\{[slodiphcrtv]\d*r?[-.+,\/_=]*})+$/));
|
|
}
|