![Share on Facebook Facebook](https://www.rootlinks.net/wp-content/plugins/social-media-feather/synved-social/image/social/regular/48x48/facebook.png)
![Share on Twitter twitter](https://www.rootlinks.net/wp-content/plugins/social-media-feather/synved-social/image/social/regular/48x48/twitter.png)
![Share by email mail](https://www.rootlinks.net/wp-content/plugins/social-media-feather/synved-social/image/social/regular/48x48/mail.png)
.forwardでメール転送するとヘッダーにuseridが付加されることがあります。
Received: by mail.example.jp (Postfix, from userid 9000) id 2666364E29; Sat,
9 Sep 2017 10:53:29 +0900 (JST)
メールを送信したuser idが表示されるので、これを非表示にしました。
参考サイト
postfix – Remove userid from Recieved header – Server Fault
https://serverfault.com/questions/333176/remove-userid-from-recieved-header
/etc/postfix/header_checksにルールを追加します。
1 2 3 |
# vi /etc/postfix/header_checks ^Received: by (.*) .*Postfix, from userid [0-9]+\)\s*id ([A-F[:digit:]]+)(.*) (.*)/ REPLACE Received: by $1 (Postfix) id $2$3 (JST) |
確認
1 2 3 4 |
# postmap -q "Received: by mail.example.jp (Postfix, from userid 9000) id 2666364E29; Sat, 9 Sep 2017 10:53:29 +0900 (JST)" regexp:/etc/postfix/header_checks REPLACE Received: by mail.example.jp (Postfix) id 2666364E29; Sat, 9 Sep 2017 10:53:29 +0900 (JST) # systemctl reload postfix |
これで”, from userid 9000″の部分が表示されなくなりました。