Ubuntu

如何讓 exim4 拒絕其他 ip 使用伺服器發送郵件?

  • December 19, 2020

如何使 exim4 只允許 smtp 連接從 127.0.0.1 發送郵件。還能同時收到郵件。我對此感到困惑,因為如果我更改dc_local_interfaces127.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列表確定哪些主機可以從您的伺服器發送郵件。請參閱進出口文件:

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