diff --git a/smtp.json b/smtp.json index 823d8e1..5cf754a 100644 --- a/smtp.json +++ b/smtp.json @@ -135,7 +135,7 @@ "read_only": false, "parameters": { "from": { - "description": "Sender Address, domain can not include 'phantom', 'splunk', or 'cisco'", + "description": "Sender Address", "data_type": "string", "order": 0, "contains": [ @@ -404,7 +404,7 @@ "read_only": false, "parameters": { "from": { - "description": "Sender Address, domain can not include 'phantom', 'splunk', or 'cisco'", + "description": "Sender Address", "data_type": "string", "order": 0, "primary": true, diff --git a/smtp_connector.py b/smtp_connector.py index c600510..fef2bc1 100644 --- a/smtp_connector.py +++ b/smtp_connector.py @@ -232,21 +232,6 @@ def _validate_integer(self, action_result, parameter, key, allow_zero=False): return phantom.APP_SUCCESS, parameter - def _validate_sender_email(self, action_result, input_data): - # sender emails also have additional restriction - # to not include splunk related terms in the domain name - restricted_domains = ["splunk", "cisco", "phantom"] - domain = input_data.split("@")[-1].lower() - - if any(restricted_domain in domain for restricted_domain in restricted_domains): - return action_result.set_status( - phantom.APP_ERROR, - "The domain provided in email is restricted (contains one of : splunk, cisco, phantom).\ - Please use a different email in the 'from' field." - ) - - return action_result.set_status(phantom.APP_SUCCESS) - def _validate_email(self, input_data): # validations are always tricky things, making it 100% foolproof, will take a # very complicated regex, even multiple regexes and each could lead to a bug that @@ -818,12 +803,6 @@ def _send_email(self, param, action_result): 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 - if action_id != "test_connectivity" and param.get(SMTP_JSON_FROM): - ret_val = self._validate_sender_email(action_result, email_from) - if phantom.is_fail(ret_val): - return action_result.get_status() - encoding = config.get(SMTP_ENCODING, False) smtputf8 = config.get(SMTP_ALLOW_SMTPUTF8, False) body = param[SMTP_JSON_BODY] @@ -1045,12 +1024,6 @@ def _handle_send_htmlemail(self, param): # noqa: C901 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 - if param.get(SMTP_JSON_FROM): - ret_val = self._validate_sender_email(action_result, email_from) - if phantom.is_fail(ret_val): - return action_result.get_status() - email_to = param['to'] email_cc = param.get('cc') email_bcc = param.get('bcc')