All Projects → benbalter → Gman

benbalter / Gman

Licence: mit
A ruby gem to check if the owner of a given email address or website is working for THE MAN (a.k.a verifies government domains).

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Gman

Mandriller
Mandrill SMTP API integration for ActionMailer
Stars: ✭ 124 (-9.49%)
Mutual labels:  email
Notification
WordPress Notification plugin
Stars: ✭ 128 (-6.57%)
Mutual labels:  email
Uswds Site
USWDS website and documentation
Stars: ✭ 135 (-1.46%)
Mutual labels:  government
Fluentemail
All in one email sender for .NET. Supports popular senders (SendGrid, MailGun, etc) and Razor templates.
Stars: ✭ 1,888 (+1278.1%)
Mutual labels:  email
Bamboo
Testable, composable, and adapter based Elixir email library for devs that love piping.
Stars: ✭ 1,756 (+1181.75%)
Mutual labels:  email
Mail
Mail app designed for elementary OS
Stars: ✭ 130 (-5.11%)
Mutual labels:  email
Mailjet Gem
[API v3] Mailjet official Ruby GEM
Stars: ✭ 119 (-13.14%)
Mutual labels:  email
Gulp Mjml
Add Gulp to your MJML workflow!
Stars: ✭ 137 (+0%)
Mutual labels:  email
Pytracking
Email open and click tracking library
Stars: ✭ 127 (-7.3%)
Mutual labels:  email
Caniuse.email
HTML and CSS Compatibility tables for emails
Stars: ✭ 133 (-2.92%)
Mutual labels:  email
Mailspring
💌 A beautiful, fast and fully open source mail client for Mac, Windows and Linux.
Stars: ✭ 11,953 (+8624.82%)
Mutual labels:  email
Spammy
Spam filtering made easy for you
Stars: ✭ 125 (-8.76%)
Mutual labels:  email
Git Clone Init
Automatic setup of user identity (user.email / user.name) on git clone
Stars: ✭ 130 (-5.11%)
Mutual labels:  email
Stronggrid
Strongly typed library for the entire SendGrid v3 API, including webhooks
Stars: ✭ 125 (-8.76%)
Mutual labels:  email
Git Multimail
Send notification emails for pushes to a git repository (an improved version of post-receive-mail)
Stars: ✭ 135 (-1.46%)
Mutual labels:  email
Zeyple
Postfix filter/hook to automatically encrypt outgoing emails with PGP/GPG
Stars: ✭ 122 (-10.95%)
Mutual labels:  email
H8mail
Email OSINT & Password breach hunting tool, locally or using premium services. Supports chasing down related email
Stars: ✭ 2,163 (+1478.83%)
Mutual labels:  email
Mailjet Apiv3 Nodejs
[API v3] Official Mailjet API v3 NodeJS wrapper
Stars: ✭ 137 (+0%)
Mutual labels:  email
Mailcare
[MIRRORING REPOSITORY] See https://gitlab.com/mailcare/mailcare. MailCare is an open source disposable email address services. Accessible via web browser or API to protect your privacy right now.
Stars: ✭ 136 (-0.73%)
Mutual labels:  email
Grpc Nebula
微服务治理框架简介
Stars: ✭ 132 (-3.65%)
Mutual labels:  government

Gman

Build Status Gem Version PRs Welcome

A ruby gem to check if the owner of a given email address or website is working for THE MAN (a.k.a verifies government domains). It will also provide you with metadata about the domain, such as the country, state, city, or agency, where applicable. It does this by leveraging the power of Naughty or Nice, the Public Suffix List, and the associated Ruby Gem.

You could theoretically use regex, but either you'll get a bunch of false positives, or your regex will be insanely complicated. gov.uk, may be valid, for example, but gov.fr is not (it's gouv.fr, for what it's worth). The solution? Use Public Suffix to verify that it's a valid public domain, then maintain a crowd-sourced sub-list of known global government and military domains. It should cover all US and international, government and military domains for both email and website verification.

See a domains that's missing or one that shouldn't be there? We'd love you to contribute.

Installation

Gman is a Ruby gem, so you'll need a little Ruby-fu to get it working. Simply

gem install gman

Or add this to your Gemfile before doing a bundle install:

gem 'gman'

Usage

In general

Verify email addresses

Gman.valid? "[email protected]" #=> true
Gman.valid? "[email protected]" #=> false

Verify domain

Gman.valid? "http://foo.bar.gov" #=> true
Gman.valid? "foo.bar.gov"        #=> true
Gman.valid? "foo.gov"            #=> true
Gman.valid? "foo.biz"            #=> false

Determine the type of domain

domain = Gman.new "whitehouse.gov"
domain.type     #=> :federal
domain.federal? #=> true
domain.state?   #=> false
domain.city?    #=> false
domain.county?  #=> false

Get information about the domain's geographic location (.gov and .us only)

domain = Gman.new "illinois.gov"
domain.state #=> "IL"
domain.city  #=> "springfield"

Get information about a .gov domain's owner

domain = Gman.new "whitehouse.gov"
domain.agency   #=> "Executive Office of the President"

Get the ISO Country Code information represented by a government domain

domain = Gman.new "whitehouse.gov" #=> #<Gman domain="whitehouse.gov" valid=true>
domain.country.name                #=> "United States"
domain.country.alpha2              #=> "US"
domain.country.alpha3              #=> "USA"
domain.country.currency            #=> "USD"
domain.country.calling_code        #=> "+1"

Check if a country is on the US Sanctions list

Gman.new("foo.gov.kp").sanctioned? #=> true

Command line

Getting information about a given domain

$ gman whitehouse.gov
Domain  : whitehouse.gov
Valid government domain
Type    : federal
Country : United States
State   : DC
City    : Washington
Agency  : Executive Office of the President

The command line tool will accept any domain-like string (email, url, etc.)

$ gman [email protected]
Domain  : illinois.gov
Valid government domain
Type    : state
Country : United States
State   : IL
City    : Springfield

Filter

Filters newline-separated email addresses from stdin. Example usage:

$ gman_filter < path/to/list/of/addresses.txt

Contributing

Contributions welcome! Please see the contribution guidelines for code contributions or for details on how to add, update, or delete government domains.

Credits

Heavily inspired by swot. Thanks @leereilly!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].