Swoosh also supports the local adapter, https://hexdocs.pm/swoosh/Swoosh.Adapters.Local.html, which is meant for use in dev.
When using this adapter, the user can get access to the emails directly from the same host via /dev/mailbox.
At the moment, this route is controlled at compile time and only availed in dev
Given that MAIL_PROVIDER defaults to local, regardless of the compile env, should we not make available /dev/mailbox to all compile envs?
Ideally, instead of it being controlled by the compile env, it should be based on the value of MAIL_PROVIDER
The /dev/mailbox lists all emails sent in the whole system. This could be a big security risk.
@stuartc notes that if we're to do it, then we should probably restrict it to superusers only
https://github.com/OpenFn/lightning/pull/2700 introduced a
MAIL_PROVIDER
env var which specifies which email provider to use. The providers are essentially all the adapters supported by Swoosh: https://hexdocs.pm/swoosh/Swoosh.html#module-adapters So far, lightning only supportsmailgun
andsmtp
.Swoosh also supports the
local
adapter, https://hexdocs.pm/swoosh/Swoosh.Adapters.Local.html, which is meant for use indev
. When using this adapter, the user can get access to the emails directly from the same host via/dev/mailbox
. At the moment, this route is controlled at compile time and only availed indev
Given that
MAIL_PROVIDER
defaults tolocal
, regardless of the compile env, should we not make available/dev/mailbox
to all compile envs?Ideally, instead of it being controlled by the compile env, it should be based on the value of
MAIL_PROVIDER