大网数据广告活动
服务器运维问答

Mobile sent emails don't get added disclaimer

· 52CE 我爱测

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-…

问题原文

原帖链接 · 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)

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-05-22)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。