Skip to content

Commit

Permalink
[Marketplace Contribution] Microsoft Exchange Online - Content Pack U…
Browse files Browse the repository at this point in the history
…pdate (#24722)

* [Marketplace Contribution] Microsoft Exchange Online - Content Pack Update (#24610)

* "contribution update to pack "Microsoft Exchange Online""

* revert module change

* update README

* revert removing default classifier and mapper

* revert removing default classifier and mapper

* revert imports change

* Update EWSO365.yml

* Rename 1_1_0.md to 1_0_7.md

* Update EWSO365.yml

* Update EWSO365.yml

* Update 1_0_7.md

---------

Co-authored-by: yaakovpraisler <ypreisler@paloaltonetworks.com>
Co-authored-by: Yaakov Praisler <59408745+yaakovpraisler@users.noreply.github.com>

* Update pack_metadata.json

* Create 1_0_8.md

---------

Co-authored-by: xsoar-bot <67315154+xsoar-bot@users.noreply.github.com>
Co-authored-by: yaakovpraisler <ypreisler@paloaltonetworks.com>
Co-authored-by: Yaakov Praisler <59408745+yaakovpraisler@users.noreply.github.com>
  • Loading branch information
4 people authored Feb 19, 2023
1 parent 8e02a29 commit 06cb4dd
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 25 deletions.
19 changes: 11 additions & 8 deletions Packs/MicrosoftExchangeOnline/Integrations/EWSO365/EWSO365.py
Original file line number Diff line number Diff line change
Expand Up @@ -1829,7 +1829,7 @@ def handle_template_params(template_params): # pragma: no cover
return actual_params


def create_message_object(to, cc, bcc, subject, body, additional_headers, from_address, reply_to):
def create_message_object(to, cc, bcc, subject, body, additional_headers, from_address, reply_to, importance):
"""Creates the message object according to the existence of additional custom headers.
"""
if additional_headers:
Expand All @@ -1841,6 +1841,7 @@ def create_message_object(to, cc, bcc, subject, body, additional_headers, from_a
subject=subject,
reply_to=reply_to,
body=body,
importance=importance,
**additional_headers
)

Expand All @@ -1851,12 +1852,13 @@ def create_message_object(to, cc, bcc, subject, body, additional_headers, from_a
bcc_recipients=bcc,
subject=subject,
reply_to=reply_to,
body=body
body=body,
importance=importance
)


def create_message(to, subject='', body='', bcc=None, cc=None, html_body=None, attachments=None,
additional_headers=None, from_address=None, reply_to=None): # pragma: no cover
additional_headers=None, from_address=None, reply_to=None, importance=None): # pragma: no cover
"""Creates the Message object that will be sent.
Args:
Expand All @@ -1876,7 +1878,7 @@ def create_message(to, subject='', body='', bcc=None, cc=None, html_body=None, a
"""
if not html_body:
# This is a simple text message - we cannot have CIDs here
message = create_message_object(to, cc, bcc, subject, body, additional_headers, from_address, reply_to)
message = create_message_object(to, cc, bcc, subject, body, additional_headers, from_address, reply_to, importance)

for attachment in attachments:
if not attachment.get('cid'):
Expand All @@ -1888,7 +1890,7 @@ def create_message(to, subject='', body='', bcc=None, cc=None, html_body=None, a
attachments += html_attachments

message = create_message_object(to, cc, bcc, subject, HTMLBody(html_body), additional_headers, from_address,
reply_to)
reply_to, importance)

for attachment in attachments:
if not attachment.get('cid'):
Expand Down Expand Up @@ -1933,7 +1935,7 @@ class TempClass(ExtendedProperty):
def send_email(client: EWSClient, to, subject='', body="", bcc=None, cc=None, htmlBody=None,
attachIDs="", attachCIDs="", attachNames="", manualAttachObj=None,
transientFile=None, transientFileContent=None, transientFileCID=None, templateParams=None,
additionalHeader=None, raw_message=None, from_address=None, replyTo=None): # pragma: no cover
additionalHeader=None, raw_message=None, from_address=None, replyTo=None, importance=None): # pragma: no cover
to = argToList(to)
cc = argToList(cc)
bcc = argToList(bcc)
Expand All @@ -1951,7 +1953,8 @@ def send_email(client: EWSClient, to, subject='', body="", bcc=None, cc=None, ht
bcc_recipients=bcc,
body=raw_message,
author=from_address,
reply_to=reply_to
reply_to=reply_to,
importance=importance
)

else:
Expand All @@ -1971,7 +1974,7 @@ def send_email(client: EWSClient, to, subject='', body="", bcc=None, cc=None, ht
htmlBody = htmlBody.format(**template_params)

message = create_message(to, subject, body, bcc, cc, htmlBody, attachments, additionalHeader, from_address,
reply_to)
reply_to, importance)

client.send_email(message)

Expand Down
25 changes: 11 additions & 14 deletions Packs/MicrosoftExchangeOnline/Integrations/EWSO365/EWSO365.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ configuration:
type: 15
section: Collect
advanced: true
description: |-
The new EWS O365 integration uses OAuth 2.0 protocol and can be used with Exchange Online and Office 365 (mail).
description: The new EWS O365 integration uses OAuth 2.0 protocol and can be used with Exchange Online and Office 365 (mail).
display: EWS O365
name: EWSO365
script:
Expand All @@ -175,22 +174,12 @@ script:
- description: The ID of the email message for which to get the attachments.
name: item-id
required: true
secret: false
- default: false
description: The mailbox in which this attachment was found. If empty, the default mailbox is used. Otherwise the user might require impersonation rights to this mailbox.
isArray: false
- description: The mailbox in which this attachment was found. If empty, the default mailbox is used. Otherwise the user might require impersonation rights to this mailbox.
name: target-mailbox
required: false
secret: false
- default: false
description: The attachments ids to get. If none - all attachments will be retrieve from the message. Support multiple attachments with comma-separated value or array.
- description: The attachments ids to get. If none - all attachments will be retrieve from the message. Support multiple attachments with comma-separated value or array.
isArray: true
name: attachment-ids
required: false
secret: false
deprecated: false
description: Retrieves the actual attachments from an item (email message). To get all attachments for a message, only specify the item-id argument.
execution: false
name: ews-get-attachment
outputs:
- contextPath: EWS.Items.FileAttachments.attachmentId
Expand Down Expand Up @@ -917,6 +906,14 @@ script:
- description: Email addresses that need to be used to reply to the message. Supports comma-separated values.
isArray: true
name: replyTo
- auto: PREDEFINED
defaultValue: Normal
description: Sets the importance/Priority of the email. Default value is Normal
name: importance
predefined:
- High
- Normal
- Low
description: Sends an email.
name: send-mail
- name: reply-mail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,7 @@ Impersonation rights are required. To perform actions on the target mailbox of o
| raw_message | Raw email message to send. If provided, all other arguments, but to, cc and bcc, will be ignored. | Optional |
| from_address | The email address from which to reply. | Optional |
| replyTo | Email addresses that need to be used to reply to the message. Supports comma-separated values. | Optional |
| importance | Sets the importance/Priority of the email. Default value is Normal. | Optional |


#### Context Output
Expand Down
3 changes: 2 additions & 1 deletion Packs/MicrosoftExchangeOnline/ReleaseNotes/1_0_7.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

#### Integrations
##### EWS Extension Online Powershell v2
- Note: Organized the the integrations' parameters by sections. Relevant for XSIAM and XSOAR 8.1 and above.
Expand All @@ -6,4 +7,4 @@
##### EWS O365
- Note: Organized the the integrations' parameters by sections. Relevant for XSIAM and XSOAR 8.1 and above.
##### O365 - Security And Compliance - Content Search v2
- Note: Organized the the integrations' parameters by sections. Relevant for XSIAM and XSOAR 8.1 and above.
- Note: Organized the the integrations' parameters by sections. Relevant for XSIAM and XSOAR 8.1 and above.
5 changes: 5 additions & 0 deletions Packs/MicrosoftExchangeOnline/ReleaseNotes/1_0_8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

#### Integrations
##### EWS O365
Added support for the *importance* argument in the ***send-mail*** command.
- Updated the Docker image to: *demisto/py3ews:1.0.0.48807*.
4 changes: 2 additions & 2 deletions Packs/MicrosoftExchangeOnline/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Microsoft Exchange Online",
"description": "Exchange Online and Office 365 (mail)",
"support": "xsoar",
"currentVersion": "1.0.7",
"currentVersion": "1.0.8",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand All @@ -16,4 +16,4 @@
"xsoar",
"marketplacev2"
]
}
}

0 comments on commit 06cb4dd

Please sign in to comment.