Skip to content

Commit

Permalink
Merge branch 'pull-1351'
Browse files Browse the repository at this point in the history
This closes GH-1351
  • Loading branch information
adrienthebo committed May 29, 2013
2 parents 7c7e9a5 + 351aae6 commit 8dbe436
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions lib/puppet/defaults.rb
Expand Up @@ -1298,6 +1298,16 @@ def self.default_diffargs
:smtpserver => {
:default => "none",
:desc => "The server through which to send email reports.",
},
:smtpport => {
:default => 25,
:desc => "The TCP port through which to send email reports.",
},
:smtphelo => {
:default => Facter["fqdn"].value,
:desc => "The name by which we identify ourselves in SMTP HELO for reports.
If you send to a smtpserver which does strict HELO checking (as with Postfix's
`smtpd_helo_restrictions` access controls), you may need to ensure this resolves.",
}
)

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/reports/tagmail.rb
Expand Up @@ -133,7 +133,7 @@ def send(reports)
pid = Puppet::Util.safe_posix_fork do
if Puppet[:smtpserver] != "none"
begin
Net::SMTP.start(Puppet[:smtpserver]) do |smtp|
Net::SMTP.start(Puppet[:smtpserver], Puppet[:smtpport], Puppet[:smtphelo]) do |smtp|
reports.each do |emails, messages|
smtp.open_message_stream(Puppet[:reportfrom], *emails) do |p|
p.puts "From: #{Puppet[:reportfrom]}"
Expand Down

0 comments on commit 8dbe436

Please sign in to comment.