msg['X-Mailer'] = "Puppetmaster deploy script v.{}".format(__version__)
- if self.verbose:
- LOG.info(_("Sending the following mail to {r!r} via {s}:{p}:\n{m}").format(
- r=to_addresses, m=msg.as_string(unixfrom=True),
- s=self.smtp_server, p=self.smtp_port))
- else:
- LOG.info(_("Sending a mail to {r!r} via {s}:{p}:\n{e}").format(
- r=to_addresses, e=pp(self.error_data),
- s=self.smtp_server, p=self.smtp_port))
+ LOG.info(_("Sending a mail to {r!r} via {s}:{p}.").format(
+ r=to_addresses, s=self.smtp_server, p=self.smtp_port))
+
+ if self.verbose or self.no_error_mail:
+ print(self.colored(_('Content of the mail:'), 'AQUA') + '\n' + body)
if self.no_error_mail:
- LOG.debug(_("It's undesired to send error mails."))
+ LOG.info(_("It's undesired to send error mails."))
return
if self.simulate: