diff options
| author | Paul Lathrop <paul@tertiusfamily.net> | 2008-01-15 15:16:25 -0800 |
|---|---|---|
| committer | Paul Lathrop <paul@tertiusfamily.net> | 2008-01-15 15:16:25 -0800 |
| commit | 34f5bda4e5f40b1137bd49e9d659dded7d473410 (patch) | |
| tree | b921cea08c322e14c8ffce9973f8c64b697bf4d2 /lib | |
| parent | 1ff9d658f852698ca4fcd62c94d633824950d5c1 (diff) | |
| parent | b24ac77d938cca8d436ed2aceba3523e97a1ab74 (diff) | |
| download | puppet-34f5bda4e5f40b1137bd49e9d659dded7d473410.tar.gz puppet-34f5bda4e5f40b1137bd49e9d659dded7d473410.tar.xz puppet-34f5bda4e5f40b1137bd49e9d659dded7d473410.zip | |
Merge branch '0.24.x' of git://reductivelabs.com/puppet into 0.24.x
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/puppet/reports/tagmail.rb | 13 |
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 |
