对 mailto 标签进行 HTML 编码是否可以阻止垃圾邮件发送者
我认为现在在网页中不包含 mailto: 标签是相当常见的做法。 我还意识到更好的解决方案是使用联系我们表格。
最近我看到一些 mailto 标签,其中包含 HTML 编码的电子邮件地址。 这是阻止垃圾邮件发送者攻击电子邮件地址的有效方法吗?
示例:
<a href="mailto:newbi...">email me</a>
另外,还有其他我遗漏的技术吗? 哪种方法最好?
I think its fairly common practice these days not to include a mailto: tag in your webpage. I also realize that a better solution is to have a contact us form.
Recently I've seen some mailto tags that include and HTML encoded email address. Is this an effective way to stop spammers from attacking an email address?
Example:
<a href="mailto:newbi...">email me</a>
Also, are there any other techniques that I've left out? Which is the best method?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
多年来,我一直在几个网站上使用简单的 Javascript 字符串连接和子字符串操作来混淆电子邮件地址。 这似乎很有效,因为我在这些地址上收到的垃圾邮件很少。 这并不意味着它在未来仍然有效。
I have been using simple Javascript string concatenation and substring operations to obfuscate the email address for years on several websites. This seems to have worked well, since I got minimal spam on these addresses. This cannot mean that it will still work in the future.
就我个人而言,我鼓励使用表单,因为这将使您更好地控制如何处理任何潜在的垃圾邮件。 (就我个人而言,我不喜欢验证码等“前端”解决方案,因为它们很少对用户友好 - 如果它给您的用户带来任何不便/额外的工作,我通常喜欢看看是否有更好的方法)
也使用表单具有使您能够从具有某种结构的联系人处获取数据的额外好处。 (也就是说,它降低了有人联系您提出问题但没有提供足够信息(甚至可能是他们的名字)的风险,这可能有助于您为他们提供最佳答复。
Personally I'd encourage using a form as that will give you much greater control over how you tackle any potential spam. (Personally I don't like "front end" solutions such as CAPTCHA as they're rarely user friendly - if it causes any inconvenience/additional work for your user, I generally like to see if there's a better way)
Using a form also has the additional benefit of enabling you to obtain data from the contactee with some kind of structure. (I.e. it reduces the risk of someone contacting you with a question, but not providing enough info (even their name perhaps) which might help you in providing them with the best response possible.
在不给某些用户带来困难的情况下,您只能阻止懒惰的垃圾邮件发送者 - 因为您事先不知道自己正在查看哪些内容。 因此,如果您提供了合法用户可以轻松访问的内容,那么您也就提供了垃圾邮件发送者可以轻松访问的内容。
我最好的建议是,如果您要将您的地址发布到网络上,请使用一个非常好的垃圾邮件过滤器。 再多的 href 混淆也起不了多大作用。
Without making it hard for some of your users, you're only ever going to be able to stop lazy spammers — because you don't know ahead of time which you're looking at. So if you deliver something easily accessible to a legitimate user, you're delivering something easily accessible to a spammer.
My best advice is just to get a very good spam filter if you're going to put your address on the Web. No amount of href obfuscation will do as much good.
我通常使用 Hivelogic Enkoder。 它对于编码整个链接元素很有帮助,而不仅仅是 mailto。
然而,我们从一种烦人的方式中学到的一个教训是,用原始元素在编码之前的样子来注释您的代码。 我有几次不小心遗漏了
标记上的类。
I typically use the Hivelogic Enkoder. It is helpful for encoding an entire link element, not just the mailto.
One lesson learned the annoying way, however, is to comment your code with what the original element looked like before encoding. I've accidentally left off classes on the
<a>
tag a few times.对于我的个人主页,我以图形形式给出了电子邮件地址。 然后我很抱歉没有将其设为链接。
For my personal home page, I give the email address in a graphic. Then I apologize for not making it a link.
另一种技术是使用一些 JavaScript 在页面加载时动态生成 mailto 标记。 为了让垃圾邮件发送者抓取这些地址,他们的网络蜘蛛需要有一个完整的 Javascript 处理器。
一些垃圾邮件发送者可能已经这样做了。
Another technique is to use some Javascript to dynamically generate the mailto tag at page load time. In order for spammers to scrape such addresses, they would need to have a full Javascript processor in their web spider.
Some spammers may already do this.
据我所知,这将有助于减少垃圾邮件的涌入,但并不能完全阻止它。 少数(目前)电子邮件地址收集机器人足够聪明,可以应用解码。
From what I've heard, it will help reduce the influx of spam but will not stop it entirely. A minority (for now) of email-address-harvesting bots are smart enough to apply the decoding.