summaryrefslogtreecommitdiff
path: root/Mailman/Archiver/Archiver.py
Commit message (Collapse)AuthorAgeFilesLines
* Bite the bullet: rename the Mailman package to mailman.Barry Warsaw2008-02-271-236/+0
|
* Tweak copyright years.Barry Warsaw2008-02-071-1/+1
|
* It all started by trying to remove MailList.Create() and use the IListManagerBarry Warsaw2007-08-051-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Other than contrib files, convert all imports of mm_cfg to imports of config.Barry Warsaw2007-07-141-13/+13
| | | | | | | | | | | 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.
* Update copyright years.bwarsaw2007-01-191-1/+1
|
* A little more internal_name() to fqdn_listname changes.tkikuchi2006-12-031-3/+3
|
* We need to substitute the fully qualified list name in the public archive url.bwarsaw2006-11-121-4/+6
| | | | | | | Do this and switch PUBLIC_ARCHIVE_URL to use $-substitution strings instead of %-substitution strings (no backward compatibility is provided). Minor style nits.
* MailList.py ... GetScriptURL() absolute again because we need it for emailtkikuchi2006-11-091-3/+1
| | | | | | | | notifications. wsgi_app.py ... URI normalization by stripping trailing slash. We need Special care for 'private'. Strip dot only components in the PATH_INFO for sanitization.
* More work on the WSGI support. So far, I've tested most of the admin.py linksbwarsaw2006-10-151-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and some of the admindb.py links. There may still be breakage in other parts of the interface and I haven't gone back to verify that traditional CGI still works. Changes: - Add wsgiref-0.1.2-py2.4.egg so that we can still do WSGI in Python 2.4, which doesn't come with wsgiref. Of course this means we /also/ have to add setuptools-0.5c3 because eggs require setuptools. - Style cleanups in HTTPRunner.py and wsgi_app.py. Also, use cStringIO instead of StringIO. - All internal links within the listinfo and admin pages are (or at least should be ;) relative now. This should make other things better, such as running Mailman over https or alternative ports. It does kind of mean that web_page_url is obsolete, but I haven't looked at whether we can completely eradicate it. - ValidateEmail(): Use ' ' in s instead of s.count(' ') > 0. - GetPathPieces(): When path is false, return the empty list instead of None, so we can still len() it. - ScriptURL(): Much simpler. To support relative urls as the default, we change the API so that it only takes a 'target' argument (i.e. the script we want to link to). It no longer takes 'absolute' or 'web_page_url', and it constructs its link from GetPathPieces(), the target, and the cgi extension. - GetRequestURI(): code style updates. - Mailman/bin/show_config.py: De-DOS-line-ending-ification. - export.py: A few modifications, although this is likely still not final (I'm still working on the import script). First, for <option> elements, don't put the value in an attribute, put it in the text body of the element. Second, put the list <option> tags in a <configuration> element. Third, put the preferred language on an <option> tag with a 'preferred_language' name attribute value. - SecurityManager: Make sure that MakeCookie() and ZapCookie() use the same 'path' cookie value by refactoring that into a separate method. That method now returns just the SCRIPT_NAME and the full listname. web_page_url doesn't enter into it. - loginit.py: Add a 'debug' logger since it's just too useful to have :) - admin.py: Remove the extra / right before the query string in ?VARHELP urls. That extra / turns out to be problematic with the relative url scheme we're using now. - Auth.py: whitespace normalization and copyright years update. Also, remove a couple of unnecessary imports. Also, make sure that the actionurl is relative. - create.py: Typo. - private.py: mm_cfg -> config object - In MailList.py: GetScriptURL() can be written in terms of Utils.ScriptURL() now.
* First crack at real virtual domain support, i.e. mailing lists with the samebwarsaw2006-07-081-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | name in more than one domain. - Totally eradicate MAILMAN_SITE_LIST, and in fact the entire need for a site list. The functions that the site list previously performed are either removed or supported in other ways. For example, instead of forwarding owner bounces to the site list, we now have a SITE_OWNER_ADDRESS which should point to a human, and such bounces are sent there instead. There's also a "no reply" email address that should be set up to go to devnull. For any message that never expects a reply, the sender is set to this address. - Remove the Site.py module. It was an experimental approach to trying to support virtual domains, and we're going to do it so much better now that this module is no longer necessary. Site._makedirs() -> Utils.makedir(). - VIRTUAL_HOST_OVERVIEW is completely removed, since now virtual hosts are always enabled. Virtual domains should be added to mailman.cfg by using the new add_domain() function. add_virtualhost() is gone. If no virtual domains are added explicitly, we add the default one that configure guessed (but we never add that if domains are added explicitly). - Utils.get_domain() -> Utils.get_request_domain() - withlist code cleanup and make sure that we load etc/mailman.cfg - A new base exception called MailmanException is added, from which all exceptions defined in Errors.py ultimately derive. MailmanError is retained and derives from MailmanException. - BadDomainSpecificationError is added. - Remove the -V/--virtual-host-overview option from list_lists and add instead -d/--domain and -f/--full. - bin/update probably works but needs more testing. - bin/newlist and bin/rmlist take fqdn list names, but default to the default domain if @whatever isn't given. newlist's -u/--urlhost and -e/--emailhost options are removed. The domain that the list is being added to must already exist. - Minor code cleanup in Message.py - Bump version to 2.2.0a1 - The Configuration object grows a .domain dictionary which maps email hosts to url hosts. The reverse mapping is supported, but not directly; use Configuration.get_email_host() instead. - Mailman/Cgi/create is converted from mm_cfg to config, and some minor code cleanup is performed. Also, convert to __i18n_templates__ = True. - New MailList APIs: + property .fqdn_listname + GetNoReplyEmail() + Create() API changes and refactoring.
* - Convert all logging to Python's standard logging module. Get rid of allbwarsaw2006-04-171-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | traces of our crufty old Syslog. Most of this work was purely mechanical, except for: 1) Initializing the loggers. For this, there's a new module Mailman/loginit.py (yes all modules from now on will use PEP 8 names). We can't call this 'logging.py' because that will interfere with importing the stdlib module of the same name (can you say Python 2.5 and absolute imports?). If you want to write log messages both to the log file and to stderr, pass True to loginit.initialize(). This will turn on propagation of log messages to the parent 'mailman' logger, which is set up to print to stderr. This is how bin/qrunner works when not running as a subprocess of mailmanctl. 2) The driver script. I had to untwist the StampedLogger stuff and implement differently printing exceptions and such to log/error because standard logging objects don't have a write() method. So we write to a cStringIO and then pass that to the logger. 3) SMTPDirect.py because of the configurability of the log messages. This required changing SafeDict into a dict subclass (which is better than using UserDicts anyway -- yay Python 2.3!). It's probably still possible to flummox things up if you change the name of the loggers in the SMTP_LOG_* variables in mm_cfg.py. However, the worst you can do is cause output to go to stderr and not go to a log file. Note too that all entry points into the Mailman system must call Mailman.loginit.initialize() or the log output will go to stderr (which may occasionally be what you want). Currently all CGIs and qrunners should be working properly. I wish I could have tested all code paths that touch the logger, but that's infeasible. I have tested this, but it's possible that there were some mistakes in the translation. - Mailman.Bouncers.BounceAPI.Stop is a singleton, but not a class instance any more. - True/False code cleanup, PEP 8 import restructuring, whitespace normalization, and copyright year updates, as appropriate.
* Now that Python 2.3 is the minimum requirement for Mailman 2.2:bwarsaw2006-04-151-12/+7
| | | | | | | | | | | - Remove True/False binding cruft - Remove __future__ statements for nested scopes - Remove ascii_letters import hack from Utils.py - Remove mimetypes.guess_all_extensions import hack from Scrubber.py - In Pending.py, set _missing to object() (better than using []) Also, update copyright years where appropriate, and re-order imports more to my PEP 8 tastes. Whitespace normalize.
* back porting from 2.1.6tkikuchi2005-08-281-19/+29
|
* FSF office has moved. chdcking in for MAIN branch.tkikuchi2005-08-271-1/+1
|
* ExternalArchive(): Add %(hostname)s to the substitution stringsbwarsaw2003-06-261-2/+4
| | | | | allowed in the PUBLIC_EXTERNAL_ARCHIVER and_EXTERNAL_ARCHIVER variables.
* ArchiveMail(): Get rid of the try/bare-except wrapper around thebwarsaw2002-11-121-23/+15
| | | | | mailbox processing. It's good enough for the caller of this code to do the exception handling.
* Whitespace normalization and some Pychecker cleanup.bwarsaw2002-10-091-1/+0
|
* ArchiveMail(): processUnixMailbox() no longer takes an article classbwarsaw2002-10-091-1/+1
| | | | argument.
* CheckHTMLArchiveDir(): Indentation-o pointed out by Dan Mick.bwarsaw2002-10-081-1/+1
|
* Whitespace normalization.bwarsaw2002-10-081-16/+16
|
* ArchiveMail(): Remove the corrupt archive log message. I think thisbwarsaw2002-10-081-2/+0
| | | | just confuses people and the traceback is enough information.
* Archiver.InitVars(): Don't write the emptyarchive.html file tobwarsaw2002-05-031-8/+17
| | | | index.html unless there isn't already an index.html file there!
* GetBaseArchiveURL(): Marc MERLIN suggests to tack on the trailingbwarsaw2002-03-071-1/+4
| | | | | slash to avoid an http redirect and second query. However, just add it if it's not already there.
* Patches to help localize where file system layout decisions are made.bwarsaw2002-03-051-4/+3
| | | | | | Don't use PUBLIC_ARCHIVE_FILE_DIR and PRIVATE_ARCHIVE_FILE_DIR directly, use the archive_dir() method or the Site module methods instead.
* Remove the import of MailList; this isn't used anywhere in this file.bwarsaw2002-03-011-1/+0
|
* InitVars(), ArchiveMail(): The start of some cleanups flagged bybwarsaw2002-02-111-4/+0
| | | | Pychecker. Removed some unused local variables.
* InitVars(): We have to wrap each os.mkdir() in its own try/except sobwarsaw2002-01-041-5/+8
| | | | | | | that the failure of one won't prevent the attempt of the other. This fixes a problem reported by Dan Buchmann where upgrades fail if there are pre-MM2.1a4 lists that have not received a posting before the upgrade to MM2.1a4.
* Add a hack, based on Marc MERLIN's patch that provides /something/ forbwarsaw2002-01-021-1/+15
| | | | | | | | the archive url before the first message has been posted to the list. InitVars(): Write an initial index.html file which just states that the archive is currently empty. Template comes from emptyarchive.html.
* GetBaseArchiveURL(): PUBLIC_ARCHIVE_URL should be an absolute urlbwarsaw2001-10-261-0/+4
| | | | | | | containing a %(hostname)s interpolation string. This gets filled in with the list's hostname, which is calculated from a reverse lookup in VIRTUAL_HOSTS using self.host_name as the key. Failing that, DEFAULT_URL_HOST is used.
* GetBaseArchiveURL(): The semantics of PUBLIC_ARCHIVE_URL are changedbwarsaw2001-10-101-1/+3
| | | | | | to be a template into which %(listname)s will be interpolated. This makes it possible to set PUBLIC_ARCHIVE_URL to something that's appropriate for (hopefully) any external archiver.
* Use cStringIO directly instead of our own hack-around StringIObwarsaw2001-10-011-2/+1
| | | | module. Also, we don't need the string module.
* InitVars(): Should create self.archive_dir()+'.mbox' notbwarsaw2001-07-271-1/+1
| | | | ArchiveFileName().
* InitVars(): Do not set list attributes public_archive_file_dir,bwarsaw2001-07-261-36/+19
| | | | | | | | | | | | | | private_archive_file_dir, or archive_directory. All three can be calculated when needed, and doing it that way instead improves the mobility of lists. archive_dir(): Return the path previously kept in archive_directory, by calculating it on the fly. ArchiveFileName(): Use archive_dir() to calculate the path to the actual .mbox file. CheckHTMLArchiveDir(): use archive_dir() to calculate the link paths.
* GetConfigInfo(): Removed.bwarsaw2001-07-191-17/+0
|
* InitVars(): Fix the out-of-date comment.bwarsaw2001-07-101-1/+1
|
* Use better syslog() calling convention.bwarsaw2001-06-271-4/+3
|
* GetBaseArchiveURL(): Make sure private archive url ends in a slash.bwarsaw2001-06-011-1/+1
|
* Archiver.InitVars(): Use os.mkdir() instead of Utils.mkdir().bwarsaw2001-05-181-6/+7
|
* GetBaseArchiveURL(): Instead of relying on the configuration variablebwarsaw2001-05-161-4/+2
| | | | | PRIVATE_ARCHIVE_URL, calculate the url to the `private' cgi script via self.GetScriptURL().
* InitVars(), GetConfigInfo(): clobber_date goes away as a list-specificbwarsaw2001-05-011-8/+0
| | | | configuration variable.
* GetConfigInfo(): Reformatting.bwarsaw2001-02-281-5/+10
|
* __archive_file(): Utils.open_ex() is obsolete.bwarsaw2001-02-151-14/+11
| | | | | | ArchiveMail(): Interface change. This method no longer gets the message metadata dictionary (it wasn't used anyway). Also, convert to the mimelib interface.
* First integration patch of Juan Carlos's i18n string marking changes.bwarsaw2000-12-071-10/+10
|
* Archiver.InitVars(): Ted Cabeen's SF patch #100554 to allowbwarsaw2000-09-201-1/+1
| | | | mlist.archive to be set from mm_cfg.py.
* __archive_to_mbox(): Don't do the clobber_date logic here, becausebwarsaw2000-09-141-16/+8
| | | | | | it'll only affect what gets put in the .mbox file. We also want clobber_date to affect what goes in Pipermail or the external archiver. Move the clobber_date logic to Handlers/ToArchive.py.
* Remove commented out syslog() lines.bwarsaw2000-07-201-2/+0
|
* ArchiveMail(): Comment out the debugging prints to syslog.bwarsaw2000-07-061-2/+2
|
* ArchiveMail(): Don't do this work in a forked subprocesses; with manybwarsaw2000-06-261-53/+42
| | | | | | | | | | messages being delivered by qrunner it is quite easy to simply run out of process resources. Now each message to be archived is done in the parent process, with a bit of extra paranoia in case of archiver errors. This also gets rid of the individual archiver locks since it is required that the list itself be locked in order to get here.
* ArchiveMail(): First, extended the signature to take a msgdatabwarsaw2000-06-231-20/+25
| | | | | | | | | | | | | | | | dictionary, which gets filled in with the child pid. This allows it to be reaped by functions higher up in the call chain. Second, and more importantly, be quite paranoid about the fork and child processes. Make absolutely sure that the child process exits. Wrap all the child code in try blocks so that no matter what, the lock will get released (by calling unlock() with the unconditionally flag set). If no exception occurs, the child will exit with status 0, otherwise the traceback will be printed to stderr, a message indicating which list has a corrupt archive is logged to logs/error, and the child process will exit with status 1. Extend the archive.lock to 1 hour.
* Convert all uses of mlist.LogMsg() to the new syslog() interface.bwarsaw2000-06-021-6/+5
|