Am încercat recent să configurez un server de poștă electronică, pentru a încerca să găzduiesc niște liste de discuții. Am adăugat înregistrările DMARC, DKIM și SPF între ele.
Recent, am văzut că se trimitea o mulțime de (spam) de pe serverul meu (coada a crescut la mii, cu e-mailuri trimise la atâtea e-mailuri aleatorii adrese). Este vreun fel în care pot permite mailmanului să trimită mesaje de pe serverul meu? Vreau să pot trimite e-mailuri către orice server, dar cred că numai procesul de trimitere ar trebui să fie mailman? Spuneți-mi dacă sunt vinovat că nu înțeleg cum funcționează.
Configurația mea aici:
# File /etc/exim4/conf.d/main/00_local_macros
DKIM_DOMAIN = lists.domain.name
DKIM_SELECTOR = default
DKIM_PRIVATE_KEY = /etc/exim4/dkim/privatekey.pem
DKIM_CANON = relaxed
#-------
# File /etc/exim4/conf.d/main/25_mm3_macros
domainlist mm3_domains=lists.domain.name
MM3_LMTP_HOST=172.25.195.2
MM3_LMTP_PORT=8024
MM3_HOME=/opt/mailman/core/var
################################################################
# The configuration below is boilerplate:
# you should not need to change it.
# The path to the list receipt (used as the required file when
# matching list addresses)
MM3_LISTCHK=MM3_HOME/lists/${local_part}.${domain}
# Place this file at
# /etc/exim4/conf.d/router/455_mm3_router
mailman3_router:
driver = accept
domains = +mm3_domains
require_files = MM3_LISTCHK
local_part_suffix_optional
local_part_suffix = -admin : \
-bounces : -bounces+* : \
-confirm : -confirm+* : \
-join : -leave : \
-owner : -request : \
-subscribe : -unsubscribe
transport = mailman3_transport
# Place this file at
#-------
# File /etc/exim4/conf.d/transport/55_mm3_transport
mailman3_transport:
debug_print = "Email for mailman"
driver = smtp
protocol = lmtp
allow_localhost
hosts = MM3_LMTP_HOST
port = MM3_LMTP_PORT
rcpt_include_affixes = true
#-------
# File /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=''
dc_local_interfaces='0.0.0.0 ; ::0'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets='0.0.0.0/0'
dc_smarthost=''
CFILEMODE='644'
dc_use_split_config='true'
dc_hide_mailname=''
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'
IGNORE_SMTP_LINE_LENGTH_LIMIT='true'
Și configurația mailman:
[mta]
incoming: mailman.mta.exim4.LMTP
outgoing: mailman.mta.deliver.deliver
lmtp_host: 172.25.195.2
lmtp_port: 8024
smtp_host: 172.25.195.4
smtp_port: 25
configuration: python:mailman.config.exim4
[mailman]
# This address is the "site owner" address. Certain messages which must be
# delivered to a human, but which can't be delivered to a list owner (e.g. a
# bounce from a list owner), will be sent to this address. It should point to
# a human.
site_owner: admin@domain.name
Эти dc_relay_nets='0.0.0.0/0'
позволяет реле от любого IP-адреса, делающего Ваш почтовый сервер открытое реле . Необходимо ограничить это внутренним / надежные сети.
SPF/DKIM/DMARC не защитит Вас от внутренних ошибок конфигурации. В худшем случае сервер DKIM подписывает несанкционированную почту. В конечном счете Ваш IP-адрес попадает в черный список.
Как указал Эса, здесь проблема dc_relay_nets
. Запустите dpkg-reconfigure exim4-config
, чтобы снова запустить мастер настройки и изменить значение, или отредактируйте файл и перезагрузите Exim, чтобы повторно обработать его в новый файл конфигурации Exim.
Exim имеет удобную команду exim4 -d -bh 1.2.3.4
, которая имитирует сеанс SMTP и подробно показывает, как обрабатываются ACL, в результате чего они принимаются для ретрансляции или локальной доставки или отклоняются. Это бесценный инструмент всякий раз, когда вы хотите спросить Exim "почему это разрешено" (или запрещено).