summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/reports/tagmail.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/puppet/reports/tagmail.rb b/lib/puppet/reports/tagmail.rb
index a2c973f8f..9b3711148 100644
--- a/lib/puppet/reports/tagmail.rb
+++ b/lib/puppet/reports/tagmail.rb
@@ -28,6 +28,10 @@ Puppet::Reports.register_report(:tagmail) do
This will send all messages to ``me@domain.com``, and all messages from
webservers that are not also from mailservers to ``httpadmins@domain.com``.
+
+ If you are using anti-spam controls, such as grey-listing, on your mail
+ server you should whitelist the sending email (controlled by ``reportform``
+ configuration option) to ensure your email is not discarded as spam.
"
@@ -127,7 +131,14 @@ Puppet::Reports.register_report(:tagmail) do
Net::SMTP.start(Puppet[:smtpserver]) do |smtp|
reports.each do |emails, messages|
Puppet.info "Sending report to %s" % emails.join(", ")
- smtp.send_message(messages, Puppet[:reportfrom], *emails)
+ smtp.open_message_stream(Puppet[:reportfrom], *emails) do |p|
+ p.puts "From: #{Puppet[:reportfrom]}"
+ p.puts "Subject: Puppet Report for %s" % self.host
+ p.puts "To: " + emails.join(", ")
+ p.puts "Date: " + Time.now.rfc2822
+ p.puts
+ p.puts messages
+ end
end
end
rescue => detail