Outlook = ("Outlook.Application").SessionĪ).Folders("Inbox") # get the outlook instance and inbox folders ROOT = os.path.dirname(os.path.dirname(os.path.abspath(_file_))) What are your thoughts? harvester.py """Central mailbox management rules""" Also, I was thinking about replacing the criteria column from the file and use regex to search mails based on patterns. The script is currently working fine, but I'm wondering if it'd be possible to improve performance somehow. ![]() Then attachments are checked, mail should be moved, if not moved yet, and the attachment downloaded, if a directory is provided. For each mail, first address and subject are checked for matches and the mail is moved to the specified folder. Outlook_folder_2 (optional): "subfolder name"Įmails should be moved to the specified Outlook folder. Outlook_folder_1 (required): "folder name" The file's structure looks like this: criteria (required): "begins with" or "contains"Īddress (optional): (optional): "subject part"ĭirectory (optional): "C:\\my\\custom\\abs\\path\\" These have to be loaded and applied to the mails currently in the inbox. Essentially, I have an Excel sheet in which the rules are defined. I wrote this script to replace a VBA script for mailbox management that was in place before.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |