summaryrefslogtreecommitdiff
path: root/Mailman/bin
Commit message (Collapse)AuthorAgeFilesLines
* Bite the bullet: rename the Mailman package to mailman.Barry Warsaw2008-02-2745-7364/+0
|
* Rework the master.py script and the master.txt doctest so that it's muchBarry Warsaw2008-02-273-126/+161
| | | | | | easier to test, and to use in other tests. Do this by moving most of the guts of master.py into a class that can be subclassed, and thus run in a subthread to avoid blocking the test. We don't need to sleep anymore.
* Add a test for mailmanctl and master.py. Also fix a bug in master where itBarry Warsaw2008-02-262-1/+29
| | | | wasn't waiting on all the children before it exited itself.
* Update mailmanctl for the new master.py script. Fortunately, we can simplifyBarry Warsaw2008-02-252-364/+91
| | | | | | | | | | | this considerably, since it now just checks the permissions, handles command parsing, and then just (in the child) execs master.py. master.py handles the log files, etc. Added 'BIN_DIR' to the configuration object. Remove references to instance.cfg in the comments; that was never implemented. I still need tests for both mailmanctl and master.
* Rework the basic infrastructure for qrunner process control. Split out theBarry Warsaw2008-02-255-42/+441
| | | | | | | | | | | | | | | | | | | | | | | | functionality of mailmanctl into a separate master watcher script. mailmanctl has not yet been updated but that'll happen next. Fix DELIVERY_MODULE to name a handler instead of a module. Change make_instance to use pkg_resources instead of module.__file__. Change the qrunner and master processes coordination so that the qrunners are not restarted on SIGINT, because otherwise C-c just doesn't work. Now SIGUSR1 is how we'll implement 'mailman restart'. Add a database commit so that initializing the schema doesn't lock the sqlite database. Also, don't try to initialize the schema if the tables already exist. Use some sqlite magic to do this test. Move mailman.cfg.in into a new package Mailman/extras inside the tree. Also, MAILMAN_UID and MAILMAN_GID should be integers not strings. Convert the command runner to use an IHandler instance instead of handler module. Similarly for the outgoing runner, DELIVERY_MODULE now names an IHandler instance instead of a handler module.
* The start of a cleaning up of Errors.py. Eventually, I want to get rid ofBarry Warsaw2008-02-191-1/+3
| | | | | | | | | 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-1840-66/+1
| | | | No more %-strings. Kill off all __i18n_templates__ hacks.
* Tweak copyright years.Barry Warsaw2008-02-0743-43/+43
|
* Convert IncomingRunner to use the new chains disposition architecture. moveBarry Warsaw2008-02-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | 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.
* Initial pylint/pyflakes cleanupBarry Warsaw2007-11-174-12/+16
|
* Much progress, though not perfect, on migrating to SQLAlchemy 0.4 and ElixirBarry Warsaw2007-10-315-69/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0.4. Lots of things changes, which broke lots of our code. There are still a couple of failures in the test suite that I don't understand. It seems that for pending.txt and requests.txt, sometimes strings come back from the database as 8-bit strings and other times as unicodes. It's impossible to make these tests work both separately and together. users.txt is also failing intermittently. Lots of different behavior between running the full test suite all together and running individual tests. Sigh. Note also that actually, Elixir 0.4.0 doesn't work for us. There's a bug in that version that prevented zope.interfaces and Elixir working together. Get the latest 0.4.0 from source to fix this. Other changes include: - Remove Mailman/lockfile.py. While I haven't totally eliminated locking, I have released the lockfile as a separate Python package called locknix, which Mailman 3.0 now depends on. - Renamed Mailman/interfaces/messagestore.py and added an IMessage interface. - bin/testall raises turns on SQLALCHEMY_ECHO when the verbosity is above 3 (that's three -v's because the default verbosity is 1). - add_domain() in config files now allows url_host to be optional. If not given, it defaults to email_host. - Added a non-public interface IDatabase._reset() used by the test suite to zap the database between doctests. Added an implementation in the model which just runs through all rows in all entities, deleting them. - [I]Pending renamed to [I]Pended - Don't allow Pendings.add() to infloop. - In the model's User impelementations, we don't need to append or remove the address when linking and unlinking. By setting the address.user attribute, SQLAlchemy appears to do the right thing, though I'm not 100% sure of that (see the above mentioned failures).
* General cleanups some of which is even tested <wink>. Mailman.LockFile moduleBarry Warsaw2007-10-104-101/+57
| | | | | | | | | | | | | 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-102-4/+4
| | | | | | 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-093-3/+3
| | | | only constant left in Mailman.constants is now actually a constant.
* Remove an unnecessary (and now broken) import.Barry Warsaw2007-10-051-2/+1
| | | | Lower case the list name before calling remove_list().
* Reorganize the qrunner infrastructure. First, the package has been renamedBarry Warsaw2007-09-2910-39/+48
| | | | | | | | | | | | | | | | | | | | | | 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.
* qrunner, mailmanctl and various other repairs.Barry Warsaw2007-09-293-20/+21
| | | | | | | | | | | | The convenience methods in Defaults for getting seconds, minutes, hours, and days now returns a subtype of timedelta, which provides conversion to float and int for compatibility with interfaces that require those values (e.g. signal.alarm() and time.sleep(). In bin/make_instance, the var_dir really needs to be an absolute path, otherwise it's possible to get a var dir nested inside the var dir. More MailList object eradication.
* Removed a bunch of files that are obsolete. The interfaces are all foldedBarry Warsaw2007-09-275-3/+187
| | | | | | | | | | | | | into the IMailingList interface. OTOH, MemberAdaptor.py is completely useless now (though not entirely eradicated), as is OldStyleMemberships.py. versions.py isn't necessary any longer either because we'll have to do database migrations (and conversions from MM2.1) completely differently. New command line script 'set_members' which is used to take a CSV file and syncing that to a list's membership. Added back the DeliveryStatus.unknown item because we'll need it when we migrate MM 2.1 databases.
* Get bin/add_members and bin/list_members to work again (for the mostBarry Warsaw2007-09-204-118/+81
| | | | | | part). Mostly this is just updating the code to use the new APIs, but there's also some other code clean up involved. There's still more to do for sure, but this is a start.
* Implement a context manager for Python 2.5's with statement, which isBarry Warsaw2007-09-193-15/+10
| | | | | | | | 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
* ListAdmin mostly gone, but not quite.Barry Warsaw2007-09-091-10/+25
| | | | | | | | | | | | | | | | 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.
* Simple update.Barry Warsaw2007-08-061-4/+2
|
* Make bin/list_owners work again.Barry Warsaw2007-08-061-8/+9
|
* Fixed a problem where members of a deleted mailing list were hanging around.Barry Warsaw2007-08-052-57/+4
| | | | | | | | | | | | | | | | | | | | 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-051-18/+2
| | | | | | | | | | | | | | | 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.
* It all started by trying to remove MailList.Create() and use the IListManagerBarry Warsaw2007-08-054-136/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Move the pending database into the SQLAlchemy/Elixir layer. The oldBarry Warsaw2007-08-011-3/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Remove last vestiges of dbcontextBarry Warsaw2007-07-231-1/+0
|/
* 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-183-7/+11
| | | | | | | | | | | | | | | | | * 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.
* Major surgery to get the setuptools based installation passing all theBarry Warsaw2007-07-165-40/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-141-21/+35
| | | | | | | | | | | 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-132-71/+120
| | | | artifacts are removed, as is the C files which we will no longer need.
* Conversion of the ToDigest tests to doctests, along with just enough handlerBarry Warsaw2007-07-101-0/+3
| | | | | | | | | 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.
* 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.
* 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 Switchboard test in test_runners.py to a doctest. Add anBarry Warsaw2007-06-271-19/+35
| | | | | | | | | | | | | | | 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.
* senddigests.py - Changed to catch exceptions thrown by ↵msapiro2007-06-151-2/+13
| | | | | mlist.send_digest_now() and report them and continue processing the remaining lists.
* Support resetting a user's password if the imported file does not have abwarsaw2007-05-291-6/+13
| | | | password for the user, or if it's "{NONE}".
* Merge exp-elixir-branch to trunk. There is enough working to make me feelbwarsaw2007-05-2814-157/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | confident the Elixir branch is ready to become mainline. Also, fewer branches makes for an easier migration to a dvcs. Don't expect much of the old test suite to work, or even for much of the old functionality to work. The changes here are disruptive enough to break higher level parts of Mailman. But that's okay because I am slowly building up a new and improved test suite, which will lead to a functional system again. For now, only the doctests in Mailman/docs (and their related test harnesses) will pass, but they all do pass. Note that Mailman/docs serve as system documentation first and unit tests second. You should be able to read the doctest files to understand the underlying data model. Other changes included in this merge: - Added the Mailman.ext extension package. - zope.interfaces uses to describe major components - SQLAlchemy/Elixir used as the database model - Top level doinstall target renamed to justinstall - 3rd-party packages are now installed in pythonlib/lib/python to be more compliant with distutils standards. This allows us to use just --home instead of all the --install-* options. - No longer need to include the email package or pysqlite, as Python 2.5 is required (and comes with both packages). - munepy package is included, for Python enums - IRosterSets are added as a way to manage a collection of IRosters. Roster sets are named so that we can maintain the indirection between mailing lists and rosters, where the two are maintained in different storages. - IMailingListRosters: remove_*_roster() -> delete_*_roster() - Remove IMember interface. - Utils.list_names() -> config.list_manager.names - fqdn_listname() takes an optional hostname argument. - Added a bunch of new exceptions used throughout the new interfaces. - Make LockFile a context manager for use with the 'with' statement.
* Another round of merges of my Pycon branch...bwarsaw2007-04-171-8/+51
| | | | | | | | | | | | | | | | | | | | bin/testall.py - Improvements to setting up the tests with temporary files for the db and configuration. Don't accept -C/--config because that will just confuse things. - Copy our new testing.cfg.in template file to a temp file, populate it with a few additional run-time calculate values, and use that in both the parent (bin/testall script) and children (bin/mailmanctl and friends). Mailman/initialize.py - Split up initialize() into two functions as required by the test suite reorg above. Almost everything else in Mailman will continue to use the initialize() function though. Mailman/configuration.py - Store the filename that was used to load the .cfg file from on the configuration object.
* r8187 from 2.1-maint branch; fix bin/withlist -r to work with package pathsbwarsaw2007-04-051-2/+3
| | | | more deeply nested than 1 level.
* Fix passwords in bin/newlist. Yes, this needs unit tests!bwarsaw2007-03-271-6/+6
|
* Restore the use of passwords.Schemes enum for selection of password hashingbwarsaw2007-03-221-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | scheme. Fix mmsitepass and test cases accordingly. Details: - set_global_password(): Instead of taking a string for 'scheme' argument, take None and then coerce that into passwords.Schemes.ssha - Add a base PasswordError and a BadPasswordSchemeError error that derives from that. For consistency, multiply inherit MMBadPasswordError and MMPasswordsMustMatch from PasswordError. - Add a passwords.lookup_scheme() method which turns scheme_names into scheme enum constants. It returns None if the lookup fails. - passwords.py: change the internal representation of _SCHEMES_BY_TAG dictionary to map scheme names to scheme enum values. Change internal uses of this dictionary to then turn those enum values into hash classes, or whatever else we need. - make_secret(): Raise BadPasswordSchemeErrorif the given schema (which should be an enum value) is invalid. - TestBase.tearDown(): Clear out any <site> locks that might hang around after a test case runs.
* A few style fixes based on commit reviews.bwarsaw2007-03-211-1/+0
| | | | | | | | | | | | | | | | | | | | Switchboard.py - Use listname.encode('utf-8') to produce the necessary 8-bit string, instead of str(listname). Also update the preceding comment. senddigests.py - Remove an unnecessary import. Decorate.py - Remove a commented out section of code. - Remove some redundant local variables - Reorganize the section that's trying to find a usable encoding for the payload of the modified message. I don't think it really hurts much to try duplicate charsets when lcset == mcset, or when either == utf-8. Just go ahead and try them and let them fail. This simplifies the code. Also, try to get just the minimum necessary code under the UnicodeError. I think it's enough to catch the payload.encode() call.
* Some fixes for rev 8162 for mmsitepass to work.tkikuchi2007-03-031-2/+2
| | | | | | | | | | emum.py: 'cls' is used instead of 'self' mmsitepass.py: SCHEMES -> Schemes passwords.py: make_secret is called with 'scheme' in string. decode() of challenge string fails if it is unicode.
* Fixes for i18n digest to work.tkikuchi2007-03-021-1/+2
| | | | | | | | | | | | | | | | | | Mailman/Queue/Switchboard.py: listname is returned in unicode. ( '\x80' + 'a' is OK, '\x80' + u'a' is NG) Mailman/Utils.py: Utils.oneline() is extended for returning unicode string. Mailman/Digester.py: next_post_number is not used anywhere. Mailman/database/listdata.py: Attributes added (esp. for non web u/i) Mailman/bin/senddigests.py: Initialization Mailman/Handlers/ToDigest.py: Internal string calculation is done in unicode. So, several fixes. StringIO is used because cStringIO doesn't have encoding attribute.
* Where should etc directory belong, $prefix or $var-prefix?tkikuchi2007-02-031-3/+11
| | | | | | | | | | I put it in $var-prefix. mmsitepass.py ... parseargs() fails because config is not loaded before initialize(config). passwords.make_secret() should be called.