From 2cc5e7f7233a3ae01bc28888a8fd001e723a9efd Mon Sep 17 00:00:00 2001 From: Sapir Malka <44067957+itssapir@users.noreply.github.com> Date: Sun, 2 Feb 2025 16:36:13 +0200 Subject: [PATCH] EWSO365 fix send-mail with inline images (#38385) * Fixed case where "new_attachment" is used without being initialized --- .../Integrations/EWSO365/EWSO365.py | 10 +++++----- Packs/MicrosoftExchangeOnline/ReleaseNotes/1_6_1.md | 6 ++++++ Packs/MicrosoftExchangeOnline/pack_metadata.json | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 Packs/MicrosoftExchangeOnline/ReleaseNotes/1_6_1.md diff --git a/Packs/MicrosoftExchangeOnline/Integrations/EWSO365/EWSO365.py b/Packs/MicrosoftExchangeOnline/Integrations/EWSO365/EWSO365.py index 34e015f47af5..36b02f01d551 100644 --- a/Packs/MicrosoftExchangeOnline/Integrations/EWSO365/EWSO365.py +++ b/Packs/MicrosoftExchangeOnline/Integrations/EWSO365/EWSO365.py @@ -1588,7 +1588,7 @@ def handle_template_params(template_params): # pragma: no cover elif params[p].get('key'): actual_params[p] = demisto.dt(demisto.context(), params[p]['key']) except ValueError as e: - return_error('Unable to parse template_params: %s' % (str(e))) + return_error(f'Unable to parse template_params: {str(e)}') return actual_params @@ -1659,12 +1659,12 @@ def create_message(to, subject='', body='', bcc=None, cc=None, html_body=None, a for attachment in attachments: if not isinstance(attachment, FileAttachment): if not attachment.get('cid'): - new_attachment = FileAttachment(name=attachment.get('name'), content=attachment.get('data')) + attachment = FileAttachment(name=attachment.get('name'), content=attachment.get('data')) else: - new_attachment = FileAttachment(name=attachment.get('name'), content=attachment.get('data'), - is_inline=True, content_id=attachment.get('cid')) + attachment = FileAttachment(name=attachment.get('name'), content=attachment.get('data'), + is_inline=True, content_id=attachment.get('cid')) - message.attach(new_attachment) + message.attach(attachment) return message diff --git a/Packs/MicrosoftExchangeOnline/ReleaseNotes/1_6_1.md b/Packs/MicrosoftExchangeOnline/ReleaseNotes/1_6_1.md new file mode 100644 index 000000000000..61a7d101a6e7 --- /dev/null +++ b/Packs/MicrosoftExchangeOnline/ReleaseNotes/1_6_1.md @@ -0,0 +1,6 @@ + +#### Integrations + +##### EWS O365 + +- Fixed an issue where the ***send-mail*** command would fail when providing an *html_body* argument with inline images. \ No newline at end of file diff --git a/Packs/MicrosoftExchangeOnline/pack_metadata.json b/Packs/MicrosoftExchangeOnline/pack_metadata.json index 32f5624997cd..a147e160bb3f 100644 --- a/Packs/MicrosoftExchangeOnline/pack_metadata.json +++ b/Packs/MicrosoftExchangeOnline/pack_metadata.json @@ -2,7 +2,7 @@ "name": "Microsoft Exchange Online", "description": "Exchange Online and Office 365 (mail)", "support": "xsoar", - "currentVersion": "1.6.0", + "currentVersion": "1.6.1", "author": "Cortex XSOAR", "url": "https://www.paloaltonetworks.com/cortex", "email": "",