
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
mailgun_email_validator
Advanced tools
This gem adds a validates_as_email_with_mailgun
method to ActiveRecord. It first tries to verify an e-mail using the amazing Mailgun e-mail validation API and then falls back to using the spectator_validates_email gem if it can't connect.
Add the gem to your Rails project's Gemfile, then bundle install to get started.
gem 'mailgun_email_validator'
You'll need to add a MAILGUN_PUBLIC_KEY
environmental variable to your system, for instance in your ~/.bash_profile
:
export MAILGUN_PUBLIC_KEY='f23oifj3ojo2j3ofj32ijoj2iojf3iojoi2f32'
Alternatively, you can configure mailgun with an initializer:
In config/initializers/mailgun_email_validator.rb
:
MailgunEmailValidator.mailgun_public_key = 'f23oifj3ojo2j3ofj32ijoj2iojf3iojoi2f32'
Note: This is not a real Mailgun public key
To use mailgun_email_validator inside your models:
validates_as_email_with_mailgun :email
You can also specify many of the usual ActiveRecord validation options including :on
, :allow_nil
, :allow_blank
, and :message
.
There is also a helper method available on all models:
MyModel#valid_email_with_mailgun?(email) => true/false
Pull requests welcome.
FAQs
Unknown package
We found that mailgun_email_validator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.