Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make possible fo value colon-separated #15

Open
g-yonchev opened this issue Sep 4, 2020 · 1 comment
Open

Make possible fo value colon-separated #15

g-yonchev opened this issue Sep 4, 2020 · 1 comment

Comments

@g-yonchev
Copy link

Hi,
According to the spec https://tools.ietf.org/html/rfc7489#section-6.3 (and also few www examples https://mxtoolbox.com/dmarc/details/dmarc-tags/dmarc-failure-reporting-options)

... The value of this tag is a colon-separated list of characters...

When I do

let tags = dmarc('v=DMARC1; fo=0:1:s;');

getting the message Invalid value for 'fo': '0:1:s', must be one of: 0, 1, d, s.

Expect to be returned in the tags insead.

@g-yonchev
Copy link
Author

I guess if you do

let values = value.split(/:/).map(x => x.trim());
for (let val of values) {
  if (!/^([01ds])$/i.test(val)) {
    throw new Error(`Invalid value for '${term}': '${value}', must be one of: 0, 1, d, s`);
  }
}

insead of https://github.com/softvu/dmarc-parse/blob/master/index.js#L20-L22
will fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant