- Updated files to work with latest CI updates
- Remove date checking from item_sensor
-
Add
save_attachmentsaction.- Includes several pack configuration options:
attachment_directory: Fully-qualified server path name used to store attachments. Must be readable and writeable by Stackstorm. Defaults to "/opt/stackstorm/packs/msexchange/attachments".attachment_folder_maximum_size: Maximum storage space in MB (default is 50MB) alloted toattachment_directory. Pack maintenance process (see below) manages this.attachment_days_to_keep: Maximum number of days to keep saved attachments (default is 7 days). Also, managed by pack maintenance process.
- Uses same model as
search_itemsfor finding email messages for which to save attachments. Only email messages and file attachments are supported. - Action returns a list/array of dictionaries with following attributes:
email_subject- Full subject of the email.email_sent- Date that email was sent.sender_email_address- Email address of the sender.attachment_files- List/array of fully-qualified filenames from server of attachments saved. Example:
[ { "email_subject": "ACCOUNT LIST - resend for testing", "email_sent": "2021-06-25 13:54:34+00:00", "sender_email_address": "someone@example.com", "attachment_files": [ "/opt/stackstorm/packs/msexchange/attachments/Accounts_06_23_2021.xlsx" ] } ] - If attachment filename is not unique in target folder, attempts to generate a unique filename for each attachment via several methods, including date sent, date and time sent, and "random" 8-character string.
- Attachments can be saved either as BINARY (default) or TEXT format.
- An
attachment_directory_maintenancesensor/trigger/rule combination has been implemented and, by default, runs once daily (polling interval of 86400 seconds) to enforce these rules through thedo_attachment_directory_maintenanceaction. This action can be run manually, as well, if you need to override the pack configuration values; running manually it with no input values uses the pack configuration. - Maintenance process removes files by age first and then, if necessary, deletes remaining files starting with largest files until threshold is reached.
- Save attachment action has
replace_spaces_in_filenameenumerated value parameter (NONE [default], UNDERSCORE, OCTOTHORPE/HASH, and PIPE) to allow user to replace spaces in attachment file names, if desired. Default (NONE) is to preserve spaces.
- Includes several pack configuration options:
-
Enhancements to
search_itemsaction.- Moved search logic from
runmethod insearch_itemsaction into_search_itemsutility method inbase/actions.pyto allow functionality to be shared bysearch_itemsandsave_attachments. - Added
search_start_dateparameter specifying the start date for items to search. (End date is always "today".) Date can be entered as free-form text. Most any date format is supported, asdateutillibrary is used to parse input to validdatetimevalue. - Update
search_itemsaction to return additional item attributes, specific to email messages, fromitem_to_dicthelper method. Such attributes can be useful in filtering e-mails based on sender and/or originating domain.sender_email_address- Email address of sender.email_recipient_addresses- List/array of email recipients (fromexchangelibto_recipientslist only).
- Added optional
folder_nameparameter toitem_to_dicthelper method to include the name of the folder used in the search as attribute of returned dictionary. - Update
requirements.txtto includepython-dateutil(see above) andpytz, which is needed for creating timezone-awareexchangelibEWSDateTimeobjects for date searches.
- Moved search logic from
- Drop Python 2.7 support
- Corrected timestamp handling functions in item_sensor
- Added poll_interval configuration option for item_sensor
- Added dispatch trigger function with logic to process new item object properties in item_sensor
- Updated polling logic in item_sensor to update "READ" status on all new items
- Corrected version pinning in requirements.txt file - 1.10.0
- Set default folder to
Inboxforsearch_items - Fixed sensor bug with config object handling for non-autodiscovery systems
- Pinned exchangelib version to avoid
get_folder_by_name()deprecation - Fixed actions bug with config object handling for non-autodiscovery systems