Merge pull request #8866 from adullact/feat-sendmail-emails

feat: add ability to use local sendmail binary to send emails
This commit is contained in:
Paul Chavard 2023-04-05 16:40:20 +00:00 committed by GitHub
commit 8049547326
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View file

@ -183,3 +183,8 @@ SMTP_USER=""
SMTP_PASS="" SMTP_PASS=""
SMTP_TLS="" SMTP_TLS=""
SMTP_AUTHENTICATION="plain" 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"), authentication: ENV.fetch("SMTP_AUTHENTICATION"),
enable_starttls_auto: ENV.fetch("SMTP_TLS").present? 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 else
sendinblue_weigth = ENV.fetch('SENDINBLUE_BALANCING_VALUE') { 0 }.to_i sendinblue_weigth = ENV.fetch('SENDINBLUE_BALANCING_VALUE') { 0 }.to_i
dolist_weigth = ENV.fetch('DOLIST_BALANCING_VALUE') { 0 }.to_i dolist_weigth = ENV.fetch('DOLIST_BALANCING_VALUE') { 0 }.to_i