Please review pull request #634: #13645 Dont open a smtp connection if we will not sent any mail opened by (stschulte)

Description:

If tagmail finds out that there are no messages that have to be sent to
anyone puppet will still open a smtp connection (if smtpserver is set)
and then closes the connection without sending any data. This can lead
to a lot of syslogmessages on your smtp server like

sendmail: puppet.example.com did not issue MAIL/EXPN/VRFY/ETRN
during connection to MTA

The fix now does not even enter the send method if there are no reports
to be sent. This does also prevent unnecessary forking if there are no
reports.

  • Opened: Thu Apr 05 21:59:29 UTC 2012
  • Based on: puppetlabs:2.7.x (da765a867cd1b97f64bb114c7381a594e9675075)
  • Requested merge: stschulte:ticket/2.7.x/13645 (b5ae7f91a0da17e1c8215bacea6e5242e8cec8a1)

Diff follows:

diff --git a/lib/puppet/reports/tagmail.rb b/lib/puppet/reports/tagmail.rb
index c37341e..0454f92 100644
--- a/lib/puppet/reports/tagmail.rb
+++ b/lib/puppet/reports/tagmail.rb
@@ -118,7 +118,7 @@ def process
     # Now find any appropriately tagged messages.
     reports = match(taglists)
 
-    send(reports)
+    send(reports) unless reports.empty?
   end
 
   # Send the email reports.

    

--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to