Giter VIP home page Giter VIP logo

spf-query's Introduction

spf-query

Code Climate Test Coverage Build Status

The spf-query library searches the SPF records for a host. We assume the host uses standard spf 'selectors', and also check if they use their own 'selector'.

Features

  • Queries and parses SPF records.
  • Supports querying both TXT and SPF records.

Examples

require 'spf/query'

SPF::Query::Record.query('twitter.com')
# => #<SPF::Query::Record: v=spf1 ip4:199.16.156.0/22 ip4:199.59.148.0/22 ip4:8.25.194.0/23 ip4:8.25.196.0/23 ip4:204.92.114.203 ip4:204.92.114.204/31 ip4:107.20.52.15 ip4:23.21.83.90 include:_spf.google.com include:_thirdparty.twitter.com -all>

SPF::Query::Record.parse("v=spf1 ip4:199.16.156.0/22 ip4:199.59.148.0/22 ip4:8.25.194.0/23 ip4:8.25.196.0/23 ip4:204.92.114.203 ip4:204.92.114.204/31 ip4:107.20.52.15 ip4:23.21.83.90 include:_spf.google.com include:_thirdparty.twitter.com -all")
# => #<SPF::Query::Record: v=spf1 ip4:199.16.156.0/22 ip4:199.59.148.0/22 ip4:8.25.194.0/23 ip4:8.25.196.0/23 ip4:204.92.114.203 ip4:204.92.114.204/31 ip4:107.20.52.15 ip4:23.21.83.90 include:_spf.google.com include:_thirdparty.twitter.com -all>

Synopsis

Query a domain:

spf-query google.com
____________________________
SPF record search for google.com
  - found SPF record for google.com at google.com:
  v=spf1 include:_spf.google.com ip4:216.73.93.70/31 ip4:216.73.93.72/31 ~all
____________________________

Query multiple domains:

spf-query trailofbits.com facebook.com yahoo.com
____________________________
SPF record search for trailofbits.com
  - found SPF record for trailofbits.com at trailofbits.com:
  v=spf1 include:_spf.google.com ~all
____________________________

____________________________
SPF record search for facebook.com
  - found SPF record for facebook.com at facebook.com:
  v=spf1 redirect=_spf.facebook.com
____________________________

____________________________
SPF record search for yahoo.com
  - found SPF record for yahoo.com at yahoo.com:
  v=spf1 redirect=_spf.mail.yahoo.com
____________________________

Requirements

Install

$ gem install spf-query

License

See the {file:LICENSE.txt} file.

spf-query's People

Contributors

chrismear avatar dguido avatar postmodern avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.