我想在postfix中创建bounce消息,它将显示来自我的过滤器脚本的错误信息。我发现,如果我从像1这样的脚本返回错误代码,我会看到所有数据打印到标准输出,但我也会看到有关脚本文件的信息。例如:
This is the mail system at host mail.somesys.pl.
I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below.
For further assistance, please send mail to postmaster.
If you do so, please include this problem report. You can delete your own text from the attached returned message.
The mail system
<user01@mail.somesys.pl>: Command died with status 1:
"/opt/SmtpReceiver/SmtpReceiverHandler.py". Command output: NO FILES OR BAD
CREDENTIALS
我只想要这样的东西:
^{pr2}$我的帖子母版.cf配置:
smtp inet n - n - - smtpd
-o content_filter=myhook:dummy
...
myhook unix - n n - - pipe
flags=F user=user01 argv=/opt/SmtpReceiver/SmtpReceiverHandler.py ${sender} ${size} ${recipient}
和python脚本:
if __name__=='__main__':
try:
app = SmtpReceiverHandler();
app.run();
except Exception, e:
print e;
sys.exit(1);
您可以在^{中指定
bouce_template_file
参考号:Postfix docs
相关问题 更多 >
编程相关推荐