我在Linode服务器上使用phpMailer。 DNS记录设置为允许通过gmail邮件服务器发送邮件,该服务器正在存放我的邮件帐户Membership@oiyc.org。我刚刚添加了DKIM,以尝试提高SPF等级。 DKIM显然不错,但我仍然可以使用SPF中性。

发件人设置为:

        $mail = new PHPMailer();
        $mail->isSMTP();
        $mail->SMTPKeepAlive = true;
        $mail->SMTPAuth   = true;
        $mail->SMTPSecure = "tls";                 // sets the prefix to the server
        $mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
        $mail->Port       = 587;                   // set the SMTP port
        $mail->Username   = "membership@oiyc.org";  // GMAIL username
        $mail->Password   = "*******************";            // GMAIL password
        $mail->isHTML(true); // send as HTML
        $mail->WordWrap   = 100; // set word wrap
        $mail->Sender = "membership@oiyc.org";
        $mail->addReplyTo($_SESSION['se-reply'],$_SESSION['se-from']);
        $mail->setFrom($_SESSION['se-reply'],$_SESSION['se-from']);

        $mail->DKIM_domain = "oiyc.org";
        $mail->DKIM_private = "*********/rsa.private"; //path to file on the disk.
        $mail->DKIM_selector = "mainkey";// change this to whatever you set during step 2
        $mail->DKIM_passphrase = "";
        $mail->DKIM_identity = $mail->Sender;

