Package lamson :: Module spam :: Class spam_filter
[hide private]
[frames] | no frames]

Class spam_filter

source code



This is a decorator you attach to states that should be protected from spam.
You use it by doing:

    @spam_filter(ham_db, rcfile, spam_dump_queue, next_state=SPAMMING)

Where ham_db is the path to your hamdb configuration, rcfile is the 
SpamBayes config, and spam_dump_queue is where this filter should
dump spam it detects.

The next_state argument is optional, defaulting to None, but if you use
it then Lamson will transition that user into that state.  Use it to mark
that address as a spammer and to ignore their emails or do something
fancy with them.

Instance Methods [hide private]
 
__init__(self, storage, config, spam_queue, next_state=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__call__(self, fn) source code
 
spam(self, message)
Determines if the message is spam or not.
source code
 
enqueue_as_spam(self, message)
Drops the message into the configured spam queue.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, storage, config, spam_queue, next_state=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__call__(self, fn)
(Call operator)

source code 

spam(self, message)

source code 

Determines if the message is spam or not.

enqueue_as_spam(self, message)

source code 

Drops the message into the configured spam queue.