Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias alias alias Import alias Import alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index TupleLoad Str Str NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Str Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad Str Str Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr Call AttributeLoad NameLoad attr ListLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assert UnaryOpNot SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad Str Str Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Assert UnaryOpNot AttributeLoad NameLoad attr Str Assert UnaryOpNot AttributeLoad NameLoad attr Str Assert CompareIn NameLoad ListLoad Str Str Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body If UnaryOpNot AttributeLoad NameLoad attr body Return Assert AttributeLoad NameLoad attr Str Assert CompareIn AttributeLoad NameLoad attr ListLoad Str Str Str If CompareEq AttributeLoad NameLoad attr Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assert AttributeLoad NameLoad attr Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body FunctionDef arguments args NameParam defaults vararg kwarg body If AttributeLoad NameLoad attr body If Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr orelse Return Call NameLoad NameLoad NameLoad NameLoad orelse Return Call NameLoad NameLoad NameLoad NameLoad decorator_list Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad If CompareIn Str NameLoad body Return Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad decorator_list decorator_list
N/A N/A 
Uses the SpamBayes system to perform filtering and classification
of email.  It's designed so that you attach a single decorator
to the state functions you need to be "spam free", and then use the
lamson.spam.Filter code to do training.

SpamBayes comes with extensive command line tools for processing
maildir and mbox for spam.  A good way to train SpamBayes is to 
take mail that you know is spam and stuff it into a maildir, then
periodically use the SpamBayes tools to train from that.
 functools wraps lamson queue spambayes hammie Options storage N/A os N/A logging Filter N/A object N/A N/A 
    This code implements simple filtering and is taken from the
    SpamBayes documentation.
     __init__ N/A N/A self storage_file config N/A N/A N/A options N/A Options options N/A N/A options N/A N/A Storage persistent_storage_file storage_file N/A N/A N/A options merge_files N/A /etc/hammierc N/A N/A N/A os path expanduser config N/A N/A self include_trained N/A N/A Options options N/A N/A Headers include_trained N/A N/A N/A self dbname N/A self usedb N/A N/A storage database_type N/A N/A N/A self mode None N/A N/A self h None N/A N/A N/A N/A Options options N/A N/A Hammie train_on_filter Cannot train_on_filter. N/A open N/A N/A self mode N/A N/A N/A N/A N/A self h Cannot reopen, close first. N/A N/A N/A self mode Mode should be None on open, bad state. N/A N/A mode N/A r c Must give a valid mode: r, c. N/A N/A self mode mode N/A N/A self h N/A N/A hammie open N/A self dbname N/A self usedb N/A self mode N/A close N/A N/A self N/A N/A N/A N/A N/A self h N/A N/A N/A N/A self mode Mode was not set. N/A N/A N/A self mode N/A r c self.mode was not r or c. Bad state. N/A N/A N/A self mode c N/A N/A N/A N/A N/A self h store N/A N/A N/A N/A self h close N/A N/A self h None N/A N/A self mode None N/A filter N/A N/A self msg N/A N/A N/A N/A N/A self open r N/A result N/A N/A N/A self h filter msg N/A N/A N/A self close N/A result N/A train_ham N/A N/A self msg N/A N/A N/A N/A N/A self open c N/A N/A N/A N/A self h train_ham msg N/A self include_trained N/A N/A N/A self close N/A train_spam N/A N/A self msg N/A N/A N/A N/A N/A self open c N/A N/A N/A N/A self h train_spam msg N/A self include_trained N/A N/A N/A self close N/A untrain_ham N/A N/A self msg N/A N/A N/A N/A N/A self open c N/A N/A N/A N/A self h untrain_ham msg N/A N/A N/A self close N/A untrain_spam N/A N/A self msg N/A N/A N/A N/A N/A self open c N/A N/A N/A N/A self h untrain_spam msg N/A N/A N/A self close N/A N/A spam_filter N/A object N/A N/A 
    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.
     __init__ N/A N/A self storage config spam_queue next_state N/A None N/A N/A N/A self storage storage N/A N/A self config config N/A N/A self spam_queue spam_queue N/A N/A self next_state next_state N/A N/A self next_state You must give next_state function. N/A N/A N/A N/A N/A os path exists N/A self storage N/A N/A N/A N/A logging warn SPAM filter for %r does not have a valid storage path, it'll still run but won't do anything. N/A N/A self storage N/A self config N/A self spam_queue N/A N/A self next_state __name__ N/A N/A self functioning False N/A N/A N/A self functioning True N/A __call__ N/A N/A self fn N/A N/A category_wrapper N/A N/A message N/A args kw N/A N/A N/A self functioning N/A N/A N/A N/A self spam N/A N/A message to_message N/A N/A N/A N/A self enqueue_as_spam N/A N/A message to_message N/A N/A self next_state N/A N/A N/A fn message args kw N/A N/A N/A fn message args kw N/A N/A wraps fn N/A category_wrapper N/A spam N/A N/A self message N/A N/A N/A Determines if the message is spam or not. N/A spfilter N/A Filter N/A self storage N/A self config N/A N/A N/A spfilter filter message N/A N/A X-Spambayes-Classification message N/A N/A N/A N/A N/A message N/A X-Spambayes-Classification startswith spam N/A N/A False N/A enqueue_as_spam N/A N/A self message N/A N/A N/A Drops the message into the configured spam queue. N/A outq N/A N/A queue Queue N/A self spam_queue N/A N/A N/A outq push N/A str message N/A N/A