我的公司希望根据发件人的地址为所有电子邮件添加页脚。 我们已经成功实施它基于这篇文章https://www.howtoforge.com/how-to-automatically-add-a-disclaimer-to-outgoing-emails-with-altermime-postfix-on-debian-squeeze 。
主要的master.cf行是:
smtp inet n - - - - smtpd -o content_filter=dfilt: dfilt unix - nn - - pipe flags=Rq user=filter directory=/var/spool/filter null_sender= argv=/etc/postfix/autofooter -f ${sender} -- ${recipient}
当我们从webmail或outlook发送电子邮件,但是从移动电子邮件客户端发送时失败。 手机发送的电子邮件到达他们的收件人,但autofooter脚本根本不被调用。
networking邮件和手机邮件有什么不同?
真正的问题是移动电子邮件以64位编码,而altermime没有解码b64信息。
所以我们增加了一个免责声明,并声明:
/usr/bin/altermime --input=in.$$ \ --disclaimer=/etc/postfix/footers/${from_address}.txt \ --disclaimer-html=/etc/postfix/footers/${from_address}.htm \ --disclaimer-b64=/etc/postfix/footers/${from_address}.b64 || { echo Message content rejected; echo Message content rejected >> /etc/postfix/footers/errors.log; exit $EX_UNAVAILABLE; }
就这样!
(大卫,等待他的个人细节给他一个真正值得的信用)