php邮件功能:合法邮件被gmail和hotmail标记为垃圾邮件

发布于 2024-09-25 19:18:04 字数 3111 浏览 0 评论 0原文

我的网站使用 PHP 邮件功能向用户发送电子邮件。 Hotmail 和 Gmail 用户不会收到它们,或者它们最终会进入垃圾邮件文件夹。以下是被 Gmail 标记为垃圾邮件的邮件的标头。

该怎么办?

Delivered-To: [email protected]
Received: by 10.216.213.222 with SMTP id a72cs207473wep;
        Sat, 2 Oct 2010 04:26:47 -0700 (PDT)
Received: by 10.216.3.19 with SMTP id 19mr3099233weg.108.1286018806068;
        Sat, 02 Oct 2010 04:26:46 -0700 (PDT)
Return-Path: <[email protected]>
Received: from drt01.dco.fusa.be (drt01.dco.fusa.be [193.110.251.55])
        by mx.google.com with ESMTP id m29si2837219weq.203.2010.10.02.04.26.45;
        Sat, 02 Oct 2010 04:26:46 -0700 (PDT)
Received-SPF: pass (google.com: best guess record for domain of [email protected] designates 193.110.251.55 as permitted sender) client-ip=193.110.251.55;
Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of [email protected] designates 193.110.251.55 as permitted sender) [email protected]
Received: from admin by drt01.dco.fusa.be with local (Exim 4.69)
    (envelope-from <[email protected]>)
    id 1P20En-000303-Lo
    for [email protected]; Sat, 02 Oct 2010 13:26:45 +0200
To: [email protected]
Subject: Koopte: zoekertje activeren
X-PHP-Script: www.koopte.be/confirmation.php for 213.118.179.121
From: Koopte <[email protected]> 
Reply-To:<[email protected]> 
Content-Type: text/html; charset=iso-8859-1
Message-Id: <[email protected]>
Sender:  <[email protected]>
Date: Sat, 02 Oct 2010 13:26:45 +0200

My website sends emails to users using the PHP mail function. Hotmail and Gmail users don't receive them, or they end up in SPAM-folder. Here is the header of a message marked as SPAM by Gmail.

What to do?

Delivered-To: [email protected]
Received: by 10.216.213.222 with SMTP id a72cs207473wep;
        Sat, 2 Oct 2010 04:26:47 -0700 (PDT)
Received: by 10.216.3.19 with SMTP id 19mr3099233weg.108.1286018806068;
        Sat, 02 Oct 2010 04:26:46 -0700 (PDT)
Return-Path: <[email protected]>
Received: from drt01.dco.fusa.be (drt01.dco.fusa.be [193.110.251.55])
        by mx.google.com with ESMTP id m29si2837219weq.203.2010.10.02.04.26.45;
        Sat, 02 Oct 2010 04:26:46 -0700 (PDT)
Received-SPF: pass (google.com: best guess record for domain of [email protected] designates 193.110.251.55 as permitted sender) client-ip=193.110.251.55;
Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of [email protected] designates 193.110.251.55 as permitted sender) [email protected]
Received: from admin by drt01.dco.fusa.be with local (Exim 4.69)
    (envelope-from <[email protected]>)
    id 1P20En-000303-Lo
    for [email protected]; Sat, 02 Oct 2010 13:26:45 +0200
To: [email protected]
Subject: Koopte: zoekertje activeren
X-PHP-Script: www.koopte.be/confirmation.php for 213.118.179.121
From: Koopte <[email protected]> 
Reply-To:<[email protected]> 
Content-Type: text/html; charset=iso-8859-1
Message-Id: <[email protected]>
Sender:  <[email protected]>
Date: Sat, 02 Oct 2010 13:26:45 +0200

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浅忆流年 2024-10-02 19:18:04

您的信封地址与发件人地址不匹配。
这是邮件被视为垃圾邮件的主要原因。

背景是:信封地址(在您的情况下 [email protected])对用户来说并不真正可见。
它只是被邮件服务器用来返回错误邮件。从历史上看,因为它们与管理员的相关性比与用户的相关性更大。
然而,今天它的事实上的标准是将信封地址设置为与用户地址相同。
垃圾邮件发送者实际上不会这样做,因为他们要么没有可能性,要么不想在发送垃圾邮件时收到所有退回的错误邮件。
或者他们不希望被木马蠕虫利用的用户意识到他们的邪恶行为。

