新配置的电子邮件服务器,Postfix、Dovecot、MariaDB、Rspamd 和 Redis 是主要组件,在 Arch 上无法发送或接收邮件

新配置的电子邮件服务器,Postfix、Dovecot、MariaDB、Rspamd 和 Redis 是主要组件,在 Arch 上无法发送或接收邮件

Dovecot 在尝试发送(通过 T'bird)时报告登录。其中一个在线电子邮件测试网站报告: Server 'HELO' line: 220-mail.mydomain.tld ESMTP Postfix因此我们知道 SMTP 服务已准备就绪,但接下来是: Warning: Expected on ESMTP return code of '250' capabilities code in response to our 'EHLO'. Got '' 从外部地址向内发送电子邮件只会在发送方端收到“连接被拒绝”的消息,服务器上不会有任何响应或日志条目。

Systemctl status postfix.service显示 Postfix 正在运行,但抱怨无法连接到 127.0.0.1:11332: fatal: host/service localhost/11332 not found: Device or resource busy

我不知道这是 Postfix、Rspamd、Redis 还是防火墙的问题,甚至不知道这是否是由于拼写错误(例如漏掉了分号、括号或引号)导致的,我没能找到。vmail 数据库看起来完好无损,Dovecot 显然正在接受本地注册用户。

因此我需要知道如何查找此问题,即查看什么以及按什么顺序查看。我已经阅读了我安装的文件、Rspamd 和 Redis 的文档,但不知道下一步该怎么做。

以下是 postconf -n 和 postconf -M 的输出:

append_dot_mydomain = no
biff = no
bounce_queue_lifetime = 1h
inet_interfaces = 127.0.0.1, ::1, xxx.xxx.xxx.xx, xxxx:xxx:xx:xxxx::2
local_recipient_maps = $virtual_mailbox_maps
mailbox_size_limit = 0
maximal_backoff_time = 15m
maximal_queue_lifetime = 1h
message_size_limit = 52428800
milter_default_action = accept
milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen}
milter_protocol = 6
minimal_backoff_time = 5m
mua_client_restrictions = permit_mynetworks,permit_sasl_authenticated,reject
mua_relay_restrictions = reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_mynetworks,permit_sasl_authenticated,reject
mua_sender_restrictions = permit_mynetworks,reject_non_fqdn_sender,reject_sender_login_mismatch,permit_sasl_authenticated,reject
myhostname = mail.dominame.net
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
non_smtpd_milters = inet:localhost:11332
postscreen_access_list = permit_mynetworks cidr:/etc/postfix/postscreen_access
postscreen_blacklist_action = drop
postscreen_dnsbl_action = drop
postscreen_dnsbl_sites = ix.dnsbl.manitu.net*2 zen.spamhaus.org*2
postscreen_dnsbl_threshold = 2
postscreen_greet_action = drop
queue_run_delay = 5m
recipient_delimiter = +
smtp_dns_support_level = dnssec
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_tls_ciphers = high
smtp_tls_policy_maps = mysql:/etc/postfix/sql/tls-policy.cf
smtp_tls_protocols = !SSLv2, !SSLv3
smtp_tls_security_level = dane
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_client_restrictions = permit_mynetworks check_client_access hash:/etc/postfix/without_ptr reject_unknown_client_hostname
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks reject_invalid_helo_hostname reject_non_fqdn_helo_hostname reject_unknown_helo_hostname
smtpd_milters = inet:localhost:11332
smtpd_recipient_restrictions = check_recipient_access mysql:/etc/postfix/sql/recipient-access.cf
smtpd_relay_restrictions = reject_non_fqdn_recipient reject_unknown_recipient_domain permit_mynetworks reject_unauth_destination
smtpd_tls_cert_file = /etc/letsencrypt/live/mail.xxxxxxxx.xxx/fullchain.pem
smtpd_tls_ciphers = high
smtpd_tls_key_file = /etc/letsencrypt/live/mail.xxxxxxxx.xxx/privkey.pem
smtpd_tls_protocols = !SSLv2, !SSLv3
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
tls_high_cipherlist = EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA256:EECDH:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!IDEA:!ECDSA:kEDH:CAMELLIA128-SHA:AES128-SHA
tls_preempt_cipherlist = yes
tls_ssl_options = NO_COMPRESSION
virtual_alias_maps = mysql:/etc/postfix/sql/aliases.cf
virtual_mailbox_domains = mysql:/etc/postfix/sql/domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/sql/accounts.cf
virtual_transport = lmtp:unix:private/dovecot-lmtp
[root@hostname ~]# 
smtp       inet  n       -       y       -       1       postscreen -o smtpd_sasl_auth_enable=no
smtpd      pass  -       -       y       -       -       smtpd
dnsblog    unix  -       -       y       -       0       dnsblog
tlsproxy   unix  -       -       y       -       0       tlsproxy
submission inet  n       -       y       -       -       smtpd -o syslog_name=postfix/submission -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes -o smtpd_sasl_type=dovecot -o smtpd_sasl_path=private/auth -o smtpd_sasl_security_options=noanonymous -o smtpd_client_restrictions=$mua_client_restrictions -o smtpd_sender_restrictions=$mua_sender_restrictions -o smtpd_relay_restrictions=$mua_relay_restrictions -o milter_macro_daemon_name=ORIGINATING -o smtpd_sender_login_maps=mysql:/etc/postfix/sql/sender-login-maps.cf -o smtpd_helo_required=no -o smtpd_helo_restrictions= -o cleanup_service_name=submission-header-cleanup
pickup     unix  n       -       y       60      1       pickup
cleanup    unix  n       -       y       -       0       cleanup
qmgr       unix  n       -       n       300     1       qmgr
tlsmgr     unix  -       -       y       1000?   1       tlsmgr
rewrite    unix  -       -       y       -       -       trivial-rewrite
bounce     unix  -       -       y       -       0       bounce
defer      unix  -       -       y       -       0       bounce
trace      unix  -       -       y       -       0       bounce
verify     unix  -       -       y       -       1       verify
flush      unix  n       -       y       1000?   0       flush
proxymap   unix  -       -       n       -       -       proxymap
proxywrite unix  -       -       n       -       1       proxymap
smtp       unix  -       -       y       -       -       smtp
relay      unix  -       -       y       -       -       smtp
showq      unix  n       -       y       -       -       showq
error      unix  -       -       y       -       -       error
retry      unix  -       -       y       -       -       error
discard    unix  -       -       y       -       -       discard
local      unix  -       n       n       -       -       local
virtual    unix  -       n       n       -       -       virtual
lmtp       unix  -       -       y       -       -       lmtp
anvil      unix  -       -       y       -       1       anvil
scache     unix  -       -       y       -       1       scache
submission-header-cleanup unix n - n     -       0       cleanup -o header_checks=regexp:/etc/postfix/submission_header_cleanup

