You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Debian搭建邮件服务器时子域名myhostname.mydomain.net的SPF记录无法被识别的问题排查求助

Debian搭建邮件服务器时子域名myhostname.mydomain.net的SPF记录无法被识别的问题排查求助

大家好,我目前正在Debian上搭建邮件服务器,已经完成了不少配置,但卡在了SPF记录的问题上,想请大家帮忙找找问题出在哪。

目前的进展:

  • 已经安装了postfix和opendkim
  • 配置了FQDN、rDNS、DKIM、DMARC和SPF,其中主域名mydomain.net的SPF记录在在线测试中能被正常识别,但发送邮件的子域名myhostname.mydomain.net的SPF却无法被识别
  • DKIM和DMARC的测试都没问题,myhostname.mydomain.net也配置了A/AAAA记录和MX记录
  • 用mail命令发送邮件一切正常,邮件能正常送达,不会进入垃圾文件夹

相关配置信息:

  1. /etc/hosts中的FQDN配置:
127.0.1.1    myhostname.mydomain.net myhostname
  1. 主域名的SPF TXT记录:
v=spf1 mx a:myhostname.mydomain.net -all
  1. /etc/postfix/main.cf的完整配置:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.

myhostname = myhostname.mydomain.net

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)

biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

myorigin = /etc/mailname

mydestination = $myhostname

relayhost =

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128

mailbox_size_limit = 0

recipient_delimiter = +

inet_interfaces = all

inet_protocols = all

# Milter configuration
milter_default_action = accept
milter_protocol = 6
smtpd_milters = local:opendkim/opendkim.sock
non_smtpd_milters = $smtpd_milters
  1. DKIM密钥是为主域名mydomain.net生成的,测试正常;DMARC TXT记录:
v=DMARC1; p=reject; rua=mailto:dmarc@mydomain.net; fo=1

我实在想不通哪里出问题了,有没有大佬能指点一下我忽略了什么?

备注:内容来源于stack exchange,提问作者St4rb0y

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.23 13:37:47