This page looks best with JavaScript enabled

Scuttle - Blacklist Spam Accounts

 ·  ☕ 2 min read

Background

Scuttle is an open source bookmark manager (see What is Scuttle?). If you set up your own scuttle instance on your public web server you will no doubt run into spammers who create their own accounts for illicit purposes. There are several ways to deal with this issue (captcha, denying the ability for users to create their own account, etc); however, scuttle does have a basic whitelist/blacklist function that can provide a basic, quick, and easy approach to handling spammers.

Details

To add to the whitelist or blacklist (the below example shows adding to the blacklist) perform the following steps:

  • Open the config.inc.php file in a text editor
  • Find the $email_blacklist declaration and add a new array item (see Adding Blacklist Items Examples section for examples of how to add entries)
  • Save the changes

After saving the above change, when a new user tries to register with an email address that matches your entry they will receive a message that their email address is blocked and they will not be able to create an account. If the above is not enough or you would like to add a captcha to your scuttle instance check out the scuttle patch for adding captchas.

Adding Blacklist Items Examples

  • Block a domain:
    '/microsoft\.com/i' --this will block all email addresses from microsoft.com (e.g. *@microsoft.com)
  • Block a specific email address:
    '/jjones\@microsoft\.com/i' --this will block a single email address (e.g. jjones@microsoft.com)

Adding To Blacklist Array Example

This example shows how to add to the blacklist array. The example shows the original array followed by the array after adding an entry which blocks *@microsoft.com:

Initial blacklist array:
$email_blacklist   = array(
       '/(.*-){2,}/',
        '/mail\.ru/i',
        '/mailinator\.com/i',
        '/awebsitesdirectory\.com/i'
     );
  • Modified blacklist array:
$email_blacklist   = array(
       '/(.*-){2,}/',
        '/mail\.ru/i',
        '/mailinator\.com/i',
        &#39;/awebsitesdirectory\.com/i&#39;<strong><span style="background-color:#ffff00;">,</span></strong>
        <strong><span style="background-color:#ffff00;">&#39;/microsoft\.com/i&#39;</span></strong>
     );

Note that the array entries are reg-ex expressions and as such special characters such as '.' or '@' must be escaped by adding a '&#39; character before the special character.

Share on

drad
WRITTEN BY
drad
Sr. Consultant