来自 PHP mail() 的邮件未通过 Microsoft Exchange Online 服务器接收

来自 PHP mail() 的邮件未通过 Microsoft Exchange Online 服务器接收

我的一个朋友正在一个网站上运行联系表单,该网站通过 PHP mail() 函数发送电子邮件(使用的 CMS 是 Contao)。电子邮件毫无问题地发送给了其他收件人,因此 CMS 本身或负责发送的服务器都没有问题。但是,这些消息实际上应该发送到的两封电子邮件是通过 Exchange Online(Office 365)运行的。似乎有某种保护措施阻止了这些电子邮件。来自实际邮件客户端的所有其他电子邮件都会通过。我在 Exchange AC 中找不到与此相关的任何设置。

以下是来自联系表单消息的电子邮件标题(从联系表单发送一条消息到另一封电子邮件,同样,该消息可以正常接收):

Return-Path: <[email protected]>
Delivered-To: [email protected]
Received: from premium31.web-hosting.com
    by premium31.web-hosting.com with LMTP id UBwiOpOw0VsKMAwAmYe65g
    for <[email protected]>; Thu, 25 Oct 2018 08:01:23 -0400
Return-path: <[email protected]>
Envelope-to: [email protected]
Delivery-date: Thu, 25 Oct 2018 08:01:23 -0400
Received: from u230.lrnc.net ([77.232.241.23]:47206)
    by premium31.web-hosting.com with esmtp (Exim 4.91)
    (envelope-from <[email protected]>)
    id 1gFeKJ-003PuQ-PW
    for [email protected]; Thu, 25 Oct 2018 08:01:23 -0400
Received: by u230.lrnc.net (Postfix, from userid 10020)
    id 15D73C46B8; Thu, 25 Oct 2018 14:01:03 +0200 (CEST)
To: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Nachricht =?utf-8?Q?=C3=BCber?= die Webseite
Message-ID: <[email protected]>
Date: Thu, 25 Oct 2018 12:01:02 +0000
From: [email protected]
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Priority: 3 (Normal)
X-Mailer: Contao Open Source CMS

有人能指出我问题可能出在哪里吗?

答案1

我验证了您的电子邮件是否被域上的 SPF 记录允许。我使用 Pythonspf模块来执行此操作。结果如下:

>>> import spf
>>> spf.query('77.232.241.23', '[email protected]', 'u230.lrnc.net').check()
('fail', 550, 'SPF fail - not authorized')
>>> 

正如您使用电子邮件标头中的信息所看到的,该电子邮件将被验证 SPF 的发件人拒绝。77.232.241.23不允许从域发送电子邮件rechtsanwaelte-brauer.de

更改您的 SPF 记录

v=spf1 include:spf.protection.outlook.com -all

v=spf1 ip4:77.232.241.23 include:spf.protection.outlook.com -all

应该有帮助。记得找出你的 IPv6 地址,并将其也包括在内。

相关内容