【发布时间】:2019-09-01 07:23:33
【问题描述】:
使用 Postfix 和 PHP 我想处理退回邮件。
我首先像这样构建一个后缀服务器:
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-postfix-e-mail-server-with-dovecot
然后从
配置 master.cfhttps://thecodingmachine.io/triggering-a-php-script-when-your-postfix-server-receives-a-mail
我能够将所有外发电子邮件内容发送到我的 php 脚本,但我如何才能只将退回电子邮件发送到此脚本?
邮件发件人:
$headers[] = 'MIME-Version: 1.0';
$headers[] = 'Content-type: text/html; charset=iso-8859-1';
$headers[] = 'Reply-To: bounce@example.com';
$headers[] = 'Return-Path: bounce@example.com';
$headers[] = 'From: Example <postmaster@example.com>'
mail('Example <example@example.com>', "subject", "msg", implode("\r\n", $headers), "-f bounce@example.com");
master.cf 拾取将所有外发电子邮件发送到 example.php。 我尝试使用反弹而不是拾取但没有成功。
pickup fifo n - - 60 1 pickup
-o content_filter=myhook:dummy
myhook unix - n n - - pipe
flags=F user=www-data argv=/var/www/example.php ${sender} ${size} ${recipient}
我做错了什么?
谢谢
【问题讨论】:
标签: php debian postfix-mta email-bounces