我曾尝试从 Thomas Leister 在 Debian Stretch 上出色的电子邮件服务器转录此电子邮件服务器,该服务器我在 Debian 的其他地方成功运行过。Arch 的工作方式有些不同,但有些关键。

Linux mail 5.5.13-arch2-1 #1 SMP PREEMPT Mon, 30 Mar 2020 20:42:41 +0000 x86_64 GNU/Linux
~]# cat /etc/*release*   
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="0;36"
HOME_URL="https://www.archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
LOGO=archlinux```

答案1

我认为您有端口冲突。

让我们从基础开始,然后深入研究可能存在的问题...

1. Do a port  scan ( using nmap - install if you dont have it )  
   on the localhost 

   # nmap -v localhost -p1-9999

2. Do a port scan from the LAN

   # nmap -v ip.address.of.server -p1-9999

以上内容将告诉您是否所有应该打开的端口都已打开,以及您没有防火墙配置问题或程序具有冲突的端口。

下一个,

3. Check the logs of the services that  you are running. 
   That will shed more light on the issue.

此外,如果您能向我们提供下面命令的结果(来自终端),那将会很有帮助。

4. cat /etc/*release*   
5. uname -a      

以上内容将让我们了解您正在运行什么操作系统,以及是否存在您可能需要调查的操作系统特定问题。

如果以上方法没有给出任何线索,那么我建议一次运行一项服务 - 先让该服务运行,然后再添加另一项服务。这将帮助我们了解哪项服务是触发因素。

答案2

@davidgo 指出了前进的方向,这正是我所寻找的。我以为一旦跨过这个最初的障碍,就会出现更多错误。答案是注释掉 milter 语句,我在 main.cf 中找到了它。

注释掉两行之后/etc/postfix/main.cf, smtpd_milters = inet:localhost:11332non_smtpd_milters = inet:localhost:11332我确实能够看到更多信息丰富的日记回复,并且开始收到退回报告,这也是指示性的。

我已经发现了几个错误,我可以在不需要进一步帮助的情况下修复它们,有些错误我只要读一下就可以修复,因为它们看起来很简单,但我已经有点生疏了。我怀疑我还会发现其他错误,可能不得不带着一个或多个新问题回来。

相关内容