我跟着postfix 文档设置一个脚本,我可以使用该脚本在check_policy_service
事件的传入邮件上编写自定义过滤器,并且它运行良好,但我无法访问电子邮件正文 - 只能从 STDIN 获取以下参数:
Array
(
[request] => smtpd_access_policy
[protocol_state] => RCPT
[protocol_name] => ESMTP
[client_address] => 208.40.44.179
[client_name] => smtprelay0179.hostedemail.com
[client_port] => 59713
[reverse_client_name] => smtprelay0179.hostedemail.com
[helo_name] => smtprelay.hostedemail.com
[sender] => [email protected]
[recipient] => [email protected]
[recipient_count] => 0
[queue_id] =>
[instance] => 27c5.5bccec9c.5f5b9.0
[size] => 1905
[etrn_domain] =>
[stress] =>
[sasl_method] =>
[sasl_username] =>
[sasl_sender] =>
[ccert_subject] =>
[ccert_issuer] =>
[ccert_fingerprint] =>
[ccert_pubkey_fingerprint] =>
[encryption_protocol] => TLSv1.2
[encryption_cipher] => AECDH-AES256-SHA
[encryption_keysize] => 256
[policy_context] =>
)
我如何访问原始电子邮件(标题和正文)以便我的过滤也可以选择性地依赖于它?
我master.cf
已经像这样配置了我的脚本:
filtermyemail unix - n n - 0 spawn
user=someuser argv=php /path-to-scripts/filter-incoming-email.php
答案1
访问策略委托不会传输消息正文。您需要创建一个米尔特相反,如果您需要访问邮件正文。