Outlook – How to get outlook email attachment onto a file server

attachmentsautomationemailmicrosoft-outlookscript

Background:

Every work day I get an e-mail message from a known sender. The sender puts an attachment in the e-mail message. I have to process that attachment with a python script.

Question:

What is the best (automatic) way for me to get the attachment out of Outlook and onto my shell account (or local filesystem) so I can process it with the script, without having to manually open the file every day and save the attachment?

Best Answer

I assume you have an Exchange server that Outlook is talking to. Is IMAP enabled on the server? If so, it should be reasonably trivial to write a program that searches the IMAP server for an email from a particular sender received within the last 24 hours and parse out (what I assume to be) a MIME attachment.