import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
def main():
try:
args: dict = demisto.args()
root = args.get("key")
if root:
if not isinstance(root, list):
root = [root]
t: list = []
for obj in root:
internet_message_id = obj.get("internetMessageId")
recipients = obj.get("recipients", [])
if internet_message_id and recipients:
messages = []
for recipient in recipients:
address = recipient.get("address")
if address:
messages.append(f"{internet_message_id}:{address}")
t.extend(messages)
demisto.results(t)
except Exception as e:
demisto.error(traceback.format_exc())
return_error(f"Could not format data.\n{e}")
if __name__ in ("builtins", "__builtin__"):
main()
README
Get the Internet Message Id and Recipient’s address of Messages in a format of internet_message_id:recipients_address.
Script Data
Name
Description
Script Type
python3
Tags
transformer
Cortex XSOAR Version
6.2.0
Inputs
Argument Name
Description
key
Object Key.
Outputs
Path
Description
Type
Cofense.Message
ID and Recipient’s address of emails in specific format.