diff --git a/smtp_connector.py b/smtp_connector.py index 4bc3af5..e977d50 100644 --- a/smtp_connector.py +++ b/smtp_connector.py @@ -836,9 +836,15 @@ def _send_email(self, param, action_result): # username = self.get_config()[phantom.APP_JSON_USERNAME] config = self.get_config() + sender_address = config.get("sender_address") + + if sender_address: + ret_val = self._validate_sender_email(action_result, sender_address) + if phantom.is_fail(ret_val): + return action_result.get_status() + else: + sender_address = config.get(phantom.APP_JSON_USERNAME) - # Derive 'from' email address - sender_address = config.get('sender_address', config.get(phantom.APP_JSON_USERNAME)) email_from = param.get(SMTP_JSON_FROM, sender_address) # validate sender email if inputted as a parameter