trigger a script when mailbox recieves mail?

空扰寡人 提交于 2019-12-08 10:04:33

Try a .forward file

You can pipe the message into any program or script you want, but also check if procmail can do what you want.

Depending on your mail server, it may be possible to actually have any incoming message be delivered to a process. Either in a .forward or by setting up something more advanced. In exim you can setup a transport to run a command, for certain addresses.

Jason Punyon

If you're using postfix I'd suggest aliasing the mailbox you're interested in to a process that will do the work for you. Then there's no polling. The message comes in and goes directly to being processed.

Paul Tomblin

As Jason and Zoredache have already mentioned, you might be able to do this in the MTA itself. Another possibility is to have inotify watch the mailbox file or maildir.

if you dont have a mail-server on your own (root-access) - you could use a web service for that: http://cloudmailin.net (200mails/month for free) - works like charme and helped me out.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!