
Security News
Researcher Exposes Zero-Day Clickjacking Vulnerabilities in Major Password Managers
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
mail_auto_link_obfuscation
Advanced tools
This gem hooks up your Rails application and prevents email clients from automatically converting link-like text (e.g. example.com
, info@example.com
, ftp://123.234.234.234
) to hyperlinks in your emails.
Automatic links can be an undesired feature, especially when user generated content is part of your emails, e.g. a user's name. If your user is called your.enemy.com
and you insert the name directly in your mail, you will find that most email clients will make this name clickable. This effect can brake your email layout/design and even worse, it can be considered a security issue.
To prevent email clients from auto-linking any link-like text we have to outsmart their link parsers. Wrapping special link characters like .
, /
and @
with invisible/non-printable zero-width non-joiner characters (Unicode U+200C) has shown to work for most email clients.
Example: "Hello your.enemy.com!"
becomes "Hello your\u200C.\u200Cenemy\u200C.\u200Ccom"
Note that this module will not touch any explicit links mentioned in anchors in the href
attribute. Those links are considered desired and trusted. If you provide HTML and text parts with your email (which you should) this gem is also smart enough not to change links in the text part if those have been explicitly hyperlinked in the HTML part.
Add this line to your application's Gemfile:
gem 'mail_auto_link_obfuscation'
Simply include MailAutoLinkObfuscation::Automatic
in the mailers where you want obfuscate links.
class MyMailer
include MailAutoLinkObfuscation::Automatic
end
Specs can be run with rake spec
. Guard is also available.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/moneybird/mail_auto_link_obfuscation. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that mail_auto_link_obfuscation 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
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.