后缀:将电子邮件发送到PHP [英] Postfix: Send email to PHP
问题描述
问候,
任何人都知道将电子邮件发送到我的后缀服务器的好方法,该服务器随后打开PHP脚本来处理此电子邮件吗?我可以做cron,但我想立即执行...
Anyone know of a good way to send an email to my postfix server which then opens a PHP script to process this email? I could do cron, but I'd prefer to do it instantly...
任何指针都非常感谢.
在此先感谢
推荐答案
您也许可以使用.forward,但最简单的方法可能是配置procmail.
You may be able to use a .forward, but probably the easiest way is to configure procmail.
这是一个示例.procmailrc规则,可能会有所帮助:
here's a sample .procmailrc rule that may help:
:0 w
* ^From.*authorized@example.com
| php /path/to/script.php
如果电子邮件来自authorized@example.com,则它将被传递到php脚本.由于此操作是通过可与邮件服务器集成的procmail完成的,因此MySql设置不会有任何影响.
If the email comes from authorized@example.com, then it will get passed to the php script. Since this is done from procmail which can be integrated with the mail server, the MySql setup shouldn't impact anything.
这篇关于后缀:将电子邮件发送到PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!