Browse Source

Merge pull request #2819 from strugee/use-sendmail-option

Add an option to send email using `sendmail`
Akinori MUSHA 4 years ago
parent
commit
28c46a081a
2 changed files with 5 additions and 1 deletions
  1. 4 0
      .env.example
  2. 1 1
      config/environments/production.rb

+ 4 - 0
.env.example

@@ -105,6 +105,10 @@ IMPORT_DEFAULT_SCENARIO_FOR_ALL_USERS=true
 # SMTP_USER_NAME must be set to none or else you will receive
 # errors that AUTH not enabled.
 
+# Uncomment if you want to use `/usr/sbin/sendmail` to send email instead of SMTP.
+# This option is ignored unless RAILS_ENV=production, and setting it to `sendmail` causes the settings in the rest of this section (except EMAIL_FROM_ADDRESS) to be ignored.
+#SMTP_DELIVERY_METHOD=sendmail
+
 SMTP_DOMAIN=your-domain-here.com
 SMTP_USER_NAME=you@gmail.com
 SMTP_PASSWORD=somepassword

+ 1 - 1
config/environments/production.rb

@@ -95,7 +95,7 @@ Huginn::Application.configure do
   end
   config.action_mailer.perform_deliveries = true
   config.action_mailer.raise_delivery_errors = true
-  config.action_mailer.delivery_method = :smtp
+  config.action_mailer.delivery_method = ENV.fetch('SMTP_DELIVERY_METHOD', 'smtp').to_sym
   config.action_mailer.perform_caching = false
   # smtp_settings moved to config/initializers/action_mailer.rb
 end