开发者

Process incoming emails with script

开发者 https://www.devze.com 2022-12-23 13:03 出处:网络
Remember iwantsandy.com? It was quite popular for what it did. ANyways, I\'m looking to do something similar, but my question is, how does one process incoming emails? Let\'s assuming I\'m using PHP o

Remember iwantsandy.com? It was quite popular for what it did. ANyways, I'm looking to do something similar, but my question is, how does one process incoming emails? Let's assuming I'm using PHP or maybe even Ruby to do this. I would need a way to process the emails and dump them into a DB or something. Ok fine, but my main question is g开发者_运维知识库etting a script to kick off when an email comes in.

I have a VPS so I have full control over my environment and it's running Centos.


Set up a pipe alias which forwards the message to the stdin of a script:

/etc/aliases:

sendmailhere:    |/usr/local/bin/myscript


For this project I would use a PHP email client such as IMAP for PHP. I would have a cron job to execute the PHP script every ~10min. It will pull down all messages in the inbox and reply as needed.

0

精彩评论

暂无评论...
验证码 换一张
取 消