Skip to content

Commit d4324c5

Browse files
author
Richard Jones
committed
Add simple anti-spam recipe to docs
1 parent 360feb0 commit d4324c5

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ are given with the most recent entry first.
55
Feature:
66
- Dates can now be in the year-range 1-9999 except for metakit which is
77
still limited to 1970-2038.
8+
- Add simple anti-spam recipe to docs
9+
810
Fixed:
911
- Handling of unset Link search in RDBMS backend
1012
- Journal import/export for metakit backend

doc/customizing.txt

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Customising Roundup
33
===================
44

5-
:Version: $Revision: 1.217 $
5+
:Version: $Revision: 1.218 $
66

77
.. This document borrows from the ZopeBook section on ZPT. The original is at:
88
http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
@@ -3834,6 +3834,37 @@ So you could reimplement this as something like::
38343834
Changes to Tracker Behaviour
38353835
----------------------------
38363836

3837+
Preventing SPAM
3838+
~~~~~~~~~~~~~~~
3839+
3840+
The following detector code may be installed in your tracker's
3841+
``detectors`` directory. It will block any messages being created that
3842+
have HTML attachments (a very common vector for spam and phishing)
3843+
and any messages that have more than 2 HTTP URLs in them. Just copy
3844+
the following into ``detectors/anti_spam.py`` in your tracker::
3845+
3846+
from roundup.exceptions import Reject
3847+
3848+
def reject_html(db, cl, nodeid, newvalues):
3849+
if newvalues['type'] == 'text/html':
3850+
raise Reject, 'not allowed'
3851+
3852+
def reject_manylinks(db, cl, nodeid, newvalues):
3853+
content = newvalues['content']
3854+
if content.count('http://') > 2:
3855+
raise Reject, 'not allowed'
3856+
3857+
def init(db):
3858+
db.file.audit('create', reject_html)
3859+
db.msg.audit('create', reject_manylinks)
3860+
3861+
You may also wish to block image attachments if your tracker does not
3862+
need that ability::
3863+
3864+
if newvalues['type'].startswith('image/'):
3865+
raise Reject, 'not allowed'
3866+
3867+
38373868
Stop "nosy" messages going to people on vacation
38383869
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38393870

doc/installation.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Installing Roundup
33
==================
44

5-
:Version: $Revision: 1.124 $
5+
:Version: $Revision: 1.125 $
66

77
.. contents::
88
:depth: 2
@@ -788,6 +788,15 @@ Korean encodings the you'll need to obtain CJKCodecs from
788788
http://cjkpython.berlios.de/
789789

790790

791+
Public Tracker Considerations
792+
-----------------------------
793+
794+
If you run a public tracker, you will eventually have to think about
795+
dealing with spam entered through both the web and mail interfaces.
796+
797+
The `customisation documentation`_ has a simple detector that will block
798+
a lot of spam attempts. Look for the example "Preventing SPAM".
799+
791800

792801
Maintenance
793802
===========

0 commit comments

Comments
 (0)