procmail

Want procmail to run a custom python script, everytime a new mail shows up

五迷三道 提交于 2019-12-03 06:13:56
问题 I have a pretty usual requirement with procmail but I am unable to get the results somehow. I have procmailrc file with this content: :0 * ^To.*@myhost | /usr/bin/python /work/scripts/privilege_emails_forward.py Wherein my custom python script(privilege_emails_forward.py) will be scanning through the email currently received and do some operations on the mail content. But I am unable to get the script getting executed at the first shot(let alone scanning through the mail content). Is this a

Procmail to automatically make new folders to store emails from new senders

混江龙づ霸主 提交于 2019-12-02 08:07:11
I am learning how to use procmail but at this point, I am not even sure it's the right tool for what I am trying to do. So far, I have managed to get fetchmail to retrieve emails from a Google IMAP account and procmail to filter those emails into local folders I had previously created. I am wondering though whether there is a way to get procmail to automatically create a new folder locally when an email from a new sender is being retrieved and to store that email into that folder. So far, I have only found a website that describes the possibility of procmail creating automatically folders for