Skip to content

Commit baaf301

Browse files
committed
Fixed email to have more exception handling
1 parent bb6fd14 commit baaf301

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

email/1.3.0/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
requests==2.25.1
1+
requests==2.32.3
22
glom==20.11.0
33
jsonpickle==2.0.0
44

email/1.3.0/src/app.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,16 @@ def send_email_smtp(self, smtp_host, recipient, subject, body, smtp_port, attach
164164
"success": False,
165165
"reason": f"Failed to send mail: {e}"
166166
}
167+
except Exception as e:
168+
return {
169+
"success": False,
170+
"reason": f"Failed to send mail (2): {e}"
171+
}
167172

168173
self.logger.info("Successfully sent email with subject %s to %s" % (subject, recipient))
169174
return {
170175
"success": True,
171-
"reason": "Email sent to %s, %s!" %(recipient,cc_emails) if cc_emails else "Email sent to %s!" % recipient,
176+
"reason": "Email sent to %s, %s!" % (recipient, cc_emails) if cc_emails else "Email sent to %s!" % recipient,
172177
"attachments": attachment_count
173178
}
174179

shuffle-tools/1.2.0/src/app.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2624,7 +2624,7 @@ def cleanup_ioc_data(self, input_data):
26242624

26252625

26262626
def parse_ioc(self, input_string, input_type="all"):
2627-
ioc_types = ["domains", "urls", "email_addresses", "ipv4s", "ipv4_cidrs", "md5s", "sha256s", "sha1s", "cves"]
2627+
ioc_types = ["domains", "urls", "email_addresses", "ipv4s", "ipv6s", "ipv4_cidrs", "md5s", "sha256s", "sha1s", "cves"]
26282628
#ioc_types = ["ipv4s"]
26292629

26302630
try:
@@ -2652,6 +2652,8 @@ def parse_ioc(self, input_string, input_type="all"):
26522652
new_input_types.append(item)
26532653

26542654
ioc_types = new_input_types
2655+
if len(ioc_types) == 0:
2656+
input_type = "all"
26552657

26562658
# Not used for anything after cleanup fixes
26572659
max_size = 7500000
@@ -2667,6 +2669,7 @@ def parse_ioc(self, input_string, input_type="all"):
26672669
for key, value in iocs.items():
26682670
if input_type != "all":
26692671
if key not in input_type:
2672+
print("Invalid key: %s" % key)
26702673
continue
26712674

26722675
if len(value) > 0:

0 commit comments

Comments
 (0)