From fb1572e825d2ad1a6a7998c7ae1f2f7edf332018 Mon Sep 17 00:00:00 2001 From: Braz Date: Mon, 27 Aug 2018 15:42:49 +0200 Subject: [PATCH] Adding config-variable "smtp_mailuser" Adding the config-variable "smtp_mailuser", because in some environments it's not always possible, that the alerting-mail sender is 'grr-noreply' --- .../grr_response_server/output_plugins/email_plugin.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/grr/server/grr_response_server/output_plugins/email_plugin.py b/grr/server/grr_response_server/output_plugins/email_plugin.py index 4091945d9..a1b9ed6a7 100644 --- a/grr/server/grr_response_server/output_plugins/email_plugin.py +++ b/grr/server/grr_response_server/output_plugins/email_plugin.py @@ -89,10 +89,15 @@ def ProcessResponse(self, response): signature=config.CONFIG["Email.signature"], hostname=utils.SmartUnicode(hostname), creator=utils.SmartUnicode(self.token.username)) - + + if config.CONFIG["Worker.smtp_mailuser"]: + email_sender = config.CONFIG["Worker.smtp_mailuser"] + else: + email_sender = "grr-noreply" + email_alerts.EMAIL_ALERTER.SendEmail( self.state.args.email_address, - "grr-noreply", + email_sender, utils.SmartStr(subject), utils.SmartStr(body), is_html=True)