community-edition
community-edition copied to clipboard
Remove mail container, no longer used or needed
The bytemark/smtp image hasn't been updated in 4 years. And plausible is able to send email via SMTP without this container. So I assume it is no longer used or needed.
@tckb thoughts?
hey @chill117 If this mechanism is now natively handled by plausible (I am not current on the recent changes) then, its okay to be removed.
PS: Apologies, I am not sure why, I didn't get any notifications of mentions at all, until now! I will try to go through the places I was tagged and will try to add my notes if possible.
I'm confused as to why the container was needed in the first place? I didn't change anything about this knowingly
I'm confused as to why the container was needed in the first place? I didn't change anything about this knowingly
That's a good question.. my original compose file, didn't have this image. I used mailhog
to be replaced by an actual smtp server. was this container added recently?
for some reason this container is used as a deployment too: https://github.com/plausible/hosting/blob/master/kubernetes/plausible-mail.yaml#L24
OK this is weird. I'll test at some point removing the container from my self-hosted installation to see if it has any negative effect.
Sure! I'll to dig up my K8rs installation manifests to check. At some point, I will create a PR to clean up a bit.
IIUC because we have bytemark/smtp, we don't have to use any external SMTP server by modifying the Plausible SMTP_*
configurations. In my case the mails go out via the machine where Plausible is running, the machine has a public IP. Basically Plausible uses the SMTP server from the container image.
Is this functionality built into Plausible? If it is, then we can remove the container.
And I agree that the container image is very old, so is the exim server inside it. Should be either replaced or updated.
I'm running the container without the SMTP container and it's working flawlessly.
@SebDanielsson have you changed any SMTP_*
settings in your setup? https://plausible.io/docs/self-hosting-configuration#mailersmtp-setup as in are you using an external SMTP server, if yes, I think that will work without bytemark/smtp
as it uses the Bamboo.SMTPAdapter
.
I stopped mail container in my setup (v1.4.4), and tried resetting password. Here is what I get in the Plausible container's logs.
05:11:07.444 [error] Task #PID<0.2744.0> started from #PID<0.2743.0> terminating
** (ArgumentError) raise/1 and reraise/2 expect a module name, string or exception as the first argument, got: {:network_failure, 'mail', {:error, :nxdomain}}
(bamboo 2.2.0) lib/bamboo/strategies/task_supervisor_strategy.ex:25: anonymous fn/3 in Bamboo.TaskSupervisorStrategy.deliver_later/3
(elixir 1.12.2) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
(stdlib 3.15) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Function: #Function<0.129554985/0 in Bamboo.TaskSupervisorStrategy.deliver_later/3>
Setting SMTP_HOST_ADDR
to localhost
also gives similar error.
05:04:16.278 [error] Task #PID<0.2748.0> started from #PID<0.2747.0> terminating
** (ArgumentError) raise/1 and reraise/2 expect a module name, string or exception as the first argument, got: {:network_failure, 'localhost', {:error, :econnrefused}}
(bamboo 2.2.0) lib/bamboo/strategies/task_supervisor_strategy.ex:25: anonymous fn/3 in Bamboo.TaskSupervisorStrategy.deliver_later/3
(elixir 1.12.2) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
(stdlib 3.15) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Function: #Function<0.129554985/0 in Bamboo.TaskSupervisorStrategy.deliver_later/3>
Basically, the mail
container is required if you are not using any external SMTP server.
Yes I'm using an external SMTP server. I think it's unneccessary for Plausible to have one in the compose file by default.
I think this container is indeed not needed. gen_smtp
can send email without an external relay server.
I'm a bit out of touch with the changes. But it seems this is indeed no longer needed. @ukutaht perhaps its time to remove it. The PR seems to be open for a while :)
Related #70