summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* PEP 292 style, $-strings are used by the translation service everywhere now.Barry Warsaw2008-02-1851-110/+24
| | | | No more %-strings. Kill off all __i18n_templates__ hacks.
* Added a test for the built-in pipeline. Fixed some broken handler names inBarry Warsaw2008-02-179-30/+233
| | | | | | | | | | | | | the built-in pipeline. Fixed DEFAULT_SUBJECT_PREFIX to take $-names instead of %-names, although I'm not entirely sure the %%d stuff still works (we need a test for this). Added IMailingList.real_name attribute and added this to the default style. A column for this was in the database but not in the storm object. Also re-enabled the style's subject_prefix attribute. Moved some of the digest test functions into Mailman.tests.helpers.
* Reorganize the Handler architecture to a pipeline architecture with plugins.Barry Warsaw2008-02-1738-357/+875
| | | | | | | | | | | | | | | | 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.
* Mailman.handlers -> Mailman.pipelineBarry Warsaw2008-02-0840-23/+23
|
* Rename 'prep queue' to 'pipeline queue'.Barry Warsaw2008-02-086-19/+57
| | | | Add a pipeline queue runner.
* Tweak copyright years.Barry Warsaw2008-02-07220-220/+220
|
* Reorganize doctests, moving handler documentation into Mailman/handlers/docs.Barry Warsaw2008-01-2440-22/+22
| | | | Rename all handlers to be more PEP 8 friendly, i.e. lowercased.
* Python 2.5's email package uses cStringIO in its feed parser, and this doesn'tBarry Warsaw2008-01-2425-99/+99
| | | | | | | 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.
* Merge the 'rules' branch.Barry Warsaw2008-02-0287-1606/+3792
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Give the first alpha a code name. This branch mostly gets rid of all the approval oriented handlers in favor of a chain-of-rules based approach. This will be much more powerful and extensible, allowing rule definition by plugin and chain creation via web page. When a message is processed by the incoming queue, it gets sent through a chain of rules. The starting chain is defined on the mailing list object, and there is a built-in default starting chain, called 'built-in'. Each chain is made up of links, which describe a rule and an action, along with possibly some other information. Actions allow processing to take a detour through another chain, jump to another chain, stop processing, run a function, etc. The built-in chain essentially implements the original early part of the handler pipeline. If a message makes it through the built-in chain, it gets sent to the prep queue, where the message is decorated and such before sending out to the list membership. The 'accept' chain is what moves the message into the prep queue. There are also 'hold', 'discard', and 'reject' chains, which do what you would expect them to. There are lots of built-in rules, implementing everything from the old emergency handler to new handlers such as one not allowing empty subject headers. IMember grows an is_moderated attribute. The 'adminapproved' metadata key is renamed 'moderator_approved'. Fix some bogus uses of noreply_address to no_reply_address. Stash an 'original_size' attribute on the message after parsing its plain text. This can be used later to ensure the original message does not exceed a specified size without have to flatten the message again. The KNOWN_SPAMMERS global variable is replaced with HEADER_MATCHES. The mailing list's header_filter_rules variable is replaced with header_matches which has the same semantics as HEADER_MATCHES, but is list-specific. DEFAULT_MAIL_COMMANDS_MAX_LINES -> EMAIL_COMMANDS_MAX_LINES. Update smtplistener.py to be much better, to use maildir format instead of mbox format, to respond to RSET commands by clearing the maildir, and by silencing annoying asyncore error messages. Extend the doctest runner so that it will run .txt files in any docs subdirectory in the code tree. Add plugable keys 'mailman.mta' and 'mailman.rules'. The latter may have only one setting while the former is extensible. There are lots of doctests which should give all the gory details. Mailman/Post.py -> Mailman/inject.py and the command line usage of this module is removed. SQLALCHEMY_ECHO, which was unused, is removed. Backport the ability to specify additional footer interpolation variables by the message metadata 'decoration-data' key. can_acknowledge() defines whether a message can be responded to by the email robot. Simplify the implementation of _reset() based on Storm fixes. Be able to handle lists in Storm values. Do some reorganization.
| * Fleshed out the doctest for the new incoming queue runner.Barry Warsaw2008-02-023-2/+198
| | | | | | | | | | | | | | Added a Mailman.tests.helpers module for some commonly used stuff (although test refactoring hasn't yet happened). Give Mailman 3.0a1 a code name.
| * Convert IncomingRunner to use the new chains disposition architecture. moveBarry Warsaw2008-02-0217-227/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the big explanatory text at the beginning of incoming.py to a doctest called OVERVIEW.tt (which doesn't actually contain any tests yet -- it's documentation though). Added a doctest for the incoming runner, though this will be fleshed out in more detail next. Mailman.Post renamed to Mailman.inject, and simplified. We don't need its command line script behavior because that is now handled by bin/inject. Add a 'start_chain' attribute to mailing lists. This names the chain that processing of messages for that list begins with. We were inconsistent in the use of the 'no reply' address attribute. It's now always 'no_reply_address'. Update the smtplistener helper with lessons learned about how to suppress bogus asyncore error messages. Also, switch to using a maildir mailbox instead of an mbox mailbox.
| * Bye bye Hold handler.Barry Warsaw2008-02-011-261/+0
| |
| * SpamDetect is gone, so the chains/rules implementation experiment is deemed aBarry Warsaw2008-02-0114-232/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Reorganization.Barry Warsaw2008-01-309-9/+659
| | | | | | | | | | | | | | | | | | | | | | Create a Mailman.chains package and move a bunch of the Mailman.apps.chains classes to separate modules under this package. Also, separate out iteration from chain management. In other words, IChain and IChainIterator are separate, and the latter is retrieved from the former by the .get_links() method. This latter takes the mailing list, message, and metadata dictionary so that links can be targetted specifically to the task at hand.
| * Reorganization.Barry Warsaw2008-01-272-410/+9
| | | | | | | | | | Create a Mailman.chains package and move a bunch of the Mailman.apps.chains classes to separate modules under this package.
| * Remove an unused variable.Barry Warsaw2008-01-261-3/+0
| |
| * Port header matching previously described by the misnamed KNONW_SPAMMERSBarry Warsaw2008-01-269-132/+281
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2319-114/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-2124-385/+546
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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.
| * Merge from trunk.Barry Warsaw2008-01-148-33/+157
| |\ | |/ |/|
* | Update copyright years. Change a plugin name.Barry Warsaw2008-01-135-6/+6
| |
* | Remove dependency on SQLAlchemy.Barry Warsaw2008-01-131-1/+0
| |
* | Merge from rfc5064 branch.Barry Warsaw2008-01-138-31/+153
|\ \
| * | Add an interface IArchiver which is used to calculate urls and send messagesBarry Warsaw2008-01-138-31/+153
|/ / | | | | | | | | | | | | | | | | | | to the archiver. Also add a plugin architecture for easily overriding the archiver, and hook this into the setup.py script. Updated CookHeaders.py and Scrubber.py handlers to use the plugged archiver. Updated doctests as appropriate. Fix a typo in the setup.py file.
* | Fix the requirement for the setuptools/bzr plugin. Update a copyrightBarry Warsaw2008-01-132-3/+3
| | | | | | | | year.
| * Use a more efficient way of deleting rows from a table, which coincidentallyBarry Warsaw2008-01-1412-120/+503
| | | | | | | | <wink> works around the storm cache bug #178546.
| * Use a more efficient way of deleting rows from a table, which coincidentallyBarry Warsaw2008-01-021-2/+1
| | | | | | | | <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-014-24/+11
| | | | | | | | | | | | | | | | 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-0126-74/+57
| | | | | | | | | | | | 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-308-1/+230
| | | | | | | | | | | | | | | | | | - 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-295-97/+133
| |
| * Add a rule and doctest for newsgroup moderation.Barry Warsaw2007-12-293-4/+84
| |
| * Port the maximum message size check to a rule. Add doctest.Barry Warsaw2007-12-298-41/+110
| | | | | | | | | | | | | | | | 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-296-261/+340
| | | | | | | | | | | | 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-293-0/+0
| |
| * Convert the max-recipients check from the Hold handler to the max_recipientsBarry Warsaw2007-12-294-32/+93
| | | | | | | | rule. Add doctest as appropriate.
| * Convert the administrivia check from the Hold handler to the administriviaBarry Warsaw2007-12-297-86/+206
| | | | | | | | | | | | 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-294-1/+100
| |
| * Convert the Approve.py handler to an approved.py rule. Update the doctest toBarry Warsaw2007-12-296-248/+330
| | | | | | | | | | | | | | | | | | 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-274-57/+52
| | | | | | | | | | | | 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-278-6/+349
|/ | | | | | | | | | | | | | 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.
* Add .get() to our Message subclass, which ensures that returnedBarry Warsaw2007-12-1011-383/+340
| | | | | | | | | | | | | | | | | | | | | | | | | | values are unicodes if they come from the base class as a string. Get rid of the 'global id'. Now use just Message-ID. Rename X-List-ID-Hash to X-Message-ID-Hash. Do not take Date header into account when calculating this hash. Because of the above change, the assumption is that there will be no Message-ID collisions. Therefore, get rid of IMessageStore .get_message(), .get_messages_by_message_id() and .get_messages_by_hash(). Instead, it's now .get_message_by_id() and .get_message_by_hash() both of which return the message object or None. Message.hash -> Message.message_id_hash When storing a message in the message store, the final path component has the entire hash, not just the leftover parts after directory prefix splitting. MessageStore.delete_message() deletes the file too. Doctests clean up message store messages though the message store instead of directly off the filesystem.
* Reorganize the database subpackage, primarily by removing the 'model'Barry Warsaw2007-12-0828-184/+146
| | | | | subdirectory and updating all relevant imports. Move of the circular import problems have been eliminated in the process.
* This one took care of itself. :)Barry Warsaw2007-11-181-2/+0
|
* Convert to the Storm Python ORM <storm.canonical.com>. There were severalBarry Warsaw2007-11-1874-1394/+1404
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reasons for this, but most importantly, the changes from SQLAlchemy/Elixir 0.3 to 0.4 were substantial and caused a lot of work. This work unfortunately did not result in a working branch due to very strange and inconsistent behavior with Unicode columns. Sometimes such columns would return Unicode, sometimes 8-bit strings, with no rhyme or reason. I gave up debugging this after many hours of head scratching. Oh yeah, no more flush! Storm enforces Unicode columns, which is very nice, though requires us to add lots of 'u's in places we didn't have them before. Ultimately, this is a good thing so that the core of Mailman will be Unicode consistent. One thing I still want to clean up after this, is the function-scoped imports in the model code. Part of the reason for the separate model classes was to avoid this, but for now, we'll live with it. Storm's architecture requires us to maintain a database-table-class registry for simple clearing after tests in Database._reset(). This is made fairly simple by Storm allowing us to use our own metaclass for model classes. Storm does require that we write our own SQL files, which is a downside, but I think our schema will be easy enough that this won't be a huge burden. Plus we have a head-start <wink>. Another cool thing about Storm is the explicit use of stores for objects. This should eventually allow me to flesh out my idea of storage pillars for 1) lists, 2) users, 3) messages. Some other changes: - pylint and pyflakes cleanups - SQLALCHEMY_ENGINE_URL -> DEFAULT_DATABASE_URL - Don't import-* from Version in Defaults.py - Add interface method to Mailman.Message.Message so that __getitem__() and get_all() always return Unicode headers, even when the underlying objects are strings. This should generally be safe as headers are required by RFC to be within the ASCII range. - Fix bin/arch.py to use proper initialization.
| * Merge cleanup branchBarry Warsaw2007-11-1711-28/+29
| |\
| | * Initial pylint/pyflakes cleanupBarry Warsaw2007-11-1711-28/+27
| |/
| * Complete the port to Storm, at least as far as the current Mailman test suiteBarry Warsaw2007-11-178-118/+129
| | | | | | | | | | is concerned. This still requires a minor patch to Storm to handle timedelta types in SQLite.
| * All the simple test fixes are now in, and while there are still some failingBarry Warsaw2007-11-1016-87/+109
| | | | | | | | | | | | tests, we're making very good progress. Just the tough ones are left. This change did modify the the schema a bit, for better naming and typing. E.g. 'type' -> 'request_type' and using a RawStr for a hash type.
| * More Unicodification; fixed several more doctests.Barry Warsaw2007-11-0812-129/+146
| |