feat: add ability to use local sendmail binary to send emails

This commit is contained in:
Nicolas Cavigneaux 2023-04-05 14:32:37 +02:00
parent b8f639721e
commit 4ea08d070b
2 changed files with 11 additions and 0 deletions

View file

@ -183,3 +183,8 @@ SMTP_USER=""
SMTP_PASS=""
SMTP_TLS=""
SMTP_AUTHENTICATION="plain"
# Sendmail
SENDMAIL_ENABLED="disabled"
SENDMAIL_LOCATION="/usr/sbin/sendmail"
SENDMAIL_ARGUMENTS="-i"

View file

@ -88,6 +88,12 @@ Rails.application.configure do
authentication: ENV.fetch("SMTP_AUTHENTICATION"),
enable_starttls_auto: ENV.fetch("SMTP_TLS").present?
}
elsif ENV['SENDMAIL_ENABLED'] = 'enabled'
config.action_mailer.delivery_method = :sendmail
config.action_mailer.sendmail_settings = {
location: ENV.fetch("SENDMAIL_LOCATION"),
arguments: ENV.fetch("SENDMAIL_ARGUMENTS")
}
else
sendinblue_weigth = ENV.fetch('SENDINBLUE_BALANCING_VALUE') { 0 }.to_i
dolist_weigth = ENV.fetch('DOLIST_BALANCING_VALUE') { 0 }.to_i