about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorAkihiko Odaki (@fn_aki@pawoo.net) <akihiko.odaki.4i@stu.hosei.ac.jp>2017-07-07 07:12:12 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-07-07 00:12:12 +0200
commit2083000027451249836c369eb961300d7faf5f99 (patch)
treeb65fa158ac68e0135abbb843fa3ddc19b03dc47b /app
parent18d3fa953b5af8ab17cc93c33cb95cec37127712 (diff)
Set default From address in config (#3756)
The old implementation sets default From address in mailers. It sets
the address from SMTP_FROM_ADDRESS, or notifications@localhost. The
behavior is occasionally undesired results.

In production environment, notifications@localhost is likely to be
incorrect.
In testing environment, the email address should not be varied by a
environment variable.

After appling this change,

In production environment, it will throw an exception when launching
Mastodon.
In testing environment, the address will be fixed with
notifications@localhost.
Diffstat (limited to 'app')
-rw-r--r--app/mailers/application_mailer.rb1
-rw-r--r--app/mailers/user_mailer.rb1
2 files changed, 0 insertions, 2 deletions
diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb
index 2e730c19b..95b770ff1 100644
--- a/app/mailers/application_mailer.rb
+++ b/app/mailers/application_mailer.rb
@@ -1,7 +1,6 @@
 # frozen_string_literal: true
 
 class ApplicationMailer < ActionMailer::Base
-  default from: ENV.fetch('SMTP_FROM_ADDRESS') { 'notifications@localhost' }
   layout 'mailer'
   helper :instance
 
diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb
index 6abf9c9ca..1517c027e 100644
--- a/app/mailers/user_mailer.rb
+++ b/app/mailers/user_mailer.rb
@@ -1,7 +1,6 @@
 # frozen_string_literal: true
 
 class UserMailer < Devise::Mailer
-  default from: ENV.fetch('SMTP_FROM_ADDRESS') { 'notifications@localhost' }
   layout 'mailer'
 
   helper :instance