如何使 exim4 只允许 smtp 连接从 127.0.0.1 发送邮件。还能同时收到邮件。我对此感到困惑,因为如果我更改dc_local_interfaces
为127.0.0.1
,它无法接收邮件,而只允许 127.0.0.1,这正是我想要的。但是,我也想从 Internet 接收邮件,而它只允许 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'
我无法发布 exim4.conf.template 因为 stackexchange 字符限制抱歉。
在默认的 exim4 配置中,该
relay_from_hosts
列表确定哪些主机可以从您的服务器发送邮件。请参阅进出口文档:relay_from_hosts
使用访问控制列表控制中继。因为这个,我才改成后缀。