Skip to content

Instantly share code, notes, and snippets.

@andris9
Last active July 3, 2020 07:21
Show Gist options
  • Save andris9/1f382c7fcd4806b3a506e6aa57aedc29 to your computer and use it in GitHub Desktop.
Save andris9/1f382c7fcd4806b3a506e6aa57aedc29 to your computer and use it in GitHub Desktop.
// npm install zone-mta
const bounces = require("zone-mta/lib/bounces");
let str = "550 11.22.33.44 listed at spamhaus, see http://www.spamhaus.org";
let bounceInfo = bounces.check(str);
console.log("data : %s", str.replace(/\n/g, "\n" + " ".repeat(11)));
Object.keys(bounceInfo || {}).forEach((key) => {
console.log("%s %s: %s", key, " ".repeat(8 - key.length), bounceInfo[key]);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment