Exim

刪除 Exim 版本號

  • September 6, 2019

我正在嘗試刪除您在收到 Exim 發送的電子郵件時看到的版本號。

Received: from user1 by site.org with local (Exim 4.72)

我試過在這兩個文件中編輯 smtp_banner

/etc/exim4/conf.d/main/02_exim4-config_options
/etc/exim4/exim4.conf.template

但是從那裡刪除版本號,然後重新載入 Exim 的配置不起作用。

我這樣發送測試電子郵件:

echo "Message Content" | mail -s "Subject goes here" email@email.com -v

更新 1

comp1:/etc/exim4# ls -l /etc/exim4/
共 96 個
drwxr-xr-x 9 root root 4096 2010 年 7 月 30 日 conf.d
-rw-r--r-- 1 root root 76239 Jan 21 08:24 exim4.conf.template
-rw-r----- 1 根 Debian-exim 204 2008 年 9 月 30 日 passwd.client
-rw-r--r-- 1 root root 1462 Jan 21 07:39 update-exim4.conf.conf

打開文件/etc/exim.conf並找到密鑰smtp_banner,然後以這種方式更改該行:

smtp_banner = "${primary_hostname} ESMTP Exim ${version_number} \ 

smtp_banner = "${primary_hostname} ESMTP \

smtp_banner 修改連接時顯示給客戶端的橫幅,但看起來您想更改 Received: 標頭中的內容。

為此,您需要定義 received_header_text,可能在 /etc/exim4/conf.d/main/02_exim4-config_options 中。預設情況下,該選項不在文件中,但根據文件,預設設置是

received_header_text = Received: \
 ${if def:sender_rcvhost {from $sender_rcvhost\n\t}\
 {${if def:sender_ident \
 {from ${quote_local_part:$sender_ident} }}\
 ${if def:sender_helo_name {(helo=$sender_helo_name)\n\t}}}}\
 by $primary_hostname \
 ${if def:received_protocol {with $received_protocol}} \
 ${if def:tls_cipher {($tls_cipher)\n\t}}\
 (Exim $version_number)\n\t\
 ${if def:sender_address \
 {(envelope-from <$sender_address>)\n\t}}\
 id $message_exim_id\
 ${if def:received_for {\n\tfor $received_for}}

因此,您應該能夠將上述文本粘貼到您的配置中,進行任何您想要的更改。

引用自:https://serverfault.com/questions/352176