我需要使用PHP处理一些被退回的邮件。浏览电子邮件没有问题,但是投入资源编写我们自己的库来解析收到的电子邮件是非常不可取的。
有3个PHP解决方案,我已经发现,应该是处理反弹的邮件,但他们都过时了,不再维护,从我可以看到。(PHPList, PHPMailer-BMH, Bounce Handler @ PHPClasses.org)
有谁知道处理被退回的电子邮件的最新规则吗?我不一定需要任何处理逻辑,即使只是一个最新的规则集也会令人满意。
谢谢你的帮助。
反弹处理是不平凡的,因为你需要处理很多不同的服务器和响应。这包括那些服务器配置错误和反弹,因为你的电子邮件/主机/IP已被列入黑名单/垃圾邮件得分。因为"不在办公室"有很多反弹自动回复。
我知道的一个简单的解决方案是将自己的头放入消息中,以标识接收方地址和具体的发送(令牌)。当它反弹时,可以根据此来验证反弹。
另一种解决方案是将附加信息编码到发送方地址中,并相应地解析它是否有反弹。为此,你需要知道电子邮件是如何工作的,这通常是有用的,如果你需要与反弹。
- 弹跳邮件处理与PHP?
- 解析SMTP日志的工具,查找反弹
- 如何在不发送邮件的情况下检查电子邮件地址是否存在?
- 指定电子邮件的回弹地址
一般的观点是,我不知道很多基于PHP的工具来处理反弹,我知道PHPList (PHP组件的邮件列表处理)有一些在他们的仓库:
- 处理反弹的设置(上次有效快照)(最新等效: Bounce Management - PHPList Manual)
编辑:与信息丰富的答案相关的问题是:
- 如何每周发送10万封邮件?
编辑:内容不多,只是一些链接:
我想知道为什么没有标准的电子邮件反弹,让你很容易地识别反弹和反弹的原因-或者有吗?(如RFC)
有RFC3834 -自动响应电子邮件的建议,由RFC5436筛选通知机制:mailto.
更新。弹跳在RFC5321简单邮件传输协议中也有部分讨论,它清楚地给出了MTA在消息无法传递时必须报告的原因。
主要问题是在SMTP中无法验证反弹地址(发件人),因此发送反弹消息的问题可能会被错误的人接收(反向散射垃圾邮件)。
因此,可靠的邮件发送器不仅会检查是否有反弹,还会对SMTP做更多的工作以获得一定的质量水平,参见:
- 反弹地址标签验证(BATV)
- 发件人策略框架(SPF)
对于第一次看到这张照片的人来说,维基百科上关于未交付报告的整个页面可能很有趣。
我以前是这样做的。它可以持续捕获至少70%以上的反弹邮件。
在发送的电子邮件中,放入自定义标题(如"x-email-check-id"),以便为每个发送的电子邮件提供唯一标识符(可能创建GUID并将其存储在每个电子邮件的数据库中)
在服务器端,编写一个cron作业,定期从反弹地址下载电子邮件,并在回复消息中查找此头。这样,您就可以将退回的邮件与发出的电子邮件相匹配。这样,您就可以确定此电子邮件是被您发送的邮件退回的,而不是垃圾邮件。
之后,在邮件内容中搜索特定的关键词,以确定反弹的原因。这个关键字列表应该经常更新,因为新的电子邮件服务器返回不同的文本。但这是我使用的列表。
$Email__Full[] = 'databytes limit';
$Email__Full[] = 'exceeded dropfile size';
$Email__Full[] = 'exceeded email quota';
$Email__Full[] = 'exceeded storage';
$Email__Full[] = 'exceeding receiving limits';
$Email__Full[] = 'exceeds the maximum size';
$Email__Full[] = 'folder is full';
$Email__Full[] = 'mail system full';
$Email__Full[] = 'mailbox exceeds allowed size';
$Email__Full[] = 'mailbox full';
$Email__Full[] = 'mailbox has exceeded the limit';
$Email__Full[] = 'mailbox is full';
$Email__Full[] = 'mail box full';
$Email__Full[] = 'out of disk space';
$Email__Full[] = 'out of diskspace';
$Email__Full[] = 'over disk quota';
$Email__Full[] = 'over quota';
$Email__Full[] = 'over the allowed quota';
$Email__Full[] = 'problem with the recipient's mailbox';
$Email__Full[] = 'quota exceeded';
$Email__Full[] = 'quota violation';
$Email__Full[] = 'space has been used up';
$Email__Full[] = 'space not enough';
$Email__Full[] = 'status: 5.2.1';
$Email__Full[] = 'status: 5.2.2';
$Email__Full[] = 'status: 5.2.3';
$Email__Full[] = 'status: 5.3.3';
$Email__NotExist[] = '/var/mail/nobody';
$Email__NotExist[] = '550 5.1.1';
$Email__NotExist[] = 'account expired';
$Email__NotExist[] = 'account inactive';
$Email__NotExist[] = 'account suspended';
$Email__NotExist[] = 'address is administratively disabled';
$Email__NotExist[] = 'address is not recognized';
$Email__NotExist[] = 'address is rejected';
$Email__NotExist[] = 'address not recognized';
$Email__NotExist[] = 'address rejected';
$Email__NotExist[] = 'bad destination email address';
$Email__NotExist[] = 'cname lookup failed';
$Email__NotExist[] = 'connection refused';
$Email__NotExist[] = 'couldn't find any host';
$Email__NotExist[] = 'could not be found';
$Email__NotExist[] = 'deactivated mailbox';
$Email__NotExist[] = 'delivery time expired';
$Email__NotExist[] = 'destination server not responding';
$Email__NotExist[] = 'disabled or discontinued';
$Email__NotExist[] = 'does not exist';
$Email__NotExist[] = 'does not like recipient';
$Email__NotExist[] = 'doesn't have a yahoo.com account';
$Email__NotExist[] = 'doesn't have a yahoo.com.sg account';
$Email__NotExist[] = 'domain is for sale';
$Email__NotExist[] = 'find a mail exchanger';
$Email__NotExist[] = 'find any host named';
$Email__NotExist[] = 'following address(es) failed';
$Email__NotExist[] = 'host unknown';
$Email__NotExist[] = 'i couldn't find any host by that name';
$Email__NotExist[] = 'illegal user';
$Email__NotExist[] = 'in the queue too long';
$Email__NotExist[] = 'inactive recipient';
$Email__NotExist[] = 'inactive user';
$Email__NotExist[] = 'incorrectly addressed';
$Email__NotExist[] = 'invalid recipient';
$Email__NotExist[] = 'invalid user';
$Email__NotExist[] = 'isn't in my control/locals file';
$Email__NotExist[] = 'mailbox not available';
$Email__NotExist[] = 'mailbox not found';
$Email__NotExist[] = 'mailbox unavailable';
$Email__NotExist[] = 'mail is looping';
$Email__NotExist[] = 'message is looping';
$Email__NotExist[] = 'name is not recognized';
$Email__NotExist[] = 'name not found';
$Email__NotExist[] = 'name not recognized';
$Email__NotExist[] = 'no local mailbox';
$Email__NotExist[] = 'no longer accepts mail';
$Email__NotExist[] = 'no longer an employee';
$Email__NotExist[] = 'no longer on server';
$Email__NotExist[] = 'no longer valid';
$Email__NotExist[] = 'no mailbox';
$Email__NotExist[] = 'no route found to domain';
$Email__NotExist[] = 'no such user';
$Email__NotExist[] = 'none of the mail servers for the destination domain has so far responded';
$Email__NotExist[] = 'no valid host';
$Email__NotExist[] = 'no valid recipients';
$Email__NotExist[] = 'not a valid mailbox';
$Email__NotExist[] = 'not listed';
$Email__NotExist[] = 'not listed in domino';
$Email__NotExist[] = 'possible mail loop';
$Email__NotExist[] = 'recipient cannot be verified';
$Email__NotExist[] = 'recipient unknown';
$Email__NotExist[] = 'recipients are invalid';
$Email__NotExist[] = 'recipnotfound';
$Email__NotExist[] = 'relaying denied';
$Email__NotExist[] = 'several matches found in domino';
$Email__NotExist[] = 'status: 5.1.1';
$Email__NotExist[] = 'status: 5.1.3';
$Email__NotExist[] = 'status: 5.1.4';
$Email__NotExist[] = 'status: 5.1.6';
$Email__NotExist[] = 'status: 5.1.7';
$Email__NotExist[] = 'this user doesn't have a yahoo';
$Email__NotExist[] = 'too many hops';
$Email__NotExist[] = 'unable to deliver';
$Email__NotExist[] = 'unable to relay';
$Email__NotExist[] = 'unknown address';
$Email__NotExist[] = 'unknown recipient';
$Email__NotExist[] = 'unknown user';
$Email__NotExist[] = 'unrouteable address';
$Email__NotExist[] = 'user doesn't have';
$Email__NotExist[] = 'user unknown';
$Email__NotExist[] = 'x-notes; 550 5.1.1';
$Email__NotExist[] = 'x-notes; recipient's domino directory';
$Email__NotExist[] = '$B%G%#%l%/%H%j$K$O8+$D$+$j$^$;$s!#'; //* Returned from japanese domino . Somehow means directory is not found.
$Email__Banned[] = '_spam_';
$Email__Banned[] = '550 5.7.1';
$Email__Banned[] = '550 access denied';
$Email__Banned[] = '550 no thanks';
$Email__Banned[] = '550 spam';
$Email__Banned[] = '554 5.7.0';
$Email__Banned[] = '554 5.7.1';
$Email__Banned[] = '554 denied';
$Email__Banned[] = '554 message does not conform to standards';
$Email__Banned[] = '554 message refused';
$Email__Banned[] = '571 message Refused';
$Email__Banned[] = 'activated my anti-spam features';
$Email__Banned[] = 'administrative prohibition';
$Email__Banned[] = 'appears to contain uce/spam';
$Email__Banned[] = 'appears to be spam';
$Email__Banned[] = 'appears to be unsolicited';
$Email__Banned[] = 'banned for spamming';
$Email__Banned[] = 'blackholed by uribl.com';
$Email__Banned[] = 'blacklisted by surbl';
$Email__Banned[] = 'blocked by filter';
$Email__Banned[] = 'blocked by kbas system';
$Email__Banned[] = 'blocked by our content filter';
$Email__Banned[] = 'blocked by spamsssassin';
$Email__Banned[] = 'blocked by the recipient';
$Email__Banned[] = 'blocked by user's personal blacklist';
$Email__Banned[] = 'blocked due to spam like qualities';
$Email__Banned[] = 'blocked using spam pattern';
$Email__Banned[] = 'blocked using uceprotect';
$Email__Banned[] = 'body part contains disallowed string';
$Email__Banned[] = 'classified as **spam**';
$Email__Banned[] = 'content blacklist';
$Email__Banned[] = 'content filter rejected the message';
$Email__Banned[] = 'consider the message to be spam';
$Email__Banned[] = 'considered spam';
$Email__Banned[] = 'contains spam';
$Email__Banned[] = 'content filter rejection';
$Email__Banned[] = 'content rejected';
$Email__Banned[] = 'denied by policy';
$Email__Banned[] = 'detected your message as spam';
$Email__Banned[] = 'does not accept UCE';
$Email__Banned[] = 'domain is banned';
$Email__Banned[] = 'email abuse detected';
$Email__Banned[] = 'error 553';
$Email__Banned[] = 'help_spam_16.htm';
$Email__Banned[] = 'high on spam scale';
$Email__Banned[] = 'http://www.google.com/mail/help/bulk_mail.html';
$Email__Banned[] = 'http://www.surbl.org/lists.html';
$Email__Banned[] = 'identified as spam';
$Email__Banned[] = 'identified your message as spam';
$Email__Banned[] = 'listed in multi.surbl.org';
$Email__Banned[] = 'looks like spam';
$Email__Banned[] = 'mail rejected by windows live hotmail for policy reasons';
$Email__Banned[] = 'message bounced by administrator';
$Email__Banned[] = 'message content rejected, ube';
$Email__Banned[] = 'message contains a virus or other harmful content';
$Email__Banned[] = 'message has too high spam probability';
$Email__Banned[] = 'message is blacklisted';
$Email__Banned[] = 'message refused';
$Email__Banned[] = 'no spam here';
$Email__Banned[] = 'not accepted here';
$Email__Banned[] = 'not in the whitelist';
$Email__Banned[] = 'not rfc compliant';
$Email__Banned[] = 'permanently rejected message';
$Email__Banned[] = 'policy violation';
$Email__Banned[] = 'refused mail service';
$Email__Banned[] = 'reject spam mail';
$Email__Banned[] = 'reject the mail';
$Email__Banned[] = 'rejected by filter';
$Email__Banned[] = 'rejected as spam';
$Email__Banned[] = 'rejected by 35 antiSpam system';
$Email__Banned[] = 'rejected by antispam system';
$Email__Banned[] = 'rejected by cloudmark anti-spam';
$Email__Banned[] = 'rejected by our Spam Filter';
$Email__Banned[] = 'rejected by spam filtering';
$Email__Banned[] = 'rejected by surbl';
$Email__Banned[] = 'rejected by the anti-spam system';
$Email__Banned[] = 'rejected due to security policies';
$Email__Banned[] = 'rejected for policy reasons';
$Email__Banned[] = 'rejected for spam';
$Email__Banned[] = 'requires that you verify';
$Email__Banned[] = 'scored as spam';
$Email__Banned[] = 'sender address verification';
$Email__Banned[] = 'sender was rejected';
$Email__Banned[] = 'spam detected by spamassassin';
$Email__Banned[] = 'spam filter pattern';
$Email__Banned[] = 'spam-like characteristics';
$Email__Banned[] = 'spam mail detected';
$Email__Banned[] = 'spam mail refused';
$Email__Banned[] = 'spam message was blocked';
$Email__Banned[] = 'spam rejected';
$Email__Banned[] = 'spam score too high';
$Email__Banned[] = 'status: 5.7.1';
$Email__Banned[] = 'support.proofpoint.com';
$Email__Banned[] = 'suspected spam';
$Email__Banned[] = 'suspicious url in message body';
$Email__Banned[] = 'temporarily deferred';
$Email__Banned[] = 'transaction failed';
$Email__Banned[] = 'unacceptable content';
$Email__Banned[] = 'unacceptable mail content';
$Email__Banned[] = 'unsolicited bulk e-mail';
$Email__Banned[] = 'unsolicited bulk email';
$Email__Banned[] = 'unsolicited email is refused';
$Email__Banned[] = 'validate recipient email';
$Email__Banned[] = 'will be deleted from queue';
$Email__OutOffice[] = 'away for a vacation';
$Email__OutOffice[] = 'away from the office';
$Email__OutOffice[] = 'not in office';
$Email__OutOffice[] = 'on leave';
$Email__OutOffice[] = 'on vacation';
$Email__OutOffice[] = 'out of office';
$Email__OutOffice[] = 'out of the office';
这比你想象的要容易。
您只需在标题中设置反弹路径。然后设置该电子邮件地址以运行处理脚本。显然,您需要发送某种形式的用户id。
我以前用过PHPList,发现它很好,有更好的服务来做你需要的,但显然有成本。
当地址不存在或邮件服务器将其发送回时,会发生反弹。有些邮件服务器不会回复(作为安全特性),因此准确性不是最好的。
许多独立/库提供了额外的功能找出哪些链接被谁点击了找出谁读了邮件。等
这些事情很容易实现,但需要资源。
让我知道,如果有什么你需要帮助
发现没有简单的答案这个问题后,我发现这个优秀的解决方案在github:
https://github.com/cfortune/PHP-Bounce-Handler
我是ezComponents库的大粉丝,它包括一个邮件组件,可以处理发送和解析邮件(以及连接到您的MTA检索它)。http://ezcomponents.org/docs/tutorials/Mail mail-parsers
通读文档,似乎应该能胜任你的任务。
作为在线社区15年的资深人士,我知道用一个以营利为目的的商业解决方案来回答问题是一种微妙的行为。所以我走在这条线上。我将尽力具体地回答这个问题。让我们从一个标准的免责声明开始…
免责声明:我是下面描述的服务中的一个原则。
,但是将资源投入到编写我们自己的库来解析被退回的电子邮件是非常不可取的。
是的,编写自己的库对大多数人来说不是一件有趣的事情(但对我们这些可怜的、扭曲的、没有更好的事情可做的灵魂来说),考虑到您编写或包含的库可能在您修改后的几天内就被认为是过时的。
有谁知道处理反弹的最新规则集吗电子邮件吗?我不需要任何处理逻辑,甚至只是一个最新的规则集将会令人满意。
维护这样的库非常耗时,一旦它变得非常耗时,这样的库通常要么被放弃,要么很少更新。这通常是商业解决方案诞生的方式。
我是开源的忠实粉丝,毫无疑问,多年来我个人从中受益匪浅。对于阅读本文的大多数读者来说,上述选项是完全足够的,因为你们中的许多人有能力自己开发所需的解决方案,或者修改可用的工具以满足您的需求,并且有时间这样做。
但是,对于那些不希望构建自己的应用程序,调试和排除故障,经常更新电子邮件处理定义的人来说,InboxResponse.com提供了电子邮件反弹处理作为SAAS解决方案。它是:
- 经常持续更新
- 对于那些只想要工作的东西的人来说是完美的
- 可以集成到您目前使用的任何现有的邮件系统,在几分钟内。
- 支持交付跟踪,弹跳处理,多级软弹跳处理(暂时无法投递的电子邮件),无限邮件列表,统计,图表等。
可在以下网址免费试用:https://inboxresponse.com/free-trial/
可能不是你想要的(一个开源库总是保持最新),但我不认为你想要的是目前可用的。
希望这对某人有所帮助!