gpt4 book ai didi

email - 即使定义了 SPF 记录,也始终获得无(无 SPF 记录)

转载 作者:行者123 更新时间:2023-12-05 07:24:16 27 4
gpt4 key购买 nike

我正在尝试为我的域创建一个 SPF 记录并使我的邮件服务器能够对其进行评估。我在邮件服务器上使用 Postfix 并使用 policyd-spf (Python) 来评估记录。目前,我通过我的私有(private) DNS 服务器为我的域发布了 SPF 记录,您可以使用 nslookup 命令在服务器上查看该记录。

我目前遇到的问题是,无论我发布的 SPF 记录如何,policyd-spf 都会在电子邮件 header 中返回“无(无 SPF 记录)”。我正在寻找通过或失败的结果,以便我可以相应地修复记录,但此时似乎根本没有对其进行评估。任何帮助将不胜感激!

我已经尝试以几种不同的格式(如下所示)为 web1 和 mail.example.com 发布几条不同的记录(在不同的时间),但我认为这是一个配置问题。 IP地址“XXX.XX.XX.XXX”指向“web1”主机,地址“YYY.YY.YY.YY”指向“mail.example.com”主机,也就是邮件服务器。

mail.example.com. IN TXT "v=spf1 include:mail.example.com -all"

mail.example.com. IN TXT "v=spf2.0/pra include:mail.example.com -all"

mail.example.com. IN TXT "v=spf1 a ip4:XXX.XX.XX.XXX -all"

mail.example.com. IN TXT "v=spf2.0/pra a ip4:XXX.XX.XX.XXX -all"

example.com. IN TXT "v=spf1 -all"

mail.example.com. IN TXT "v=spf1 a include:web1 -all"

mail.example.com. IN TXT "v=spf1 a ip4:YYY.YY.YY.YY -all"

这是我尝试发送电子邮件时的日志输出:

Apr  5 09:17:33 mail postfix/smtpd[9114]: connect from web1[XXX.XX.XX.XXX]
Apr 5 09:17:33 mail policyd-spf[9119]: Starting
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "request=smtpd_access_policy"
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "protocol_state=RCPT"
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "protocol_name=ESMTP"
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "client_address=XXX.XX.XX.XXX"
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "client_name=web1"
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "reverse_client_name=web1"
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "helo_name=web1"
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "sender=noreply@mail.example.com"
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "recipient=bowser@mail.example.com"
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "recipient_count=0"
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "queue_id="
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "instance=239a.5ca7556d.9e4db.0"
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "size=0"
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "etrn_domain="
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "stress="
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "sasl_method="
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "sasl_username="
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "sasl_sender="
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "ccert_subject="
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "ccert_issuer="
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "ccert_fingerprint="
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "encryption_protocol="
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "encryption_cipher="
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: "encryption_keysize=0"
Apr 5 09:17:33 mail policyd-spf[9119]: Read line: ""
Apr 5 09:17:33 mail policyd-spf[9119]: Found the end of entry
Apr 5 09:17:33 mail policyd-spf[9119]: Config: {'Mail_From_reject': 'Fail', 'Void_Limit': 2, 'Lookup_Time': 20, 'HELO_reject': 'Fail', 'Header_Type': 'SPF', 'defaultSeedOnly': 1, 'PermError_reject': 'False', 'debugLevel': 4, 'skip_addresses': '127.0.0.0/8,::ffff:127.0.0.0/104,::1', 'TempError_Defer': 'False'}
Apr 5 09:17:33 mail policyd-spf[9119]: Cached data for this instance: []
Apr 5 09:17:43 mail policyd-spf[9119]: spfcheck: pyspf result: "['None', '', 'helo']"
Apr 5 09:17:43 mail policyd-spf[9119]: None; identity=helo; client-ip=XXX.XX.XX.XXX; helo=web1; envelope-from=noreply@mail.example.com; receiver=bowser@mail.example.com
Apr 5 09:17:43 mail policyd-spf[9119]: Header type: SPF; Authres ID (for AR): None
Apr 5 09:17:43 mail policyd-spf[9119]: spfcheck: pyspf result: "['None', '', 'mailfrom']"
Apr 5 09:17:43 mail policyd-spf[9119]: None; identity=mailfrom; client-ip=XXX.XX.XX.XXX; helo=web1; envelope-from=noreply@mail.example.com; receiver=bowser@mail.example.com
Apr 5 09:17:43 mail policyd-spf[9119]: Header type: SPF; Authres ID (for AR): None
Apr 5 09:17:43 mail policyd-spf[9119]: Action: prepend: Text: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=XXX.XX.XX.XXX; helo=web1; envelope-from=noreply@mail.example.com; receiver=bowser@mail.example.com
Apr 5 09:17:43 mail postfix/smtpd[9114]: CBCB723ADE: client=web1[XXX.XX.XX.XXX]
Apr 5 09:17:43 mail postfix/cleanup[9133]: CBCB723ADE: message-id=<310009219.518.1554470379582@web1>
Apr 5 09:17:43 mail postfix/qmgr[9111]: CBCB723ADE: from=<noreply@mail.example.com>, size=3718, nrcpt=1 (queue active)
Apr 5 09:17:43 mail postfix/smtpd[9114]: disconnect from web1[XXX.XX.XX.XXX]
Apr 5 09:17:43 mail postfix/local[9134]: CBCB723ADE: to=<bowser@mail.example.com>, relay=local, delay=10, delays=10/0.01/0/0.02, dsn=2.0.0, status=sent (delivered to maildir)
Apr 5 09:17:43 mail postfix/qmgr[9111]: CBCB723ADE: removed

这是我的 postconf -n 输出:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $mydomain, $myhostname, localhost.$mydomain, localhost
mydomain = example.com
myhostname = mail.example.com
mynetworks = YYY.YY.YY.YY, 127.0.0.0/8 [::1]/128
mynetworks_style = subnet
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_client_restrictions = check_client_access hash:/etc/postfix/access
smtpd_recipient_restrictions = check_policy_service unix:private/policyd-spf, permit_sasl_authenticated, reject_unauth_destination, warn_if_reject
unknown_local_recipient_reject_code = 550

这是我的 policyd-spf.conf 文件:

#  For a fully commented sample config file see policyd-spf.conf.commented

debugLevel = 4
defaultSeedOnly = 1

HELO_reject = Fail
Mail_From_reject = Fail

PermError_reject = False
TempError_Defer = False

skip_addresses = 127.0.0.0/8,::ffff:127.0.0.0/104,::1

最佳答案

  1. 我是 spf 的新手,但第一行创建了一个无限循环,因为它包含了自己。

mail.example.com. IN TXT "v=spf1 include:mail.example.com -all"

  1. 我很好奇:

    包括:web1

web1 不是 FQDN 但包含必须是 FQDN IIRC?

PS:更多人会找到您的帖子,因此请发布您的解决方案或将其删除,以便人们找到有用的信息而不是孤立的问题

关于email - 即使定义了 SPF 记录,也始终获得无(无 SPF 记录),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55537712/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com