I currently have scripts in PowerShell and Python that import emails from Outlook using $outlook.GetNamespace(“MAPI”) and win32 respectively. However, scheduling tasks in PowerShell scripts requires the Outlook client to be open, which complicates automation setups.
My objective is to schedule email retrieval tasks using scripts (called by Control-M), and relying on the Outlook client being open is inconvenient for this purpose.
To address this, I’m seeking advice on developing scripts in PowerShell or Python that utilize the IMAP protocol to interact directly with the mail server. By bypassing the need for the Outlook client altogether, I aim to schedule email retrieval tasks seamlessly without compromising security.
Any recommendations or best practices for achieving this objective while ensuring passwords or sensitive data are not exposed would be highly valuable.
Thank you for your assistance!