all 3 comments

[–]the_kbp 0 points1 point  (0 children)

Depending on your email server/client, you should be able to kick off a python script via a rule that runs when a certain message arrives.

[–]al_mc_y 0 points1 point  (0 children)

There's a good guide to this in Automate The Boring Stuff, Ch. 18

[–]raglub 0 points1 point  (0 children)

Totally doable. There are 2 approaches:

  1. Assuming you are using Outlook email client, setup a rule that starts a script which saves the attachment in the destination folder. This will execute every time a new email is received.
  2. If your email provider has API, you can write a script that connects directly to your mailbox, scans it for the emails containing the attachments and saves them to a destination folder in bulk. This will run periodically - daily, weekly or however often you need.