Skip to content

Instantly share code, notes, and snippets.

Last active Dec 13, 2015
What would you like to do?
Some ruby code to do a spam check of an email via
#!/usr/bin/env ruby
require 'json'
f = open('test/fixtures/raw_email.txt')
s =
h = { email: s, options: 'long' } # the postmarkapp format'spam-check.json', 'w') { |f| f.write(h.to_json) }
results = `curl -X POST "" -H "Accept: application/json" -H "Content-Type: application/json" -v -d @spam-check.json`
results = JSON.parse(results)
puts results['report']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment