We Are Hiring

Check Spam Using the Parse Webhook


Posted on

One of my favorite parts of SendGrid is our Parse Webhook. It’s a great tool that enables your applications to receive incoming email. One of the lesser known features of the API is the spam_report and spam_score parameters.

Every time your application receives an email through the Parse Webhook, SendGrid uses SpamAssassin and generates a score and report based on the content. We then post those pieces of data to your application along with the other parts of the email. This is useful to discard emails that are spam and avoid your application from having to process junk mail.

Try It Out

To get an idea of how this works. I made a quick application using the Go language called spamtest.me.

  1. Write up an email
  2. Send it to check@spamtest.me

You should get back an email with your spam score and a description of the rules triggered if any parts of the content look like spam.

Spamtest response

You want the spam score of your email to be as close as possible to 0 but definitely under 5.

Just For Fun

Send an intentionally spammy message. For example, try this subject line:
REF/PAYMENTS CODE: ECB/06654 $500,000 USD

And grab the spammy body from this GitHub gist.

Questions

If you have any questions feel free to contact me at kunal@sendgrid.com or on Twitter @kunal732. The code for this program can be found at the bottom of the spamtest.me website.

For more details on the feature behind this tool, download the Parse Webhook Guide.


Meet Kunal, Developer Evangelist at-large for SendGrid and home-grown New Jersey hacker. He previously ran General Machines, which developed Deaftel - a phone service for the deaf that converts voice to text and text back into voice over a phone call. Since March 2013, Kunal has been working as a Developer Evangelist at SendGrid, helping enable developers to get the tools and resources they need to make awesome, creative stuff.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>