Coding

How to batch remove spam in trac

Spambots are such a nuisance, but we are not defenseless! So we woke up one day to find our nice Trac system polluted by spam. No problem!

  • Install the Trac Spam Filter Plugin. If you have the python setuptools installed you can simple type
    easy_install TracSpamFilter
    
  • You might have to upgrade your system. Type
    trac-admin /path/to/trac/installation upgrade
    
  • Don’t forget to enable the plugin in your trac.ini file as described on the plugin page
  • Finally, delete all spam tickets by typing
    for i in $(seq 25 248);  do trac-admin /path/to/trac/installation ticket remove $i; done
    

    on the shell. Replace 25 and 248 by the first and last ticket number of the range of tickets that are spam.

Now, dear spambots, try your luck elsewhere.

Advertisements

2 thoughts on “How to batch remove spam in trac

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s