我正在尝试处理退回的消息并将其发送给负责的系统管理员。
我使用 CakePHP 电子邮件组件来发送消息。在服务器端,我使用 postfix 来传输消息。
function sendAsEmail($data) {
$Email->sendAs = 'html';
$Email->from = $user['Sender']['username'] . '@example.com';
$Email->return = Configure::read('App.systemAdminEmail');
$Email->bcc = array($data['Message']['recipient_text']);
$content = 'Some content';
$Email->send($content);
}
正如您在上面看到的,我将 $Email->return 设置为系统管理员的电子邮件,它将发送所有退回的邮件。
在后缀配置中,我尝试创建一个bounce.cf 模板并设置bounce_template_file。http://www.howtoforge.com/configure-custom-postfix-bounce-messages
如何获取退回的邮件并将其发送给系统管理员?