【发布时间】:2019-07-30 15:43:38
【问题描述】:
当我们的服务未能发送电子邮件时,返回给发件人的拒绝通知包含失败代码的堆栈跟踪。有没有办法发送交货通知,而不会附加错误?
我们有一个 postfix 服务器,它在一个包罗万象的 python 脚本中处理传入的电子邮件。该脚本将电子邮件上传到我们的一项服务,并在失败时抛出异常。
这是我们使用的模板
failure_template = <<EOF
Charset: us-ascii
From: MAILER-DAEMON (Mail Delivery System)
Subject: Undelivered Mail Returned to Sender
Postmaster-Subject: Postmaster Copy: Undelivered Mail
This is the mail system at host $myhostname.
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
EOF
预期的结果将只是模板通知,没有 catch-all 脚本的轨迹。
【问题讨论】:
标签: postfix-mta