From e3d4ea87fc78494e24ac8fe57ef5cf0d4e7e94ef Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Wed, 9 Jan 2008 14:19:51 +1100 Subject: Fixes ticket #993 - tagmail with smtpserver specified does not add To/From/Subject header --- lib/puppet/reports/tagmail.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/puppet/reports/tagmail.rb b/lib/puppet/reports/tagmail.rb index a2c973f8f..8c643fa08 100644 --- a/lib/puppet/reports/tagmail.rb +++ b/lib/puppet/reports/tagmail.rb @@ -127,7 +127,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 -- cgit From f15696cd547106b61cd8a9da4b69453ba89dfd18 Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Thu, 10 Jan 2008 14:11:54 +1100 Subject: Updated tagmail documentation fixing ticket #996 --- lib/puppet/reports/tagmail.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/puppet/reports/tagmail.rb b/lib/puppet/reports/tagmail.rb index 8c643fa08..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. " -- cgit