在 php/sendmail 中,该函数称为 f 参数。
您可以在函数文档中阅读所有相关内容: http://php.net/manual/ en/function.mail.php

类似 phpmailer 或 libmail 自己做这件事,使用其中之一可能是最好的主意,因为它们已经过测试,设计良好,并对开发中的变化做出反应!

您可以做的下一件事是将反向 dns 设置为与发件人地址相同的域。
如果您这样做,您就真的非常值得信赖,因为邮件可以与服务器匹配,从而与提供商/管理员匹配,并且可以轻松地被垃圾邮件网络列入黑名单。
因此,如果您使用正确设置的反向 DNS 发送垃圾邮件,您不会做太久。
arpa 规则中有一个内置指令,此类条目的设置需要一段时间,因此无法以某种方式进行匿名化和利用。

然而,这是相当高级的,每个 IP 地址只能有一个反向 DNS 条目。因此您无法在共享托管环境中执行此操作。
您还必须联系您的提供商来设置它们,但您可以通过谷歌搜索所有这些内容。

总结:

  • 应该没问题
  • 更正你的信封地址,如果可以的话

,设置一个反向 dns 条目PS:没有真正的规则如何以及何时将邮件视为垃圾邮件,并且上述技术仅在实践中被证明有效,但有绝对不能保证。每个邮件提供商都可以做他想做的事......(雅虎是这些候选人之一,他们做自己的事情并在过去惹恼每个人)

祝你好运

Your envelope adress doesnt match the from adress.
This is the main reason why mails are regarded as spam.

The background is: The envelope adress (in your case [email protected]) isn't really visible to the user.
Its just used by mailservers to return error mails. Historically because they are more relevant to the admin than to the user.
However today its de-facto standard to set the envelope address to the same as the user address.
Spammers don't really do that because they either don't have the possibility to or they don't want to recieve all the backbouncing error mails when sending spam.
Or they don't want the exploited users with the trojan worm be aware of their evil-doing.

In php/sendmail this function is called the f parameter.
You can read all about that in the function documentation: http://php.net/manual/en/function.mail.php

Classes like phpmailer or libmail do this their selves and its probably the best idea to use one of theese because they have been tested, are well designed and react to changes in their developement!

The next thing you could do is to set the reverse-dns to the same domain that the sender adress is.
If you do this you are really, really trustworthy because the mail can be matched to a server and thus to a provbider/admin and could be easily blacklisted by spam networks.
So if you would spam with a correctly set up reverse dns you wouldnt do it long.
There is a built-in directive in arpa rulse that the set up of such an entry takes a while so it cant be made somehow danymically and exploited.

This is however rather advanced and there can only be one reverse dns entry per ip adress. So you can't do it on a shared hosting environment.
You also have to contact your provider to set them up but you can google for all that stuff.

Sum up:

  • correct your envelope adress, that should be fine
  • if you can, set a reverse dns entry

PS: there are not really rules how and when to regard a mail as spam and the teqniques above have only proven to work in praxis but there is absolutely no guarantee. Every mail provider can do what he wants... (yahoo was one of theese candidates to do their very own thing and to annoy everybody with it in the past)

good luck

秋心╮凉 2024-10-02 19:18:04

尝试使用谷歌应用程序并设置spf记录,进入设置->;安全性并设置 txt dkim 密钥。然后设置 mx 记录等。在您的域的子域(例如 int.domain.com)上执行所有这些操作,然后在登录 google 帐户后使用 smtp 从 phpmail 发送邮件,单击设置按钮右键,单击设置,php/imap,然后启用两者。

这对我来说总是有效,它们永远不会被标记为垃圾邮件,因为它们来自谷歌的服务器,并且具有有效的标头、返回路径、发件人、smtp、spf 记录、txt dkim 记录、mx 记录等。

尝试一下并让我知道如果有效的话:)

Try using google apps and setting up the spf record, going to setting -> security and setting up the txt dkim key. Then setup the mx records, etc. do all of this on a subdomain of your domain (eg, int.domain.com) and then use smtp to send the mail from phpmail after signing into the account in google, clicking the settings button on right, click settings, php/imap, and enabling both.

This always works for me and they never get marked as spam because they come from google's servers and have a valid header, return path, sender, smtp, spf record, txt dkim record, mx records, etc.

Try that out and let me know if it works :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文