我已经花了 2 个小时试图解决这个问题,现在我打算放弃并去睡觉了。我一直遇到 Gmail 拒绝来自我的 VPS 服务器的电子邮件的问题,因为错误的垃圾邮件警报(可能是由于 lfd 发送了太多电子邮件造成的)。
因此,我更改了 Exim 配置,从不同的 IP 发送电子邮件(我的 VPS 附带 3 个 IP),这解决了该问题。我还在我的域上启用了 DKIM 和 SPF 以增加措施。但现在,我的所有电子邮件都显示为(“发件人:发件人姓名 via server.domain1.com”),其中 server.domain1.com 是我的 VPS 主机名。我以前在 Outlook 中遇到过同样的问题,关闭“设置 SMTP 发件人:标头”解决了该问题。但我相信添加 DKIM 和 SPF 现在会让 Gmail 将“via server.domain1.com”添加到我的邮件中。我该如何解决这个问题?
这是邮件的典型标题(如在 Gmail 中显示的一样):
Delivered-To: [email protected]
Received: by 10.60.44.163 with SMTP id f3csp248622oem;
Thu, 29 Mar 2012 21:23:18 -0700 (PDT)
Received: by 10.50.106.200 with SMTP id gw8mr452788igb.10.1333081398523;
Thu, 29 Mar 2012 21:23:18 -0700 (PDT)
Return-Path: <[email protected]>
Received: from domain2.com ([X.X.X.X])
by mx.google.com with ESMTPS id y1si810998igb.3.2012.03.29.21.23.18
(version=TLSv1/SSLv3 cipher=OTHER);
Thu, 29 Mar 2012 21:23:18 -0700 (PDT)
Received-SPF: pass (google.com: domain of [email protected] designates X.X.X.X as permitted sender) client-ip=X.X.X.X;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of [email protected] designates X.X.X.X as permitted sender) [email protected]; dkim=pass [email protected]
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=server.domain1.com; s=default;
h=Date:Message-Id:From:Content-type:MIME-Version:Subject:To; bh=wF8bBRgh01EYg4t5DAeVPv1Ps906UVIeRnQCb/HvSYw=;
b=k/Pg7lnrO+Ud/z1mOTv+O/3DiJzzQgyBhfIizIaFHM8tF/eNJt5P2k+9yQB224sxYstZIWwVRBJmiqvcM1QhARv1HWqWma0crppZ3JOn+LRHANan634OBi+58SIRA+gu;
Received: (Exim 4.77)
id 1SDTVE-0005HA-9Y
for [email protected]; Fri, 30 Mar 2012 00:31:56 -0400
To: [email protected]
Subject: Password Reset Request
MIME-Version: 1.0
Content-type: text/html; charset=iso-8859-1
From: Sender Name <[email protected]>
Message-Id: <[email protected]>
Date: Fri, 30 Mar 2012 00:31:56 -0400
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - server.domain1.com
X-AntiAbuse: Original Domain - domain2.com
X-AntiAbuse: Originator/Caller UID/GID - [507 504] / [47 12]
X-AntiAbuse: Sender Address Domain - server.domain1.com
答案1
我在这里找到了答案: http://blog.tekipad.com/2009/11/exim-and-multiple-domains-php-mail-function-and-junk-mail-issue/
基本上,您需要在 PHP mail() 调用中添加第五个标头,内容如下:“-f[from_email_address]”
并且还向您的 exim 配置中添加一个新变量:trusted_users = [可以修改发送地址的用户 ID 列表(以冒号分隔)]
做到这两点就成功了。:)