Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
The mta-settings
gem enables transparent MTA (mail transport agent)
configuration from the environment for both ActionMailer and Mail,
based on either an explicit MTA_URL
variable or popular conventions for
Sendgrid, Mandrill, Postmark, and Mailgun (as provided by Heroku addons, for
example).
Add this line to your application's Gemfile:
gem 'mta-settings'
If mta-settings
is required (which Bundler does automatically by default),
ActionMailer configuration is fully automatic. With Rails, be aware that
config.action_mailer
assignments will take precedence, so you might want to
strip those out of your apps config/environments/
files.
Mail.defaults do
delivery_method *MtaSettings.from_env
# delivery_method *MtaSettings.from_url(ENV['MTA_URL'])
end
Configuration will happen based on the presence of the following environment variables, in order of decreasing precedence:
MTA_PROVIDER
: points to another environment variable containing an MTA URLMTA_URL
: See belowSENDGRID_USERNAME
: SendgridMANDRILL_APIKEY
: MandrillPOSTMARK_API_TOKEN
: PostmarkMAILGUN_SMTP_LOGIN
: MailgunMAILTRAP_API_TOKEN
: Mailtrap (for development)If no supported environment variable is found, the configuration is left blank. This enables easy defaulting:
ActionMailer::Base.delivery_method ||= :letter_opener
The scheme of an MTA URL is used to set the delivery method. The user,
password, host, port, and path portions are used to populate the user_name
,
address
, port
, and location
settings of the chosen delivery method.
Query parameters are then merged in.
sendmail
and file
adapters both respect the ActionMailer location
defaults, so you can just give sendmail:///
or file:///
.smtp
URL, it will be used as domain
rather than
location
(minus the leading slash).domain
is set, the default from address will be set to noreply
at
that domain.Here's an example for Gmail:
smtp://username%40gmail.com:password@smtp.gmail.com:587/
Using an MTA URL is highly recommended even when your SMTP provider is supported out of the box. MTA URLs are much easier to copy between environments or try out locally for debugging.
FAQs
Unknown package
We found that mta-settings 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.