mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-23 12:11:40 +01:00
Add Message-ID header to outgoing emails (#16076)
* Add Message-ID header to outgoing emails * Use email domain name from SMTP_FROM_ADDRESS, fallback on WEB_DOMAIN on failure * Use notifications@localhost as fallback for SMTP_FROM_ADDRESS, do not catch parse errors
This commit is contained in:
parent
5b384d1a26
commit
1efcbb9cfe
1 changed files with 5 additions and 2 deletions
|
@ -90,9 +90,12 @@ Rails.application.configure do
|
||||||
config.action_mailer.perform_caching = false
|
config.action_mailer.perform_caching = false
|
||||||
|
|
||||||
# E-mails
|
# E-mails
|
||||||
|
outgoing_email_address = ENV.fetch('SMTP_FROM_ADDRESS', 'notifications@localhost')
|
||||||
|
outgoing_mail_domain = Mail::Address.new(outgoing_email_address).domain
|
||||||
config.action_mailer.default_options = {
|
config.action_mailer.default_options = {
|
||||||
from: ENV.fetch('SMTP_FROM_ADDRESS', 'notifications@localhost'),
|
from: outgoing_email_address,
|
||||||
reply_to: ENV['SMTP_REPLY_TO']
|
reply_to: ENV['SMTP_REPLY_TO'],
|
||||||
|
'Message-ID': -> { "<#{Mail.random_tag}@#{outgoing_mail_domain}>" },
|
||||||
}
|
}
|
||||||
|
|
||||||
config.action_mailer.smtp_settings = {
|
config.action_mailer.smtp_settings = {
|
||||||
|
|
Loading…
Reference in a new issue