LoginSignup
9
9

More than 5 years have passed since last update.

postfix でメール受信時にプログラムを起動する

Posted at

postfix で @example.com ドメイン宛メール受信時にPHPプログラムを起動する

postfix の設定

/etc/postfix/main.cf
mydomain = example.com
myorigin = $myhostname
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
virtual_alias_maps = regexp:/etc/postfix/virtual.myrequest

起動条件(正規表現)

/etc/postfix/virtual.myrequest
/^(.*)@example\.com/ kilica-request

起動するPHPの指定

kilica-request: "| /usr/bin/php /path/to/file/myprocess.php"
9
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9