aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib/action_mailer/log_subscriber.rb
diff options
context:
space:
mode:
authorJaap van der Plas <jvdplas@gmail.com>2019-02-13 15:55:38 +0100
committerGeorge Claghorn <george.claghorn@gmail.com>2019-02-13 09:55:38 -0500
commit2488901da8a4d896003254869a378f0c1b4ed3f2 (patch)
tree6911e103fef3a6e87f9274b3f8bde75417c232a6 /actionmailer/lib/action_mailer/log_subscriber.rb
parent47e3bbeb9057b37c244330cc4e745c8a8090e8c5 (diff)
downloadrails-2488901da8a4d896003254869a378f0c1b4ed3f2.tar.gz
rails-2488901da8a4d896003254869a378f0c1b4ed3f2.tar.bz2
rails-2488901da8a4d896003254869a378f0c1b4ed3f2.zip
Don’t log recipients when sending mail
Since production applications typically run with log level info and email adresses should be considered as sensitive data we want to prevent them from ending up in the logs. In development mode (with log level debug) they are still logged as part of the Mail::Message object.
Diffstat (limited to 'actionmailer/lib/action_mailer/log_subscriber.rb')
-rw-r--r--actionmailer/lib/action_mailer/log_subscriber.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/actionmailer/lib/action_mailer/log_subscriber.rb b/actionmailer/lib/action_mailer/log_subscriber.rb
index 25c99342c2..26910f20f0 100644
--- a/actionmailer/lib/action_mailer/log_subscriber.rb
+++ b/actionmailer/lib/action_mailer/log_subscriber.rb
@@ -10,11 +10,10 @@ module ActionMailer
def deliver(event)
info do
perform_deliveries = event.payload[:perform_deliveries]
- recipients = Array(event.payload[:to]).join(", ")
if perform_deliveries
- "Sent mail to #{recipients} (#{event.duration.round(1)}ms)"
+ "Delivered mail #{event.payload[:message_id]} (#{event.duration.round(1)}ms)"
else
- "Skipped sending mail to #{recipients} as `perform_deliveries` is false"
+ "Skipped delivery of mail #{event.payload[:message_id]} as `perform_deliveries` is false"
end
end