Checking email with Python

后端 未结 6 1519
心在旅途
心在旅途 2020-11-28 02:06

I am interested to trigger a certain action upon receiving an email from specific address with specific subject. In order to be able to do so I need to implement monitorin

6条回答
  •  清酒与你
    2020-11-28 02:39

    While not Python-specific, I've always loved procmail wherever I could install it...!

    Just use as some of your action lines for conditions of your choice | pathtoyourscript (vertical bar AKA pipe followed by the script you want to execute in those cases) and your mail gets piped, under the conditions of your choice, to the script of your choice, for it to do whatever it wants -- hard to think of a more general approach to "trigger actions of your choice upon receipt of mails that meet your specific conditions!! Of course there are no limits to how many conditions you can check, how many action lines a single condition can trigger (just enclose all the action lines you want in { } braces), etc, etc.

提交回复
热议问题