summaryrefslogtreecommitdiff
path: root/Mailman/rules
Commit message (Collapse)AuthorAgeFilesLines
* Bite the bullet: rename the Mailman package to mailman.Barry Warsaw2008-02-2728-2125/+0
|
* Make the import of Mailman.configuration.config explicit in doctests.Barry Warsaw2008-02-261-0/+1
|
* Reorganize the Handler architecture to a pipeline architecture with plugins.Barry Warsaw2008-02-171-1/+1
| | | | | | | | | | | | | | | | Now plugins can define additional handlers and the handlers can be organized into named pipelines. Modules are no longer the unit of a handler, now we use classes so we can assert interface conformance. The GLOBAL_PIPELINE is gone, replaced by the 'built-in' pipeline. The OWNER_PIPELINE is not yet replaced. I still need a few more tests of the basic pipeline architecture, although the individual handlers have pretty good coverage. Added the IHandler and IPipeline interfaces. Still broken, but not yet removed: Mailman/pipeline/moderate.py.
* Tweak copyright years.Barry Warsaw2008-02-071-1/+1
|
* Python 2.5's email package uses cStringIO in its feed parser, and this doesn'tBarry Warsaw2008-01-2410-28/+28
| | | | | | | support unicode. Although this never bit me on OS X (Leopard) it matters greatly on Linux (Ubuntu) where you get lots of test failures because of it. So instead, just use 8-bit string in message_from_string(). Everything works fine still.
* SpamDetect is gone, so the chains/rules implementation experiment is deemed aBarry Warsaw2008-02-013-0/+107
| | | | | | | | | | | | | | | | | | | | success and will now be merged into the trunk. Move the Truth rule into the built-in rules package in a separate module, and add a test. Modify IChainLink so that the rule and chain attributes are not names but indeed the actual ILink or IChain object directly. Update the chains.process() function accordingly. Remove the IChain.get_rule() method. Don't derive BuiltInChain from Chain and don't make it an IMutableChain. It's now just an IChain, and is implemented concretely. Refactor the HeaderMatchChain and friends so that it can be used with both the global HEADER_MATCHES variable and the list-specific header_matches variable, which has exactly the same semantics. Oh yeah, get rid of the list's header_filter_rules attribute and replace it with header_matches so that the semantics match, it's easy to explain, and it's all nice and clean.
* Port header matching previously described by the misnamed KNONW_SPAMMERSBarry Warsaw2008-01-262-2/+91
| | | | | | | | | | | | | | | variable to the new chain processing system. Create a header-matching chain which handles global site header matching rules defined by HEADER_MATCHES. Rip this logic out of the SpamDetect handler; really this entire handler needs to go away but the rest of it isn't ported yet. IChains now have a get_rule() method which allows them to return private (i.e. not globally registered) rules. This is used by the header matching chain. Mailman.app.chains.process() has had its parameter list reordered to be more like all other function signatures that take a mailing list, message, and message metadata.
* More changes to rules and chains.Barry Warsaw2008-01-2314-26/+39
| | | | | | | | | | | | | Now a link has a rule, action, chain, and function, not all of which needs to be specified. The action is a LinkAction enum adn specifies what to do should the rule match. The use of the chain or function depends on what the action is. Several interface changes now make it easier to jump to other chains, push (i.e. detour) to chains, etc. Rules can also now specify that they should not be recorded in X-* headers. Added a TruthRule which always matches.
* More updates to rules and chains, especially by adding additional tests.Barry Warsaw2008-01-2113-91/+116
| | | | | | | | | | | | | | | - Remove the Emergency.py handler. This is now covered by the emergency.py rule. - Remove the hold.txt doctest. This is now covered by the chains.txt and emergency.txt doctests. - Added a chains.txt doctest. - Extend the pending db to handle list values, although only lists that contain nothing but strings. - Rename the 'adminapproved' message metadata key (for the emergency rule) to 'moderator_approved'. Also, backport a change to the Decorate handler where message metadata on the 'decoration-data' key ca be used in the header and footer.
* Use a more efficient way of deleting rows from a table, which coincidentallyBarry Warsaw2008-01-142-44/+61
| | | | <wink> works around the storm cache bug #178546.
* Fix the rule api once more so that while rules themselves are still classes,Barry Warsaw2008-01-012-6/+9
| | | | | | | | they are instantiated by the IRuleSet, thus keeping the promises of the interface. The ChainJump enum is moved to interfaces/chain.py. This will be fleshed out subsequently.
* Extended test_documentation.py to be able to find doctests in subdirectoriesBarry Warsaw2008-01-0123-60/+1093
| | | | | | called 'docs' anywhere under the Mailman package. Change the rule API to return rule classes not instances. Added the ChainJump enum, though this will likely change soon.
* Add three new rules and their associated doctests.Barry Warsaw2007-12-302-0/+114
| | | | | | | | | - A rule that checks to see if the sender is a moderated member. - A rule that checks to see if the sender is a non-member. - A rule that checks to see if the message has no (or an empty) Subject. Give IMembers (and the associated database implementation) an `is_moderated` flag.
* Move the suspicious header check to a rule and add a doctest.Barry Warsaw2007-12-291-0/+96
|
* Add a rule and doctest for newsgroup moderation.Barry Warsaw2007-12-291-0/+46
|
* Port the maximum message size check to a rule. Add doctest.Barry Warsaw2007-12-292-1/+49
| | | | | | | | Rename the implicit.txt doctest. specialized_message_from_string(): Mimic the way the text->message parser will include the size of the original text as an attribute on the message object. The maximum message size rule will use this information.
* Port the implicit destination checking to the rules infrastructure and add aBarry Warsaw2007-12-292-1/+100
| | | | | | bunch of doctests. Note that the old Hold Notification tests are temporarily disabled as these will have to be rewritten when the rule matching logic gets added.
* No executableBarry Warsaw2007-12-291-0/+0
|
* Convert the max-recipients check from the Hold handler to the max_recipientsBarry Warsaw2007-12-291-0/+51
| | | | rule. Add doctest as appropriate.
* Convert the administrivia check from the Hold handler to the administriviaBarry Warsaw2007-12-291-0/+102
| | | | | | rule. Add doctest as appropriate. DEFAULT_MAIL_COMMANDS_MAX_LINES -> EMAIL_COMMANDS_MAX_LINES
* Add a rule to search for posting loops.Barry Warsaw2007-12-293-1/+50
|
* Convert the Approve.py handler to an approved.py rule. Update the doctest toBarry Warsaw2007-12-292-1/+120
| | | | | | | | | use the rule check instead of handler processing. Add a test for stripping the header from the text/html part to the doctest. Add Mailman.app.rules.find_rule() to return a named rule. Fix a few typos.
* Change IRuleProcessor to IRuleSet. Plugins now provide only sets of rules,Barry Warsaw2007-12-271-13/+7
| | | | | | they do not do the actual rule processing. That's left up to Mailman. Further, the rule processor can be given a list of rules to run; those will be the only ones run.
* First cut at a rules processor, separate from the disposition of rule hits.Barry Warsaw2007-12-272-0/+119
The basic idea is that we process rules on a mlist, message, metadata triplet making a list of all rules that hit. Then a different part of the system will decide on the disposition of a message based on which rules hit and their priority. The doctest and plugin architecture is in place, including the tie-in to setup.py. Ported the first rule -- emergency.py -- to the new rule processor. We no longer need SQLAlchemy as a requirement, and the setuptools/bzr plugin name has changed.