问题原文
原帖链接 · Javier Torón · CC BY-SA 3.0
my company wanted to have a footer added to all emails based on sender's address. We have successfully implemented it based on this article https://www.howtoforge.com/how-to-automatically-add-a-disclaimer-to-outgoing-emails-with-altermime-postfix-on-debian-squeeze.
Key master.cf lines are:
smtp inet n - - - - smtpd -o content_filter=dfilt:
dfilt unix - n n - - pipe
flags=Rq user=filter directory=/var/spool/filter null_sender= argv=/etc/postfix/autofooter -f ${sender} -- ${recipient}
It works when we send emails from webmail or outlook, but fails when they are sent from mobile email client. The mobile sent emails arrive to their recipients but autofooter script is not called at all.
What differences can exist between webmail and mobile emails?
已采纳解答
原帖链接 · Javier Torón · CC BY-SA 3.0
The real problem is that mobile emails came encoded in base 64 and altermime didn't decode b64 messages.
So we added a disclaimer-b64 argument and voilá:
/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; }
That's all!
This solution was found by (David, waiting for his personal details to give him a really deserved credit)
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
