diff --git a/.env.development b/.env.development index 24dfe4e..d257f5f 100644 --- a/.env.development +++ b/.env.development @@ -15,3 +15,6 @@ APP_PORTFOLIO_PRODUCTION_MAILER_URL=localhost:3000 #reCaptcha settings APP_PORTFOLIO_reCAPTCHA_SITE_KEY="" APP_PORTFOLIO_reCAPTCHA_SECRET_KEY="" + +#mailer settings +MAIL_SMTP_ADDRESS='localhost' diff --git a/.env.test b/.env.test index 5688510..a62888b 100644 --- a/.env.test +++ b/.env.test @@ -11,3 +11,6 @@ APP_PORTFOLIO_DATABASE_TIMEOUT=5000 APP_PORTFOLIO_DATABASE_USERNAME= APP_PORTFOLIO_PRODUCTION_MAILER_URL=localhost:3000 + +#mailer settings +MAIL_SMTP_ADDRESS='localhost' diff --git a/config/environments/production.rb b/config/environments/production.rb index 6bdc451..7d6f22b 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -65,16 +65,19 @@ # config.active_job.queue_adapter = :resque # config.active_job.queue_name_prefix = "application_portfolio_#{Rails.env}" + # Configure Secure Sendmail mailer config.action_mailer.raise_delivery_errors = true - config.action_mailer.perform_caching = false - config.action_mailer.default_options = { from: 'uclappdev@uc.edu' } + config.mailer_from = 'uclappdev@uc.edu' + config.action_mailer.delivery_method = :smtp # Store the base url from where request is received. config.action_mailer.default_url_options = { host: ENV['APP_PORTFOLIO_PRODUCTION_MAILER_URL'] } - # updated for tls and sendmail config.action_mailer.smtp_settings = { enable_starttls_auto: true, + # 'address' specifies the address of the server that will handle email sending. + address: ENV['MAIL_SMTP_ADDRESS'], + # 'port' specifies which port to use on the SMTP server. port: 25, # 'ca_file' is the path to the certificate authority file. # In our case, it's a self-signed certificate. This tells Rails to trust this specific certificate.