这是从通过我的linode服务器发送的电子邮件中收到的来源。
            Delivered-To: ********@gmail.com
            Received: by 10.46.25.85 with SMTP id p82csp1388830lje;
                Sun, 4 Feb 2018 11:11:56 -0800 (PST)
            X-Received: by 10.98.196.204 with SMTP id h73mr11556131pfk.143.1517771515865;
                Sun, 04 Feb 2018 11:11:55 -0800 (PST)
            ARC-Seal: i=1; a=rsa-sha256; t=1517771515; cv=none;
                d=google.com; s=arc-20160816;
                b=*****
                qrIA==
            ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
                h=content-transfer-encoding:mime-version:list-unsubscribe:message-id
                :subject:reply-to:to:date:from:dkim-signature
                :arc-authentication-results;
                bh=ptVvqh2PiSco0+Kb7wjBXHUijnbEm43LU4E+zStVvb0=;
                b=********
                iuTg==
            ARC-Authentication-Results: i=1; mx.google.com;
                dkim=pass header.i=@oiyc-org.20150623.gappssmtp.com header.s=20150623 header.b=ytsz7YWm;
                spf=neutral (google.com: 209.85.220.41 is neither permitted nor denied by best guess record for domain of membership@oiyc.org) smtp.mailfrom=membership@oiyc.org
            Return-Path: <membership@oiyc.org>
            Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
                by mx.google.com with SMTPS id i3sor1037208pgs.91.2018.02.04.11.11.55
                for <********@gmail.com>
                (Google Transport Security);
                Sun, 04 Feb 2018 11:11:55 -0800 (PST)
            Received-SPF: neutral (google.com: 209.85.220.41 is neither permitted nor denied by best guess record for domain of membership@oiyc.org) client-ip=209.85.220.41;
            Authentication-Results: mx.google.com;
                dkim=pass header.i=@oiyc-org.20150623.gappssmtp.com header.s=20150623 header.b=ytsz7YWm;
                spf=neutral (google.com: 209.85.220.41 is neither permitted nor denied by best guess record for domain of membership@oiyc.org) smtp.mailfrom=membership@oiyc.org
            DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
                d=oiyc-org.20150623.gappssmtp.com; s=20150623;
                h=from:date:to:reply-to:subject:message-id:list-unsubscribe
                :mime-version:content-transfer-encoding;
                bh=ptVvqh2PiSco0+Kb7wjBXHUijnbEm43LU4E+zStVvb0=;
                b=*********
            SsBA==
            X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
                d=1e100.net; s=20161025;
                h=x-gm-message-state:from:date:to:reply-to:subject:message-id
                :list-unsubscribe:mime-version:content-transfer-encoding;
                bh=ptVvqh2PiSco0+Kb7wjBXHUijnbEm43LU4E+zStVvb0=;
                b=*************
                r+zA==
            X-Gm-Message-State: AKwxytcQCxD/95gmJfS/DyCC4XOh8K3K+Jj9QONeHmVyCH5ebJDtxvIl tQwyBjpS9etVQopYODbtnZZ2Kw0k1Pc=
            X-Google-Smtp-Source: AH8x227kdTn+9Ee7QoJFUYDPq/ax7LmKHzsDAtCNr/5cL0MidmAB3GWuEw4RU28Zb3jl8Kx0uAnegw==
            X-Received: by 10.99.96.80 with SMTP id u77mr6305435pgb.401.1517771515191;
            Sun, 04 Feb 2018 11:11:55 -0800 (PST)
            Return-Path: <membership@oiyc.org>
            Received: from oiyc.org ([2600:3c01::f03c:91ff:fe56:5129])
                by smtp.gmail.com with ESMTPSA id m65sm14046167pfc.150.2018.02.04.11.11.54
                for <********@gmail.com>
                (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
                Sun, 04 Feb 2018 11:11:54 -0800 (PST)
            From: Bob Brunius <membership@oiyc.org>
            X-Google-Original-From: Bob Brunius <********@gmail.com>
            Date: Sun, 4 Feb 2018 11:11:53 -0800
            To: ********@gmail.com
            Reply-To: Bob Brunius <********@gmail.com>
            Subject: A different sort of test 123d
            Message-ID: <MR3sDgtyN4siuc2vYCZLxL34VuLFlexvK0WbbcEH7FA@oiyc.org>
            X-Mailer: PHPMailer 6.0.3 (https://github.com/PHPMailer/PHPMailer)
            List-Unsubscribe: <information@oiyc.org>, <https://oiyc.org/membershipDatabaseForms/unsubscribe.php?email=********@gmail.com&member=242>
            MIME-Version: 1.0
            Content-Type: multipart/alternative; boundary="b1_MR3sDgtyN4siuc2vYCZLxL34VuLFlexvK0WbbcEH7FA"
            Content-Transfer-Encoding: 8bit

            --b1_MR3sDgtyN4siuc2vYCZLxL34VuLFlexvK0WbbcEH7FA
            Content-Type: text/plain; charset=us-ascii

            Hello 12345678-abcd

            --b1_MR3sDgtyN4siuc2vYCZLxL34VuLFlexvK0WbbcEH7FA
            Content-Type: text/html; charset=us-ascii

            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
            <html>
            <body>
            Hello 12345678-abcd
            </body>
            </html>
            --b1_MR3sDgtyN4siuc2vYCZLxL34VuLFlexvK0WbbcEH7FA--

最佳答案

目前,您的SPF记录在DNS中的发布方式为...
“v = spf1 include:_spf.google.com include:oiyc.org〜all”
其中的包括:oiyc.org 递归引用自己。从技术上讲这是不正确的,但是如果满足上述机制 include:_spf.google.com 并将结果返回到SPF查询,则可能会奇怪。之后 include:oiyc.org 机制将导致查找失败,因此〜所有机制将永远不会被处理。
包括:机制旨在引用外部发布的SPF详细信息集,通常在不同的域中。
我怀疑您打算引用您自己的域的IP地址,大概在DNS中将其定义为裸域名的 记录,在这种情况下,我们将使用机制a:oiyc.org ,该机制本身可以是缩短为
因此,您产生的TXT记录可能类似于...
“v = spf1 include:_spf.google.com〜all”

关于email - SPF =通过Gmail中立发送,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/48612282/

10-15 02:27