summaryrefslogtreecommitdiff
path: root/Mailman/app
Commit message (Collapse)AuthorAgeFilesLines
* Bite the bullet: rename the Mailman package to mailman.Barry Warsaw2008-02-2713-1669/+0
|
* The start of a cleaning up of Errors.py. Eventually, I want to get rid ofBarry Warsaw2008-02-191-2/+14
| | | | | | | | | this module, in favor of moving exceptions into the interface modules that they are appropriate for. For now, this is just the low-hanging fruit. Along the way, clean up by reSTifying some interfaces and implementations.
* PEP 292 style, $-strings are used by the translation service everywhere now.Barry Warsaw2008-02-184-6/+0
| | | | 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-172-11/+19
| | | | | | | | | | | | | 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-172-1/+99
| | | | | | | | | | | | | | | | 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-079-9/+9
|
* Convert IncomingRunner to use the new chains disposition architecture. moveBarry Warsaw2008-02-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | 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.
* SpamDetect is gone, so the chains/rules implementation experiment is deemed aBarry Warsaw2008-02-013-29/+9
| | | | | | | | | | | | | | | | | | | | 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-301-3/+3
| | | | | | | | | | | 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-271-410/+9
| | | | | Create a Mailman.chains package and move a bunch of the Mailman.apps.chains classes to separate modules under this package.
* Port header matching previously described by the misnamed KNONW_SPAMMERSBarry Warsaw2008-01-261-32/+159
| | | | | | | | | | | | | | | 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-232-58/+125
| | | | | | | | | | | | | 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-214-30/+77
| | | | | | | | | | | | | | | - 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-141-12/+53
|\
| * Update copyright years. Change a plugin name.Barry Warsaw2008-01-131-2/+2
| |
| * Add an interface IArchiver which is used to calculate urls and send messagesBarry Warsaw2008-01-131-12/+53
| | | | | | | | | | | | | | | | | | | | 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.
* | Use a more efficient way of deleting rows from a table, which coincidentallyBarry Warsaw2008-01-144-39/+356
| | | | | | | | <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-011-2/+2
| | | | | | | | | | | | | | | | 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-011-2/+2
| | | | | | | | | | | | 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.
* | Move the suspicious header check to a rule and add a doctest.Barry Warsaw2007-12-291-50/+0
| |
* | Port the implicit destination checking to the rules infrastructure and add aBarry Warsaw2007-12-291-51/+0
| | | | | | | | | | | | 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.
* | Convert the Approve.py handler to an approved.py rule. Update the doctest toBarry Warsaw2007-12-291-2/+20
| | | | | | | | | | | | | | | | | | 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-6/+17
| | | | | | | | | | | | 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-271-0/+35
|/ | | | | | | | | | | | | | 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-101-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Initial pylint/pyflakes cleanupBarry Warsaw2007-11-171-1/+2
|
* Complete the port to Storm, at least as far as the current Mailman test suiteBarry Warsaw2007-11-171-4/+2
| | | | | is concerned. This still requires a minor patch to Storm to handle timedelta types in SQLite.
* More Unicodification; fixed two more doctests.Barry Warsaw2007-11-081-11/+11
|
* General cleanups some of which is even tested <wink>. Mailman.LockFile moduleBarry Warsaw2007-10-101-0/+1
| | | | | | | | | | | | | is moved to Mailman.lockfile. Remove a few more MailList methods that aren't used any more, e.g. the lock related stuff, the Save() and CheckValues() methods, as well as ChangeMemberName(). Add a missing import to lifecycle.py. We no longer need withlist to unlock the mailing list. Also, expose config.db.flush() in the namespace of withlist directly, under 'flush'.
* Remove the action.py module, move this to Mailman/interfaces/__init__.py.Barry Warsaw2007-10-101-11/+12
| | | | | | Convert IMailingList.personalize to a enum. Change all non-obsolete occurances of GetListEmail() to posting_address.
* Reorganize the enums so that they live in the most appropriate interface. TheBarry Warsaw2007-10-094-6/+4
| | | | only constant left in Mailman.constants is now actually a constant.
* Reorganize the qrunner infrastructure. First, the package has been renamedBarry Warsaw2007-09-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | from Mailman.Queue to Mailman.queue (note the case change to be more PEP 8 compliant). The Switchboard and Runner classes have been moved into the package __init__.py and the previous class modules have been removed. The switchboard cache is removed; I don't think it was ultimately buying us much. Now, just import the Switchboard class and instantiate it directly. Added an IRunner interface. Renamed the ArchRunner to ArchiveRunner. bin/qrunner and bin/mailmanctl are updated accordingly. For the former, it no long accepts -r=All to run all qrunners. You can still use the short name (e.g. --runner=incoming) to run the built-in queue runners, but this design will eventually allow for plugin qrunners by allowing them to be run specifying the full package path to the class. It also now accepts a leading dot to indicate a qrunner class relative to the Mailman.queue package.
* OMGW00T: After over a decade, the MailList mixin class is gone! Well,Barry Warsaw2007-09-215-2/+290
| | | | | | | | | | | | mostly. It's no longer needed by anything in the test suite, and therefore the list manager returns database MailingList objects directly. The wrapper cruft has been removed. To accomplish this, a couple of hacks were added to the Mailman.app package, which will get cleaned up over time. The MailList module itself (and its few remaining mixins) aren't yet removed from the tree because some of the code is still not tested, and I want to leave this code around until I've finished converting it.
* Implement a context manager for Python 2.5's with statement, which isBarry Warsaw2007-09-192-15/+7
| | | | | | | | used where we used to do a try/except to temporarily change the global translation language. This makes the code shorter and cleaner. E.g. with i18n.using_language(another_language): # do something
* Finish up the request hold conversion. ListAdmin can go away thoughBarry Warsaw2007-09-162-76/+88
| | | | | | it hasn't yet. SendSubscribeAck(), SendUnsubscribeAck(), and ApprovedDeleteMember() are all removed, though the latter is not yet completely eradicated.
* Work out subscription holding and handling. ApprovedAddMember() isBarry Warsaw2007-09-162-66/+231
| | | | | | gone. Fix up OwnerNotification class. Rewrite subauth.txt and subscribeack.txt for new implementation, especially removing the password notification from the latter. Add lots of tests.
* Support forwarding of held posts.Barry Warsaw2007-09-091-1/+1
|
* ListAdmin mostly gone, but not quite.Barry Warsaw2007-09-091-0/+352
| | | | | | | | | | | | | | | | Mailman/app/moderator.py: Most of the application level interface provided by ListAdmin is moved here now, including the ability to hold messages, subscriptions, and unsubscriptions, and to handle message (defer, discard, reject, accept). More work needed. Some untested conversion of API in Mailman/Cgi/admindb.py, confirm.py, bin/checkdbs.py. messagestore.py: Don't use or require the Date: header in the global message ID calculation. As described on the mailing list, we're only going to use the Message-ID header. IListRequests: added count_of() and of_type() methods.
* Fixed a problem where members of a deleted mailing list were hanging around.Barry Warsaw2007-08-052-0/+56
| | | | | | | | | | | | | | | | | | | | This would cause duplicate members (e.g. owners) if you created, deleted and then recreated the mailing list. Mailman.app.create -> Mailman.app.lifecycle; Mailman/doc/create.txt -> Mailman/doc/lifecycle.txt; also added a remove_list() function. Added SubscriptionError base class, made HostileSubscriptionError inherit from that, and added a new AlreadySubscribedError. Rewrote bin/rmlist to use the new lifecycle.remove_list() function. IAddress.subscribe() must now throw an AlreadySubscribedError if the address is already subscribed to the mailing list with the given role. Added a Subscribers roster, attached to the IMailingList which gives access to all subscribers of a mailing list, regardless of their role. Added a new test for this roster.
* Added a doctest for the Mailman.app.create module.Barry Warsaw2007-08-052-1/+21
| | | | | | | | | | | | | | | BadListNameError is gone. Use InvalidEmailAddress instead. Move owner registration from bin/newlist to Mailman/app/create.py, but do not verified owner email addresses here. Eventually we'll hook in the IRegistrar stuff for unverified owner addresses. IStyleManager.register() verifies that its registering an IStyle. Added IStyleManager.unregister(), along with updated interfaces and doctests. Clean up all styles except the default one in the system documentation test harness.
* Added a doctest for styles.Barry Warsaw2007-08-051-2/+6
|
* It all started by trying to remove MailList.Create() and use the IListManagerBarry Warsaw2007-08-053-0/+377
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | interface to create and delete lists. Mostly that's working now, but I need unit tests for most of the new work contained in this revision. Implemented a rudimentary 'list styles' subsystem, along with interfaces, but no tests yet. Moved all of MailList.InitVars() into a DefaultStyle, which is always available at priority zero. It's used by default if there are no matching styles for a mailing list. Because of the list styles, we can now get rid of (almost) all InitVars() methods. And because of /that/ we can get rid of the mixin clases whose sole purpose was to provide an InitVars() method. Yay for code removal! Mixin modules/classes removed: Autoresponder, GatewayManager, TopicManager. Removed the Mailman/ext crufty extension mechanism. Extensions will now be done using setuptools plugins. Hopefully this will take us everywhere we need to go, but I'll add Mailman.ext back if necessary later. Mailiman.app.create module added to implement a common, higher-level list creation feature. This is used by bin/newlist now, though some of that functionality (namely, ensuring the owners exist in the database, and notifying the owners) should be moved here. The MTA plugins aren't yet integrated into this, but need to be. Mailman.app.plugins module added to generalize setuptools plugin management. Defaults.DEFAULT_REPLY_GOES_TO_LIST now gets initialized with a proper enum. Also, the duplicate DeliveryMode and DeliveryStatus enums are removed from Defaults because they're in Mailman.constants. Added Errors.DuplicateStyleError. Updated Utils.list_exists() to use the new IListManager.get() interface, which has been changed to return None if the list doesn't exist (for consistency) instead of raising an exception. Utils.list_names() also needed to be fixed to use config.db.list_manager. bin/make_instance, bin/newlist, bin/rmlist changed to use parser.error() istead of printing to sys.stderr and sys.exit(1). bin/newlist and bin/rmlist now works with the IListManager interface, so you can create and delete lists from the command line again. The CLI for newlist has been much simplified; it no longer prompts for missing positional arguments. It now uses a more traditional CLI. newlist also accepts zero to many owners, and it ensures that the owners are all in the database. It no longer asks for a list password, because this doesn't make sense any more. bin/withlist has also been fixed to work with the IListManager interface. There are lots of XXXs and FIXMEs that need to be resolved before this can land. Also, we need to test all this stuff before it can land. Configuration.load() is now taught to search in sys.argv[0] for var/etc/mailman.cfg since this is where it is for egg development layouts. Also, VAR_DIR must be abspath'd. Added an __all__ to Mailman.constants, and added an Action enum. The listmanager implementation has to set the mlist.created_at time. There's also a bit of crufty refactoring going on to instantiate the roster objects whenever the list is created or retrieved from the database. Several MailingList column types are now set to our custom TimeDeltaType, which knows how to store a datetime.timedelta. A SQLAlchemny converter type is added to Mailman.database.types. I also fixed a bug in the EnumType implementation.
* Refactor IDatabase interface so that the user_manager, list_manager,Barry Warsaw2007-08-021-9/+6
| | | | | message_store, and pendings 'databases' hang off the IDatabase object attached to the config object. For IPending, no adaptation is necessary.
* Move the pending database into the SQLAlchemy/Elixir layer. The oldBarry Warsaw2007-08-012-0/+149
Pending.py module is removed. Added an interface to this functionality such that any IPendable (essentially a key/value mapping) can be associated with a token, and that token can be confirmed and has a lifetime. Any keys and values can be stored, as long as both are unicodes. Added a doctest. Modified initialization of the database layer to support pluggability via setuptools. No longer is this layer initialized from a module, but now it's instantiated from a class that implements IDatabase. The StockDatabase class implements the SQLAchemy/Elixir layer, but this can be overridden in a setup.py. Bye bye MANAGERS_INIT_FUNCTION, we hardly knew ye. Added a package Mailman.app which will contain certain application specific functionality. Right now, the only there there is an IRegistar implementation, which didn't seem to fit anywhere else. Speaking of which, the IRegistrar interface implements all the logic related to registration and verification of email addresses. Think the equivalent of MailList.AddMember() except generalized out of a mailing list context. This latter will eventually go away. The IRegistrar sends the confirmation email. Added an IDomain interface, though the only implementation of this so far lives in the registration.txt doctest. This defines the context necessary for domain-level things, like address confirmation. A bunch of other cleanups in modules that are necessary due to the refactoring of Pending, but don't affect anything that's actually tested yet, so I won't vouch for them (except that they don't throw errors on import!). Clean up Defaults.py; also turn the functions seconds(), minutes(), hours() and days() into their datetime.timedelta equivalents. Consolidated the bogus email address exceptions. In some places where appropriate, use email 4.0 module names instead of the older brand. Switch from Mailman.Utils.unique_message_id() to email.utils.make_msgid() everywhere. This is because we need to allow sending not in the context of a mailing list (i.e. domain-wide address confirmation message). So we can't use a Message-ID generator that requires a mailing list. OTOH, this breaks Message-ID collision detection in the mail->news gateway. I'll fix that eventually. Remove the 'verified' row on the Address table. Now verification is checked by Address.verified_on not being None.