summaryrefslogtreecommitdiff
path: root/src/mailman/core (follow)
Commit message (Collapse)AuthorAgeFilesLines
* * You no longer have to edit `src/mailman/testing/testing.cfg` to run theBarry Warsaw2014-11-091-0/+8
| | | | | | | | | | | test suite against PostgreSQL. See `src/mailman/docs/START.rst` for details. Also: * Test fixes. * Doc fixes. * PostgreSQL/model fixes.
* DatabaseBarry Warsaw2014-11-012-22/+35
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -------- * The ORM layer, previously implemented with Storm, has been replaced by SQLAlchemy, thanks to the fantastic work by Abhilash Raj and Aurélien Bompard. Alembic is now used for all database schema migrations. * The new logger `mailman.database` logs any errors at the database layer. API --- * Several changes to the internal API: - `IListManager.mailing_lists` is guaranteed to be sorted in List-ID order. - `IDomains.mailing_lists` is guaranteed to be sorted in List-ID order. - Iteration over domains via the `IDomainManager` is guaranteed to be sorted by `IDomain.mail_host` order. - `ITemporaryDatabase` interface and all implementations are removed.
| * Merge in the last of Aurelien's changes, and make the test suite pass withBarry Warsaw2014-10-311-0/+4
| | | | | | | | PostgreSQL.
| * Add the [logging.database] section and use it to configure the SQLAlchemy andBarry Warsaw2014-10-121-19/+30
|/ | | | Alembic loggers.
* Use print functions consistently through, and update all __future__ imports toBarry Warsaw2014-04-287-10/+10
| | | | | | | | reflect this. Also, mock out sys.stderr on some tests so that their nose2 output is quieter. A few other minor coding style consistencies.
* Several internal improvements:Barry Warsaw2014-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | * New events: - ConfirmationNeededEvent is triggered when a pendable requiring confirmation is created. This allows us to define an event handler for this event which sends the user notification. - SubscriptionEvent is triggered when a member is added to a mailing list. This lets us define an event handler which sends the welcome message. * send_welcome_message() now takes a member parameter instead of an address, which lets us directly access the member's delivery mode and user display name (if the member has a user, which it might not in some cases). * Use the list id in the pendable record instead of the list name for robustness (the latter can change but the former is permanent). * Test more registration conditions. * In the bin/runner command line switch handling, default `verbose` to None instead of False. This makes it work better with nose's -E switch (log to stderr). * In call_api(), if a POST, PUT, or PATCH method is used and data is None, encode the empty dictionary; seems like the behavior of urlencode() has changed, so this is safer. * Fix style and pyflakes warnings.
* Bump copyright years.Barry Warsaw2014-01-0113-13/+13
|
* * When --sort is used, watch out for continuation lines, which shouldn't getBarry Warsaw2013-10-181-2/+1
| | | | | | sorted. * Fix stderr output in sub-runners, and move the -e test option to -E.
* * `bin/runner` command has been simplified and its command line optionsBarry Warsaw2013-06-171-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | reduced. Now, only one `-r/--runner` option may be provided and the round-robin feature has been removed. * Fixed REST server crash on `reopen` command. Identification and test provided by Aurélien Bompard. (LP: #1184376) Also: * bin/runner now uses standard argparse instead of ScriptOptions. * The entire bin/runner machinery has bee reorganized and simplified. There * is no more Loop class. Signal setting is moved directly into the base Runner class and overrided in specific subclasses (e.g. RESTRunner which must cleanly shutdown its TCPServer). The runner exit status is now set directly on the Runner instance. * Fixed a few minor style issues. * In order to cleanly shutdown the RESTRunner's WSGI server, we must start a subthread which only watches for an Event and then calls the server's shutdown() method. It has to be this way because the WSGI server itself (due to interactions with SQLite), and the signal handlers (due to Python's signal handling semantics) must both run in the main thread. However, the shutdown() must be invoked from a subthread in order to prevent deadlock. * Refactor the RESTLayer to eliminate duplication of code.
* - Write ./var/etc/mailman.cfg if it doesn't already exist.Barry Warsaw2013-03-201-1/+7
| | | | | | | - Use ./var/etc/mailman.cfg if it exists, just after ./mailman.cfg and just before ~/.mailman.cfg. - Add link to FHS - Whitespace normalization.
* * Non-queue runners should not create ``var/queue`` subdirectories. Fixed byBarry Warsaw2013-01-202-7/+17
|\ | | | | | | Sandesh Kumar Agrawal. (LP: #1095422)
| * changeSandesh Kumar Agrawal2013-01-171-1/+0
| |
| * Comment fixedSandesh Kumar Agrawal2013-01-171-1/+1
| |
| * Test added to non_queue_runner bugSandesh Kumar Agrawal2013-01-172-14/+16
| |
| * Fixed formation of /var/queue/* for non-queue runnersSandesh Kumar Agrawal2013-01-111-7/+6
| |
| * non-queue runner should not create var/tmp/* directorySandesh Kumar Agrawal2013-01-101-7/+16
|/
* Bump copyright years.Barry Warsaw2013-01-0113-13/+13
|
* LP: #975692 phase 1Barry Warsaw2012-12-283-3/+4
| | | | | | | | | | | | | | | | | * Rework list style management. No more style priorities or matching.. Now, you name a style explicitly to apply and that's it. * create_list() now takes a `style` argument. * config file now names both a default style to use, and a set of paths to scan for IStyle instances. (This could be a model for other plugins.) * added IMailingList.style_name to record the last style applied, but this is going to be removed in subsequent revisions. Also: * Move find_components() and scan_module() from app/finder.py to utilities/modules.py * Cleaned up lifecycle.rst for better documentation. Some tests moved to test_lifecycle.py. * Remove some unnecessary test tearDown() code.
* * Python 2.7 is not required. Python 2.6 is no longer officially supported.Barry Warsaw2012-10-313-3/+9
| | | | | The code base is now also `python2.7 -3` clean, although there are still some warnings in 3rd party dependencies. LP: #1073506
* * You can now PUT and PATCH on user resources to change the user's displayBarry Warsaw2012-09-221-0/+22
| | | | | | | | | | | | | | name or password. For passwords, you pass in the clear text password and Mailman will hash it before storing. Also: * Major refactoring of validators for PUT and PATCH. Pull the common logic out of configuration.py and put it in a PatchValidator class in helpers.py. Also move GetterSetter to helpers.py * Add new exception classes RESTError, UnknownPATCHRequestError, ReadOnlyPATCHRequestError. These are used in the PatchValidator. * Added Validator.update() which works nicely for PATCH and PUT.
* * The policy for archiving has now been collapsed into a single enum, calledBarry Warsaw2012-07-261-9/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ArchivePolicy. This describes the three states of never archive, archive privately, and archive_publicly. (LP: #967238) Database -------- * Schema migrations (LP: #971013) - include_list_post_header -> allow_list_posts - news_prefix_subject_too -> nntp_prefix_subject_too - news_moderation -> newsgroup_moderation - archive and archive_private have been collapsed into archive_policy. - nntp_host has been removed. * The PostgreSQL port of the schema accidentally added a moderation_callback column to the mailinglist table. Since this is unused in Mailman, it was simply commented out of the base schema for PostgreSQL.
| * Refactor to better handling the difference between a testing database and aBarry Warsaw2012-07-251-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | production database. - Add an IDatabaseFactory interface with two named utility implementations. The initialization subsystem will either ask for the 'testing' or 'production' factory utility depending on whether we're in the test suite or not. The testing factory returns an IDatabase that can be _reset(). - initialize_2() now takes an optional `testing` argument, defaulting to False. The test ConfigLayer will pass in True. - Remove _reset() from the base database class. - The ModelMeta now adds a PRESERVE attribute to database classes. This defaults to False, meaning by default the test framework will reset the table. The Version table is preserved because it records the schema migrations. - Because of the above, we no longer need to support pre_reset() and post_reset() on migrations. Also, bin/mailman should allow the standard configuration file search algorithm to be used except when -C/--config is given.
| * trunk mergeBarry Warsaw2012-07-069-39/+147
| |\ | |/ |/|
* | More consistency in the way post-configuration changes are processed. LessBarry Warsaw2012-07-023-17/+27
| | | | | | | | | | | | | | | | | | | | magic in the _post_process() method, more ConfigurationUpdatedEvents. More centralization of event initialization. Added property Configuration.language_configs. Instead of initializing events in initialize_2(), initialize them in initialize_1() and do it before the configuration is loaded.
* | * `passlib`_ is now used for all password hashing instead of flufl.password.Barry Warsaw2012-07-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default hash is `sha512_crypt`. * Events renamed and moved: * `mailman.chains.accept.AcceptNotification` * `mailman.chains.base.ChainNotification` * `mailman.chains.discard.DiscardNotification` * `mailman.chains.hold.HoldNotification` * `mailman.chains.owner.OwnerNotification` * `mailman.chains.reject.RejectNotification` changed to (respectively): * `mailman.interfaces.chains.AcceptEvent` * `mailman.interfaces.chains.ChainEvent` * `mailman.interfaces.chains.DiscardEvent` * `mailman.interfaces.chains.HoldEvent` * `mailman.interfaces.chains.AcceptOwnerEvent` * `mailman.interfaces.chains.RejectEvent` * A `ConfigurationUpdatedEvent` is triggered when the system-wide global configuration stack is pushed or popped. * With the switch to `passlib`_, `[passwords]password_scheme` has been removed. Instead use `[passwords]path` to specify where to find the `passlib.cfg` file. See the comments in `schema.cfg` for details.
* | Add a test to ensure that the re-raising of the exception occurs.Barry Warsaw2012-05-111-3/+7
| |
* | * When a queue runner gets an exception in its _dispose() method, aBarry Warsaw2012-05-112-2/+93
| | | | | | | | | | | | `RunnerCrashEvent` is triggered, which contains references to the queue runner, mailing list, message, metadata, and exception. Interested parties can subscribe to that `zope.event` for notification.
* | General code cleanup.Barry Warsaw2012-04-256-22/+21
| | | | | | | | | | | | | | | | - Add explicit dependency on zope.event in setup.py. - Use Python 3 compatible syntax for specifying that a class implements an interface, i.e. the @implementer class decorator. - print_function futures. - Whitespace normalization.
| * - Refactor the way databases are schema-migrated so that load_migrations()Barry Warsaw2012-04-081-0/+3
|/ | | | | | | | | | | | | | | can be tested separately. - Add an `until` argument to load_migrations() so that we can load only up to a given timestamp. - In load_migrations(), ignore files in which the `version` part of the file name is empty. - In migrations.rst, use the new, better way of ensuring post-test cleanup. - Add tests for partial upgrades. - LP: #971013 - schema migrations for beta 2. - LP: #967238 - IMailingList.archive + IMailingList.archive_private -> IMailingList.archive_policy, and add ArchivePolicy enum. - Move the `chdir` context manager to helpers.py and add `temporary_db` context manager.
* ArchitectureBarry Warsaw2012-03-261-2/+1
| | | | | | | | | | | | | | | | | | | ------------ * Internally, all datetimes are kept in the UTC timezone, however because of LP: #280708, they are stored in the database in naive format. * `received_time` is now added to the message metadata by the LMTP runner instead of by `Switchboard.enqueue()`. This latter no longer depends on `received_time` in the metadata. * The `ArchiveRunner` no longer acquires a lock before it calls the individual archiver implementations, since not all of them need a lock. If they do, the implementations must acquire said lock themselves. Configuration ------------- * New configuration variables `clobber_date` and `clobber_skew` supported in every `[archiver.<name>]` section. These are used to determine under what circumstances a message destined for a specific archiver should have its `Date:` header clobbered.
* Add the OwnerPipeline, with tests, and rename some things for consistency.Barry Warsaw2012-03-232-7/+68
|
* Rename the member recipients calculating handler to make way for the ownerBarry Warsaw2012-03-231-1/+1
| | | | recipients handler.
* Rename the src/mailman/pipeline directory to src/mailman/handlers since that'sBarry Warsaw2012-03-231-1/+1
| | | | how I think about them anyway.
* * Pipermail has been eradicated.Barry Warsaw2012-03-163-27/+100
| | | | | | | | | | | | * Configuration variable `[mailman]filtered_messages_are_preservable` controls whether messages which have their top-level `Content-Type` filtered out can be preserved in the `bad` queue by list owners. * Configuration section `[scrubber]` removed, as is the scrubber handler. This handler was essentially incompatible with Mailman 3 since it required coordination with Pipermail to store attachments on disk. * Schema additions: - mailinglist.filter_action
* Eradicate Pipermail. Everything but the scrubber test works. That will takeBarry Warsaw2012-03-151-3/+1
| | | | some new APIs I suspect.
* * Mailing lists get multiple chains and pipelines. For example, normalBarry Warsaw2012-03-073-4/+5
| | | | | | | | | | | postings go through the `posting_chain` while messages to owners to through `owners_chain`. The default `built-in` chain is renamed to `default-posting-chain` while the `built-in` pipeline is renamed `default-posting-pipeline`. * Schema changes: - start_chain -> posting_chain - pipeline -> posting_pipeline
* Restore the RFC 2369 headers to accepted list posts.Barry Warsaw2012-03-013-0/+63
|
* * The `mailman.cfg` configuration file will now automatically be detected ifBarry Warsaw2012-02-271-4/+11
| | | | it exists in an `etc` directory which is a sibling of argv0.
* * The `confirm` email command now properly handles `Re:`-like prefixes, evenBarry Warsaw2012-02-261-2/+2
| | | | | | | | | | | | if they contain non-ASCII characters. (LP: #685261) Also: - When the registrar confirms an email address, the verified_on value gets set using the Mailman datetime interface. This simply improves testability for that API. - In Runner._one_iteration(), be sure to commit the database transaction *before* calling _short_circuit().
* copybumpBarry Warsaw2012-01-0111-11/+11
|
* A couple of small cleanups.Barry Warsaw2011-11-041-4/+1
|
* * Fix a couple of spelling errors.Barry Warsaw2011-11-021-2/+2
| | | | | | * Code cleanup (<> -> != ... sigh) * Minor refactoring of database setup code so that touch() is moved to the SQLiteDatabase class; it's not relevant for PostgreSQL.
* * `bin/mailman start --force` option is fixed. (LP: #869317)Barry Warsaw2011-10-161-10/+14
| | | | | | | | | | | | * acquire_lock_1(): No need to unlink the tempfile * Start.process(): Don't print error message when the lock is in stale_lock or host_mismatch status and --force has been given. * control.rst: Refactor test code into test_control.py. * test_create.py: To more accurately mimic argparse, FakeParser.error() needs to `sys.exit(1)`. The `SystemExit` must also be caught in the appropriate tests. * logging.py: Locking is now down by the flufl.lock package, so apply the `mailman.lock` configuration to it.
* Finally, all doctests are named .rstBarry Warsaw2011-09-231-0/+0
|
* * Moderating a message with Action.accept now sends the message. (LP: #827697)Barry Warsaw2011-08-221-0/+7
| | | | | | | | | | | Also: * Use utilities.datetime.now() so that moderation related dates are predictable during the test suite. * When a message is accepted, drop it in the pipeline queue. The above bug was caused by the message going in the incoming queue, and then being re-moderated. * Expose mailman.bin.master.Loop in __all__. * Add some helpful debug logging.
* Basic infrastructure for fixing bug 827036.Barry Warsaw2011-08-171-0/+2
| | | | | | | | | * Use zope.events to signal when a mailing list has been created or deleted. * Register a handler for the ListDeletedEvent which cleans up member subscriptions. * Relax the criteria for find_members(), both internally and in the REST API, so that the subscriber is not required. E.g. you can now find all members of a mailing list.
* Remove all pylint vestiges.Barry Warsaw2011-08-032-6/+0
|
* Major terminology shift:Barry Warsaw2011-06-014-28/+30
| | | | | | | | | | | | | | | | | * Queue runners are now called just 'Runners' since several of them don't manage queue directories. * Ban the term 'qrunner' too. * The master queue runner watcher should now just be called the 'master' or the 'master runner'. * bin/qrunner -> bin/runner * mailman.qrunner log file -> mailman.runner * master-qrunner.lck -> master.lck * master-qrunner.pid -> master.pid Also: * Remove some obsolete files * Begin the .txt -> .rst renaming
* Rename 'queue' directory to 'runners' since not all subprocesses run a queue.Barry Warsaw2011-05-295-0/+778
|
* Test (and fix!) the path in the outgoing runner where a socket.error getsBarry Warsaw2011-05-171-3/+3
| | | | | | raised during the delivery function. Modify the ReopenableFileHandler so that the filename is a public attribute.