summaryrefslogtreecommitdiff
path: root/Mailman (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * Add setuptools plug-in entry point for defining different database backends.Barry Warsaw2007-07-244-37/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now someone could distribute a setuptools package that provided say, a MySQL database implementation and very easily override the stock database. How awesome is setuptools? Removed MANAGERS_INIT_FUNCTION since setuptools gives us a much more standard way of defining this plug-in entry point. Remove other old crud from Defaults.py. Restructure our own 'stock' database backend to be a plugin so it's totally on par with any other package. The only special case is that if more than one such entry point is defined, we filter out the 'stock' one (i.e. ours) under the assumption that the user is overriding it. If we still have more than one plug-in, it's an error. Restructure the initialization subsystem to use the plug-in, doing all the proper assertions and what not. The IDatabase interface defines what the database back-end plugin must provide. I've no doubt this will eventually need a bit more fleshing out, but it gives all this stuff a principled hook point instead of something ad-hoc.
* | Remove an empty fileBarry Warsaw2007-07-231-0/+0
| |
* | Remove last vestiges of dbcontextBarry Warsaw2007-07-232-175/+0
| |
* | The start of a message store definition. Whether this will end up being usedBarry Warsaw2007-07-228-1/+445
|/ | | | | | | | | | | | | | | | | | | | for the archive or not is left to be seen. Define an interface, test, and implementation of a basic message store using globally unique identifiers of the form: archive/hash/seqno - archive is the base url of the archive, e.g. http://archives.example.com. This is available in the List-Archive header. - hash is the base32 encoded sha1 hash of the message's Message-ID and Date headers, which it must have. This is available in the X-List-ID-Hash header. - seqno is a sequence number specific to the archive which will uniquely identify the message should there be a Message-ID/Date collision. this is available in the X-List-Sequence-Number header. Added a MESSAGES_DIR variable to the config. Added a .message_store attribute to the config.
* Merge the setuptools branch. Fix a couple of test modules that areBarry Warsaw2007-07-21303-1832/+491338
|\ | | | | | | disabled anyway.
| * Remove some obsolete command line scripts:Barry Warsaw2007-07-213-3/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - bin/check_dbs because there are no more pickles - bin/convert because in MM3 everything will use $-strings and we'll do the conversion on import of the old list data - bin/mmshell because setuptools provides its own equivalent - bin/qrunner and bin/mailmanctl because the files were empty There are a bunch of scripts still left in bin/ which will eventually get removed. I'm leaving them for now because they're either helpers generally tangential to Mailman (msgfmt, po2template, pygettext, templ2pot, transcheck), or are using old interfaces that will go away soon (clone_member, convert, discard, fix_url, list_admins, remove_members, reset_pw, sync_members). Also moved bin/cleanarch into Mailman/bin/cleanarch.py and updated it to use optparse. Also added a small patch to genalias to standardize its help printing.
| * The Mailman/bin package's __all__ now contains the list of all command lineBarry Warsaw2007-07-181-0/+59
| | | | | | | | | | | | | | | | scripts, and setup will use this to create the console_scripts list. Put the scripts in their own bin directory so that the installation directory isn't all cluttered up. While the reduced clutter is great, the downside is that PYTHONPATH has to be specified, and 'bin' should really be configurable.
| * More work on completing the transition to setuptools.Barry Warsaw2007-07-18111-42/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Mailman/testing -> Mailman/test * Removed Mailman/testing/base.py * Fix mailmanctl by using a different way of calculating where the qrunner script is. The configuration file no longer knows what BIN_DIR is, but the mailmanctl script knows where it lives via sys.argv[0]. Also, PREFIX_DIR -> VAR_DIR. Also, * Since the overwhelmingly predominant use of ILanguageManager is to get the description, and since .get_language_data(code)[0] is not very readable, split the interface into .get_description() and .get_charset(). * In the setup, automatically add all Mailman.bin modules as command line scripts.
| * A few more i18n digest fixesBarry Warsaw2007-07-171-3/+3
| |
| * Major surgery to get the setuptools based installation passing all theBarry Warsaw2007-07-16162-228/+490280
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | existing unit tests. Here's a summary of the changes. - Removed all dependent third party packages, since the setup.py file now claims all package dependencies such that they can be automatically installed from the cheeseshop. - Moved the misc directory into the Mailman package as Mailman/data. Moved templates and messages to Mailman subpackages. - Added an ILanguageManager interface, plus an implementation, so that we don't use Defaults.LC_DESCRIPTIONS directly anymore. Added a doctest for this interface and implementation. Defaults.LANGUAGES is moved into mailman.cfg. Defaults.LANGUAGE_DICT is moved to _DEFAULT_LANGUAGE_DATA, and LC_DESCRIPTIONS is removed. The calculation of the available and enabled languages is moved to the Configuration class, but this will probably still need work. Utils.GetLanguageDescr() and Utils.IsLanguage() are removed. I'd like to remove GetCharSet() eventually too, but there are too many uses of this currently, so I'm deferring it. - Utils.findtext(): Hacks added so that templates can be retrieved from the language catalog. The hack is that the template contents are used to find the translation, but in the one test case where this is actually flexed, the trailing newline in the file contents has to be trimmed. This is probably not right. - No more Defaults.py.in or mm_cfg.py! Defaults.py.in is moved to Defaults.py and is no longer created from a template file. The script called make_instance is added which creates an etc/mailman.cfg file from mailman.cfg.in (previously, mailman.cfg.sample) and /that/ file now has the small number of calculated values. In general, make_instance will not touch mailman.cfg if it exists, unless the --force option is given. CGIEXT is made the empty string by default (i.e. not generated). make_instance grows a --var-dir option. Fleshed out the --languages opton. - Defaults.py grows a DEFAULT_VAR_DIRECTORY variable, which is the default location of the 'var' directory. The Configuration class uses this as one of the directories it searches for its landmark, i.e. etc/mailman.cfg. RUNTIME_DIR is gone, as is VAR_PREFIX. - testall needs to write MAILMAN_USER, MAILMAN_UID, MAILMAN_GROUP, MAILMAN_GID, and LANGUAGES run time variables. - bin/withlist no longer needs to add config.BIN_DIR to sys.path, because in fact that variable doesn't exist any more. - Tweak the French catalog to make a test work. This is needed because of the conversion from %-strings to $-strings. - The setup.py now generates the .mo files before it does its thing. This will have to be fixed, but for now we must generate these files on setup build time instead of installation time. - Removed an unused interface.
| * Other than contrib files, convert all imports of mm_cfg to imports of config.Barry Warsaw2007-07-1430-431/+444
| | | | | | | | | | | | | | | | | | | | | | Ignore mailman.egg-info In bin/make_instance.py: Catch and ignore import errors when importing Mailman.i18n. Before this script has actually been run, there won't be enough infrastructure in place of the import to succeed. Include several other fixes in this file. Add install_requires to the setup script.
| * The start of a setuptools conversion. All the Makefile.in and autoconfBarry Warsaw2007-07-1322-1430/+161
| | | | | | | | artifacts are removed, as is the C files which we will no longer need.
* | Detect 'who' with 1 or 2 arguments as administrivia.Mark Sapiro2007-07-171-1/+1
|/
* Last bit of existing test suite cleanup for now. I've removed the inmemory.pyBarry Warsaw2007-07-123-400/+4
| | | | | | | module since we're not using that any more. I've also disabled the remaining failing tests in test_handlers and test_security_mgr. Because of the unified user database, both of these modules will change significantly, but I don't want to remove them just yet.
* Convert the Scrubber test to a doctest, and fix Scrubber.py, but otherwiseBarry Warsaw2007-07-123-119/+231
| | | | | | | | don't modernize the Scrubber handler. The is the last of the handler test conversions until we figure out what to do with the Approve handler. In a unified user database the semantics of this are unclear.
* Convert ToArchive tests to doctests and do a minimal amount of handler moduleBarry Warsaw2007-07-113-61/+142
| | | | cleanup (really, not much was necessary).
* Conversion of the ToDigest tests to doctests, along with just enough handlerBarry Warsaw2007-07-106-145/+587
| | | | | | | | | module update to make the thing pass. Much more coverage is still necessary, but this at least recreates the existing tests. Changes to the test infrastructure to make REPORT_ONLY_FIRST_FAILURE conditional on lower (default) verbosity. Increase the verbosity via 'bin/testall -v' and you get all the failure output.
* Convert ToOutgoing handler to a doctest. Minor cleanup of the handler code toBarry Warsaw2007-07-083-43/+151
| | | | a more modern Python style.
* Convert the ToUsenet handlerto a doctest. No other handler clean up isBarry Warsaw2007-07-062-50/+75
| | | | included.
* Convert MimeDel tests to doctest. No other changes to the handler module areBarry Warsaw2007-07-052-176/+353
| | | | made.
* Convert the SpamDetect handler tests (what there was of them anyway) to aBarry Warsaw2007-07-052-38/+75
| | | | doctest, but don't otherwise clean up the handler module.
* Convert the TestTagger to a doctest. No other cleaning up of the handlerBarry Warsaw2007-07-042-117/+244
| | | | module is done.
* Convert TestHold to a doctest and update code as necessary. No generalBarry Warsaw2007-07-036-181/+397
| | | | modernization of Hold.py was performed.
* Convert TestFileRecips to a doctest, and update the handler to more modernBarry Warsaw2007-07-024-101/+115
| | | | | | | | Python idioms. The recipients are now returned as a set instead of a list, so duplicates are quashed. In MailList.InitTempVars() we need to create the list's data directory when the list is initialized. If the directory already exists, this does nothing.
* Convert failing test_message.py to doctests bounces.txt and message.txt, whichBarry Warsaw2007-07-016-105/+169
| | | | | | | | | | | | | of course now succeed. Rename Bouncer.py's BounceMessage() method to bounce_message() and remove the 'msgdata' parameter, which wasn't being used. Change the RejectNotice exception class to expose .notice directly, as there's no reason for this to be an accessor or property. Move the coverage.py installation to the install-packages target instead of the install-other target, so that it only gets installed once the pythonlib directory is created.
* Add support for code coverage with 'testall --coverage'. However, I'm notBarry Warsaw2007-07-011-1/+20
| | | | | | | | | convinced this is totally accurate as a full test run shows almost no coverage in the Mailman.database.model modules even though I /know/ they're getting executed. I'll need to figure this out, but eventually we'll convert fully to setuptools and then we'll use the nosetests to do testing and coverage.
* Support for case-preserving addresses. When an Address is given an emailBarry Warsaw2007-07-016-13/+108
| | | | | | | | | | | | | | | | | | address that is not lower cased, the original, case-preserved version is store on the '_original' attribute. The lower-cased version is always used as the key and thus always stored on the 'address' attribute. The IAddress interface is given a new 'original_address' property which returns the case-preserved version. Address's __str__() and __repr__() are similarly modified. The former always includes the case-preserved address; the latter does too, but now also includes the lower-cased 'key' email address (along with the object's id). Searching for an address always does so on the lower-cased version. Test suite is updated as necessary. Also, I'm adding the REPORT_ONLY_FIRST_FAILURE doctest flag so that it's easier to debug doctest failures without having pages of problems to scroll through.
* Cleaned up a couple of style issues. No actual code changes.Mark Sapiro2007-06-281-6/+7
|
* check_perms checked archives/private/ and archives/private/<list>/database/Mark Sapiro2007-06-281-10/+16
| | | | | | directories to make sure they didn't have certain 'other' permissions, but it didn't check these directories for the necessary user and group permissions. This is now fixed.
* Convert the rest of test_runners.py to doctests; even though incomplete, theyBarry Warsaw2007-06-289-228/+236
| | | | | | | | | | | | | | | | | | | | | | test everything the old unit tests tested. There are XXX's left in the doctests as reminders to flesh them out. Change the NNTP_REWRITE_DUPLICATE_HEADERS to use proper capitalization. Revert a change I made in the conversion of the Switchboard class: Switchboard.files is no longer a generator. The Runner implementation is cleaner if this returns a concrete list, so that's what it does now. Update the tests to reflect that. The Runner simplifies now too because it no longer needs _open_files() or the _listcache WeakValueDictionary. The standard list manager handles all this now, so just use it directly. Also change the way the Runner sets the language context in _onefile(). It still tries to set it to the preferred language of the sender, if the sender is a member of the list. Otherwise it sets it to the list's preferred language, not the system's preferred language. Removed a conditional that can't possibly happen.
* Repair docfiles broken with the new ISwitchboard interface. Mostly these wereBarry Warsaw2007-06-273-28/+37
| | | | | | | | | | due to the change from the method Switchboard.files() to the generator property Switchboard.files. Add support in cleaning_teardown() for the doctests for removing all queue files leftover after a test is complete. This way, failures in one test that queues files won't break all subsequent such tests. Update the 2.1.9 section of the NEWS.txt file from the Mailman 2.1 branch.
* Convert the Switchboard test in test_runners.py to a doctest. Add anBarry Warsaw2007-06-278-162/+341
| | | | | | | | | | | | | | | ISwitchboard interface and modernize the Python code in the Switchboard.py implementation. The SAVE_MSGS_AS_PICKLES option is removed. Messages are always saved as pickles unless the metadata '_plaintext' key is present, though this should eventually go away too. In testall.py, put the entire VAR_PREFIX in a temporary directory. This helps the switchboard tests by not mixing their data with the installation's queue directories. The Configuration object now also ensures that all the queue and log directories exist -- one more step on the road to getting rid of the autoconf mess.
* Simplify doctests by having just a single test_documentation.py module inBarry Warsaw2007-06-2316-393/+69
| | | | | Mailman/testing. This introspects the Mailman/docs directory and adds DocFileSuites for all .txt files found there.
* merging 3.0Barry Warsaw2007-06-222-14/+20
|\
| * Scrubber.py - Malformed RFC 2047 encoded filename= parameter can haveMark Sapiro2007-06-222-14/+20
| | | | | | | | | | | | | | | | a null byte or other garbage in the extension. Cleaned this. - Improved handling of None payloads. - Cleaned up a few charset coercions. OutgoingRunner.py - Made probe bounce processing and queuing of bounces conditional on having some permanent failure(s).
* | Refactor tests to get consistent clean up behavior. The clean up sectionsBarry Warsaw2007-06-2230-265/+64
| | | | | | | | | | have been removed from the .txt files and instead added to the test harness, which all doctests now use.
* | Merge temporary Elixir model branch to the 3.0 trunk. Some tests are failingBarry Warsaw2007-06-2256-1573/+2947
|\ \ | |/ |/| | | now so I have to fix these before pushing the branch up.
| * Convert the AvoidDuplicates handler tests to a doctest. Well,Barry Warsaw2007-06-213-32/+250
| | | | | | | | | | | | | | actually there /was/ no separate AvoidDuplicates test, but now there is, even though it may not be full coverage. Update the AvoidDuplicates handler to use more modern Python idioms.
| * Convert the CookHeaders tests in test_handlers to using doctests, split upBarry Warsaw2007-06-2110-385/+847
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into several sub-documents. Defaults.py.in: Removed OLD_STYLE_PREFIXING. So-called 'new style' prefixing is the default and only option now. CookHeaders.py is updated to the new API and some (but not all) of the code has been updated to more modern Python idioms. reply_goes_to_list attribute has been changed from a strict integer to a munepy enum called ReplyToMunging. RFC 2369 headers List-Subscribe and List-Unsubscribe now use the preferred -join and -leave addresses instead of the -request address with a subject value.
| * Convert the Cleanse handler tests to doctest style.Barry Warsaw2007-06-194-68/+145
| |
| * Convert the tests for the CalcRecips handler to doc tests. There areBarry Warsaw2007-06-1910-130/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | some XXX's in the doc test because digest recipients aren't tested (though those may go in a different doctest), and neither are urgent messages. This latter is for the same reason that the Approved handler is not yet tested; which password do you use in that header? The CalcRecips tests would also seem the natural place to test the receive_list_copy preference, but that actually gets processed in the AvoidDuplicates handler, so it isn't tested here. Add delivery_status (of type enum DeliveryStatus) to preferences. I'm not entirely sure that's the right place for it, but it lets me finish converting the test for now. Expose the rest of the preferences through the IMember interface.
| * Convert the AfterDelivery handler test to a doctest. Also, change theBarry Warsaw2007-06-186-17/+88
| | | | | | | | | | MailingList.last_post_time column to a DateTime (i.e. Python datetime object).
| * Remove both the model and interface for RosterSets. These are no longer usedBarry Warsaw2007-06-1813-283/+425
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | or necessary in the current data model. Convert the test_handlers.py Python test to an acknowledge.txt doctest, and make the Acknowledge.py handler work with the new data model. There are a few XXX comments left in here due to the fact that the web stuff is a total hack in the current branch currently. Added IMailingListWeb methods and properties to the MailingList model class: web_host and script_url(). Work out how IMembers will expose the lookup-order based preferences. By getting the attribute IMember.preferences you can see exactly the preferences overridden by this member. To use the lookup order, use IMember.delivery_mode, IMember.acknowledge_posts, etc. IOW, the IMember interface now provides the properties directly and access through this mechanism supports lookup order with definitive preference values. Also added IMember.unsubscribe() which does the obvious, and IMember.options_url() which is a total hack for providing a url (but not the ultimately right one) for the user's option page. Refactor the model's roster classes. Also added IRoster.get_member() method with efficient queries to return the right results. Make AdministratorRoster.members more efficient due to a better query. Update the membership.txt doctest to eliminate a chance ordering effect, and also to test finding members with .get_member(). The clean up section uses the new .unsubscribe() method.
| * profile.py -> preferences.pyBarry Warsaw2007-06-157-5/+8
| | | | | | | | | | Fix the last few doctests by ensuring that other newly created Addresses have a preferences object.
| * merge work from other machineBarry Warsaw2007-06-1514-120/+171
| |\
| | * Update the IUser interface and tests, specifically as it relates toBarry Warsaw2007-06-1514-120/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | preferences. IAddresses, IUsers, and IMembers all get preferences by default, althoughthe attributes of these preferences are None by default. IMailingLists don't get preferences by default though; because these live in the user database, we can't cross-polinate them in the mailing lists. We'll figure something out later for these. IUser.register(): Add this method which registers and links an address to the user. Allow EnumType database columns to accept and return Nones. This is useful for when the columns are not defined NOT NULL. Update doctests. Removed teh hide_address preference. I can't think of a reason not to want to hide addresses for everyone.
| * | merge upstream trunkBarry Warsaw2007-06-111-5/+21
| |\ \ | | |/ | |/|
| * | More test updates based on simplified data model. Rosters are gone so theBarry Warsaw2007-06-1010-301/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mlist-rosters.txt tests are removed. Give MailingList entities a Preferences foreign key, so that they now have preferences. Member.preferences(): Watch out for unlinked addresses, i.e. which have no user and thus no user preferences. Address.controls() takes a text email address, not an IAddress. UserManager: add create_address(), delete_address(), get_address(), and 'addresses' property. Updated the address.txt and user.txt doctests as needed. Added User.register() to register an email address and immediately link it to a user.
| * | Repair the usermanager.txt and listmanager.txt doc tests. These repairs wereBarry Warsaw2007-06-096-80/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | necessary to deal with the simplified user model. Eradicate more references to rosters and roster sets. Give Users a repr. Also give them a belongs_to() link to Preferences, but change the user manager to not give a user preferences by default (the lookup schema should properly handle users with no preferences now). Also, when creating a user, set their real_name to the empty string if no real_name argument was given to create_user(). Update the IUserManager interface's create_user() method to match the implementation.
| * | Implement the new, simplified membership model. Rosters and RosterSets asBarry Warsaw2007-06-0921-293/+569
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | they were previously known are now gone. Rosters, rather than being a database entity that collects users, is now just a filter on the member database. This way, we can use generic rosters to search for regular members, digest members, owners, or moderators. More advanced rosters can do all kinds of other membership queries. But rosters no longer need to be a database entity. Users have a name, password, optional preferences, and a set of addresses, but users are not subscribed to mailing lists. Addresses have the email address, some verification information, and optional preferences. Members tie an address to a mailing list, through a role, with optional preferences. Other changes here include: MailList.fqdn_listname() moved to the MailingList model entity. Added MemberRole enum and SystemDefaultPreferences to Mailman.constants. Profiles are renamed to Preferences (same with the interface), but the files are not yet moved. This happens later. We mostly don't need has_*() relationships on the entity classes, because we generally don't need the reverse relationship. Use belongs_to() because that creates the foreign key, even though the wording seems counter intuitive. IAddress.subscribe() added. Tell Elixir to use shortnames for all tables. Remove the OldStyleMembership fields from MailingList. Remove all the interface elements and database fields that talk about rosters and rostersets. Convert Version entity to has_field().