From d93aa23d1cb3f61198e08ba5d4e2125b77b7e906 Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Fri, 18 Aug 2017 00:52:34 +0200 Subject: [PATCH] Avoid disclosure of internal hostname via Message-ID header of mails Use the host of default_url_options for generating that header instead. --- app/mailers/mailer.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/mailers/mailer.rb b/app/mailers/mailer.rb index ec1c9ae2..6911197d 100644 --- a/app/mailers/mailer.rb +++ b/app/mailers/mailer.rb @@ -76,6 +76,7 @@ class Mailer < ActionMailer::Base end def mail(args) + args[:message_id] = "#{Mail.random_tag}@#{default_url_options[:host]}" unless args[:message_id] args[:subject] = "[#{FoodsoftConfig[:name]}] #{args[:subject]}" if args[:from].is_a? User