Ticket #2706 (assigned enhancement)

Opened 6 months ago

Last modified 6 months ago

RFE: Spamfilter support!

Reported by: mickem Assigned to: Blackhex (accepted)
Priority: normal Component: DiscussionPlugin
Severity: major Keywords: spam filter discussion forum
Cc: Trac Release: 0.10

Description

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.

// MickeM

Attachments

tracdiscussion-anti-spam-patch.diff (3.9 kB) - added by mickem on 03/09/08 04:08:55.
anti-spam-fiter-path
spam.py (1.3 kB) - added by mickem on 03/09/08 04:12:44.
strange, the svn diff disregarded new files... well, here is the spam.py

Change History

03/09/08 04:08:55 changed by mickem

  • attachment tracdiscussion-anti-spam-patch.diff added.

anti-spam-fiter-path

03/09/08 04:12:44 changed by mickem

  • attachment spam.py added.

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

03/09/08 04:41:25 changed 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.

03/11/08 09:36:57 changed by anonymous

  • keywords changed from spam filter discussuion forum to spam filter discussion forum.

Hi.

Thanks for your spamfilter + discussion hack, it seems to be working in our trac (www.tribler.org). 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/main.py", line 388, in dispatch_request

dispatcher.dispatch(req)

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

resp = chosen_handler.process_request(req)

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

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

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

03/11/08 09:44:24 changed by Blackhex

Appending

  discussion_manipulators = ExtensionPoint(IDiscussionManipulator) 

to DiscussionAdmin? class in admin.py 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.

03/16/08 16:55:12 changed 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.


Add/Change #2706 (RFE: Spamfilter support!)




Change Properties
Action