带有akismet的注册垃圾邮件发送者检测 [英] Registration spammer detection with akismet

查看:126
本文介绍了带有akismet的注册垃圾邮件发送者检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个很大的用户列表,这些用户是通过网站注册的,注册期间没有任何垃圾邮件过滤器处于活动状态.

I have a large list of users that registered through a website without any spam filter active during registration.

我想区分哪些注册用户可能是垃圾邮件发送者.我正在尝试使用akismet来做到这一点,但到目前为止akismet告诉我所有用户都不是垃圾邮件发送者.可能是因为akismet确实是用于发表评论的,在注册过程中不可用.

I would like to distinguish which registered users are likely spammers. I'm trying to use akismet to do this but so far akismet is telling me all users are not spammers. Probably since akismet really is made for comments, which aren't available during registration.

我要发送的akismet是用户名,电子邮件. 对于url,我使用电子邮件域. 对于他们的评论,我使用:您好,我是$ date上以电子邮件$ email和网站$ url注册的$ domain中的$ username".

What I'm sending akismet is the username, email. For url I use the email domain. For their comment, I use: "Hi, I'm $username from $domain registered on $date with email $email and website $url".

但是,就像所说的那样,即使用户看起来像垃圾邮件发送者,它始终会返回有效用户.

This however, like said, always returns valid users even if the user looks like a spammer.

如果您对完整代码感兴趣:

If you're interested in the full code:

<?php

// bring php process to this dir
chdir(dirname(__FILE__));


// include Joomla Framework
require('../bootstrap-joomla.php');

// akismet class
require('akismet.class.php');

/**
 * Retrieves users not yet validated
 */
function getUsers($userid, $limit = 10) {
  global $database;
  $database->setQuery("SELECT * FROM jos_users WHERE akismet_validated = 0 LIMIT " . intval($limit));
  $Users = $database->loadObjectList();
  return $Users;
}

/**
 * sets the validation results for the user
 */
function saveValidationResult($userid, $spammer) {
  global $database;
  $database->setQuery("UPDATE jos_users set akismet_validated = 1, akismet_spammer = " . intval($spammer) . " WHERE id = " . $userid . " LIMIT 1");
  return $database->query();
}

// get non validated users
$Users = getUsers();

// validate each user
foreach($Users as $User) {
  list($user, $domain) = explode('@', $User->email);

  $name = $User->username;
  $email = $User->email;
  $url = $domain;
  $comment = "Hello, I am $name, registered on $User->registerDate from <a href=\"$url\">$url</a>.\r\n";


  $akismet = new Akismet('http://www.fijiwebdesign.com/', 'c511157d1d98');
  $akismet->setCommentAuthor($name);
  $akismet->setCommentAuthorEmail($email);
  $akismet->setCommentAuthorURL($url);
  $akismet->setCommentContent($comment);
  //$akismet->setPermalink('http://www.fijiwebddesign.com/');


  echo "$User->id, $User->username : ";
  if($akismet->isCommentSpam()) {
    saveValidationResult($User->id, true);
    echo "Spammer";
  } else {
    saveValidationResult($User->id, false);
    echo "Not Spammer";
  }

  echo "\r\n";
}

推荐答案

最好将Akismet视为巨型贝叶斯垃圾邮件过滤器和其他一些启发式方法.它适用于帖子的内容,帖子的 timing ,最重要的是,它被多频繁地看到被举报为垃圾内容的类似内容.您要输入的字符串有些独特,因此其他人将不会受垃圾邮件的影响.即使您确实以某种方式将该字符串标记为垃圾邮件,但由于要通过它喂所有个用户帐户,最终还是会产生大量误报.

It's best to think of Akismet as a giant Bayesian spam filter with some other heuristics. It works on the contents of a post, the timing of a post, and most importantly, how frequently it's seen similar content that has been reported as spammy. The string you're feeding to it is somewhat unique, so others will not have educated it on spammyness. Even if you did somehow mark that string as spammy, you'd end up with a whole bunch of false positives because you're just feeding all of the user accounts through it.

如果您认为自己的网站上可能有非法用户,但他们没有参加,则只需删除注册即可.如果它们合法,则只需重新注册即可.

If you believe that you may have illegitimate users on your site, and they have not participated, simply delete the registration. If they are legitimate, they can simply re-register.

如果用户正在参与,只需查看他们的贡献即可.他们的垃圾邮件应该很明显.

If the users are participating, simply look at their contributions. Their spammyness should be obvious.

这篇关于带有akismet的注册垃圾邮件发送者检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