Skip to content

Commit

Permalink
fix description field in mailer responder #835
Browse files Browse the repository at this point in the history
  • Loading branch information
Davide Arcuri committed Aug 10, 2020
1 parent 814cf1c commit b2965c4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions responders/Mailer/mailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ def run(self):
Responder.run(self)

title = self.get_param("data.title", None, "title is missing")
if self.data_type == "thehive:case_task":
if self.data_type in ["thehive:case", "thehive:case_task"]:
description = self.get_param(
"data.description", None, "description is missing"
)
else:
elif self.data_type == "thehive:alert":
description = self.get_param(
"data.case.description", None, "description is missing"
)
else:
self.error("Invalid dataType")

mail_to = None
if self.data_type == "thehive:case":
Expand Down Expand Up @@ -69,9 +71,6 @@ def run(self):
else:
self.error("recipient address not found in observables")

else:
self.error("Invalid dataType")

msg = MIMEMultipart()
msg["Subject"] = title
msg["From"] = self.mail_from
Expand Down

0 comments on commit b2965c4

Please sign in to comment.