Postfix: Send email to PHP

前端 未结 3 979
清歌不尽
清歌不尽 2021-01-22 18:36

Greetings,

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

3条回答
  •  孤独总比滥情好
    2021-01-22 19:18

    There are several options; the easiest being to use a .forward file containing: |/path/to/your/script in the $HOME of your user.

    Drawback: It's invoked once per mail Advantage: It's called with exactly one recipient and many parameters are passed using environment variables.

提交回复
热议问题