Configure action mailer

This commit is contained in:
Jorge Manrubia
2025-08-26 10:15:27 +02:00
parent 001aae0b83
commit b911a12833
5 changed files with 26 additions and 9 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ Beta is primarily intended for testing product features.
Beta tenant is:
- https://fizzy.37signals.works/
- https://fizzy-beta.37signals.com
This environment uses local disk for Active Storage.
+5 -1
View File
@@ -1,7 +1,11 @@
require_relative "production"
Rails.application.configure do
config.action_mailer.default_url_options = { host: "%{tenant}.37signals.works" }
config.hosts = [ "fizzy-beta.37signals.com" ] + config.hosts[1..]
config.action_mailer.smtp_settings[:domain] = config.hosts.first
config.action_mailer.smtp_settings[:address] = "smtp-outbound-staging"
config.action_mailer.default_url_options = { host: config.hosts.first, protocol: "https" }
# Let's keep beta on local disk. See https://github.com/basecamp/fizzy/pull/557 for context.
config.active_storage.service = :local
+5
View File
@@ -75,6 +75,11 @@ Rails.application.configure do
# Allow all hosts in development
config.hosts = nil
config.hosts = %w[ fizzy.localhost localhost 127.0.0.1 ]
# Host to be used in links rendered from ActionMailer
config.action_mailer.default_url_options = { host: config.hosts.first, port: 3005 }
if Rails.root.join("tmp/solid-queue.txt").exist?
config.active_job.queue_adapter = :solid_queue
config.solid_queue.connects_to = { database: { writing: :queue } }
+10 -6
View File
@@ -73,8 +73,17 @@ Rails.application.configure do
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
# Enable DNS rebinding protection and other `Host` header attacks.
config.hosts = [
"fizzy.37signals.com",
"localhost",
IPAddr.new("172.17.0.0/20") # Docker VPC
]
# Set host to be used by links generated in mailer templates.
config.action_mailer.default_url_options = { host: "%{tenant}.fizzy.37signals.com" }
config.action_mailer.default_url_options = { host: config.hosts.first, protocol: "https" }
config.action_mailer.smtp_settings = { domain: config.hosts.first, address: "smtp-outbound", port: 25, enable_starttls_auto: false }
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
@@ -86,11 +95,6 @@ Rails.application.configure do
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
# Enable DNS rebinding protection and other `Host` header attacks.
# config.hosts = [
# "example.com", # Allow requests from example.com
# /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
# ]
# Skip DNS rebinding protection for the default health check endpoint.
# config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
end
+5 -1
View File
@@ -1,5 +1,9 @@
require_relative "production"
Rails.application.configure do
config.action_mailer.default_url_options = { host: "%{tenant}.fizzy.37signals-staging.com" }
config.hosts = [ "fizzy.37signals-staging.com" ] + config.hosts[1..]
config.action_mailer.smtp_settings[:domain] = config.hosts.first
config.action_mailer.smtp_settings[:address] = "smtp-outbound-staging"
config.action_mailer.default_url_options = { host: config.hosts.first, protocol: "https" }
end