
如何使 exim4 只允許 smtp 連線從 127.0.0.1 發送郵件。但同時也收到郵件。我對此感到困惑,因為如果我更改dc_local_interfaces
為127.0.0.1
,則無法接收郵件,但只允許 127.0.0.1,這正是我想要的。但是,我也想從網路上接收郵件,但它只允許 127.0.0.1 發送郵件。
我正在使用Ubuntu。但我認為這可能與 Ubuntu 並沒有真正的關係。
更新-exim4.conf.conf
# /etc/exim4/update-exim4.conf.conf
#
# Edit this file and /etc/mailname by hand and execute update-exim4.conf
# yourself or use 'dpkg-reconfigure exim4-config'
#
# Please note that this is _not_ a dpkg-conffile and that automatic changes
# to this file might happen. The code handling this will honor your local
# changes, so this is usually fine, but will break local schemes that mess
# around with multiple versions of the file.
#
# update-exim4.conf uses this file to determine variable values to generate
# exim configuration macros for the configuration file.
#
# Most settings found in here do have corresponding questions in the
# Debconf configuration, but not all of them.
#
# This is a Debian specific file
dc_eximconfig_configtype='internet'
dc_other_hostnames='mydomain.com'
dc_local_interfaces='0.0.0.0 ; ::0'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost=''
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname=''
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'
由於 stackexchange 字元限制,我無法發布 exim4.conf.template ,抱歉。
答案1
在預設的 exim4 配置中,此relay_from_hosts
清單會決定哪些主機可以從您的伺服器傳送郵件。請參閱進出口文件:
- 第 7 章 - 預設設定文件顯示典型用法。
- 第44章-存取控制列表,第 52 節 - 使用 ACL 控制中繼,顯示如何
relay_from_hosts
使用存取控制清單來控制中繼的詳細資訊。
答案2
我就是因為這個才換成postfix的。