Opened 9 years ago

Closed 7 years ago

#2706 closed enhancement (fixed)

RFE: Spamfilter support!

Reported by: mickem Owned by: Blackhex
Priority: normal Component: DiscussionPlugin
Severity: major Keywords: spam filter discussion forum
Cc: Trac Release: 0.11


Since I got fed up with all the spam I started getting on my forum page I started looking around for a spam thingy without success so I sat down and added one instead.

It is a bit of hack since I don't know much about neither trac nor python but it seems to work :) The plugin adds an extension point for new posts and new topics and then adds an adapter to the "regular" spam filtering so you need to have the trac anti spam thingy installed and setup and working. I think maybe the adapters might have to be moved to their own module to work regardless of if the anti-spam is installed (since AFAIK tracdiscussion imports *) but I have not tested this.

Also I have only made this patch for 0.10 since I don't have any other version.


Attachments (3)

tracdiscussion-anti-spam-patch.diff (3.9 KB) - added by mickem 9 years ago.
anti-spam-fiter-path (1.3 KB) - added by mickem 9 years ago.
strange, the svn diff disregarded new files... well, here is the
tracdiscussion-0_11-anti-spam-patch.diff (4.1 KB) - added by mickem 8 years ago.
hacked spam path for 0.11 branch

Download all attachments as: .zip

Change History (10)

Changed 9 years ago by mickem


Changed 9 years ago by mickem

strange, the svn diff disregarded new files... well, here is the

comment:1 Changed 9 years ago by Blackhex

  • Status changed from new to assigned

By a coencidence I wanted to implement this yesterday, becase spammers on my site really annoys me, but I didn't find a time. Thanks for your patch, I'll try to apply it ASAP.

comment:2 Changed 9 years ago by anonymous

  • Keywords discussion added; discussuion removed


Thanks for your spamfilter + discussion hack, it seems to be working in our trac ( However the webadmin pages for tracdiscussion do not work anymore:

Traceback (most recent call last):

File "/data/trac-production/usr/lib/python2.3/site-packages/trac/web/", line 388, in dispatch_request


File "/data/trac-production/usr/lib/python2.3/site-packages/trac/web/", line 238, in dispatch

resp = chosen_handler.process_request(req)

File "build/bdist.linux-x86_64/egg/webadmin/", line 119, in process_request File "build/bdist.linux-x86_64/egg/tracdiscussion/", line 37, in process_admin_request File "build/bdist.linux-x86_64/egg/tracdiscussion/", line 38, in init

AttributeError: 'DiscussionWebAdmin' object has no attribute 'discussion_manipulators'

Do you have the same problem, or do you know a solution?

comment:3 Changed 9 years ago by Blackhex


  discussion_manipulators = ExtensionPoint(IDiscussionManipulator) 

to DiscussionAdmin class in should fix your problem.

BTW: Commit of this patch will not be so soon, I'm making some internal changes that should be made before and currently I don't have much time to work on Trac's plugins.

comment:4 Changed 9 years ago by Blackhex

  • Priority changed from high to normal
  • Summary changed from [PATCH] Spamfilter support! to RFE: Spamfilter support!

Because I don't care much about 0.10 branch clearness and because it's used more than 0.11 branch, I applied you patch almost without changes. 0.11 must wait for better implementation.

comment:5 Changed 8 years ago by datakid

Are there any plans on updating this soon?

Changed 8 years ago by mickem

hacked spam path for 0.11 branch

comment:6 Changed 8 years ago by mickem

  • Trac Release changed from 0.10 to 0.11

I just hacked together a quick patch to get spam filtering on 0.11 don't know if this is already "in there somewhere" but I did not find it so I added it (pretty much the same as before).

I tried doing it on trunc but I could not get trunc to work properly so I reverted back to 0.11 "stable" branch.

Please feel free to let me know if it works or not.

Michael Medin

comment:7 Changed 7 years ago by Blackhex

  • Resolution set to fixed
  • Status changed from assigned to closed

Implemented in r6309.

Add Comment

Modify Ticket

as closed The owner will remain Blackhex.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.