summaryrefslogtreecommitdiff
path: root/Mailman/Archiver
Commit message (Collapse)AuthorAgeFilesLines
* Bite the bullet: rename the Mailman package to mailman.Barry Warsaw2008-02-275-2737/+0
|
* Tweak copyright years.Barry Warsaw2008-02-074-4/+4
|
* Much progress, though not perfect, on migrating to SQLAlchemy 0.4 and ElixirBarry Warsaw2007-10-312-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-102-5/+5
| | | | | | | | | | | | | 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'.
* Implement a context manager for Python 2.5's with statement, which isBarry Warsaw2007-09-191-45/+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
* 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-142-29/+29
| | | | | | | | | | | 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-131-73/+0
| | | | artifacts are removed, as is the C files which we will no longer need.
* Update copyright years.bwarsaw2007-01-195-10/+12
|
* A little more internal_name() to fqdn_listname changes.tkikuchi2006-12-032-7/+7
|
* 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.
* Added '(by thread)' to the previous and next message links to emphasize thatmsapiro2006-06-111-2/+2
| | | | even if you got to the message from a subject, date or author index, previous and next are still by thread.
* Remove most uses of the types module, in favor of isinstance checks againstbwarsaw2006-04-171-4/+3
| | | | | | the builtin types. Two still remain: a check against ClassType and a check against MethodType. Also, fix some hinky type comparisons to use isinstance() consistently.
* - Convert all logging to Python's standard logging module. Get rid of allbwarsaw2006-04-173-13/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-153-38/+25
| | | | | | | | | | | - 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.
* Now that we've converted from CVS to Subversion, remove CVS cruft frombwarsaw2006-04-151-1/+0
| | | | | the trunk. This serves also to test write permission to the svn repository, and tests email notifications.
* Added missing import of Errors module.msapiro2006-03-201-0/+1
|
* Back out Revision 2.30 patch for email.Message.set_payload() bugtkikuchi2006-01-292-13/+3
| | | | because it is overwrapped in Mailman.Message.
* Text file '@' obfuscation bug (unicode) fix. Thanks Mark.tkikuchi2006-01-091-3/+8
|
* Port cleaning changes forward from 2.1-maint branch.bwarsaw2005-12-301-1/+2
|
* Fixes for email.set_payload() not distinguish parsed or virgin payload.tkikuchi2005-12-242-2/+12
|
* Finnish dialect of "Re:".tkikuchi2005-11-011-1/+1
|
* Obfuscate email address in the subject line.tkikuchi2005-10-311-0/+9
|
* Obscure email when the poster doesn't set full name in From:.tkikuchi2005-09-191-1/+5
|
* back porting from 2.1.6tkikuchi2005-08-283-50/+116
|
* FSF office has moved. chdcking in for MAIN branch.tkikuchi2005-08-275-5/+5
|
* ExternalArchive(): Add %(hostname)s to the substitution stringsbwarsaw2003-06-261-2/+4
| | | | | allowed in the PUBLIC_EXTERNAL_ARCHIVER and_EXTERNAL_ARCHIVER variables.
* quick_maketext(): Richard Barrett's patch for bug #730769, with minorbwarsaw2003-05-121-6/+36
| | | | | | stylistic modifications. This fixes caching by adding the listname to the cache key. Otherwise, lists with local overriding templates would find the wrong template. Uses the new Utils.findtext() interface.
* _set_date(): Patch # 732366 by Richard Barrett; take the timezone intobwarsaw2003-05-121-2/+2
| | | | | | account when figuring the posting date for an article. Backport candidate.
* Update copyright yearsbwarsaw2003-03-111-1/+1
|
* SF patch #683906, add $DESTDIR to install target, by Ademar de Souza Reistwouters2003-03-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Jr, after much checking and rechecking (and some massaging) by me. Checking in now before I fall asleep and forget what all this was for. This patch adds the ability to 'make DESTDIR=/some/dir/tree install' that doesn't influence the paths stored in e.g. Defaults.py at all, which is of good use for various package managers. It is not all that package managers must do, however! Running make install with DESTDIR set means bin/update is never run, and mm_cfg.py is always written; package managers should make sure the appropriate post-installation is done, and that mm_cfg.py is treated as a config file. This patch inadvertently fixes some bogus whitespace: 8-spaces where surrounding code used tabs. The difference was harmless because the 8-spaces were used inside shell-continued-oneliners, but it is confusing and could lead to future harm. I'm too tired to make those two or three changes in a separate checkin, sorry. This patch also assumes the various packages that are installed using distutils do not record (or rather, use) their installation paths anywhere, but this seems to hold true at least for the moment. Also, I've done so many slow cvs diff's, I'm wondering when we'll switch to Subversion. Unfortunately, I've also done so many 'cvs diff -c > file; patch -p0 -R < file's to switch back and forth between patches and change sets, I'm wondering when we'll switch to Aegis as well. :-P
* volNameToDate(): Catch failures in time.mktime() which can happen ifbwarsaw2003-01-191-15/+18
| | | | the year is weird (e.g. 1969). Also, code cleanup.
* Copyright years.bwarsaw2003-01-101-1/+1
|
* _set_date(): Watch out for TypeErrors that can come from time.mktime()bwarsaw2003-01-101-1/+1
|
* Article.__init__(): Watch out for tuples coming back frombwarsaw2003-01-101-0/+3
| | | | | message.get_param(). Such beasts are RFC 2231 charsets which need to be converted to unicode.
* __processbody_URLquote(): Tokio Kikuchi's patch #658598 to fix rc1 bugbwarsaw2002-12-261-1/+3
| | | | in email obscuring in the body of the message.
* __processbody_URLquote(): Obscure email addresses in the body ofbwarsaw2002-12-241-1/+6
| | | | messages when ARCHIVER_OBSCURES_EMAILADDRS is true.
* Martin's patch #655214 to fix multi-charset archiving. He says:bwarsaw2002-12-241-108/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch restores MIME charset capabilities for article archiving in CVS Mailman. It: - removes the .charset attribute from articles; all yarticles are encoded in the list's charset, - decodes subject and author to Unicode; if this fails, no decoding (not even MIME) is done to subject and author, - MIME-decodes the body in the constructor using get_payload, removes the hand-crafted qp decoding from _get_body, - Unicode-decodes the body in the constructor if the body's charset differs from the list's charset, - fixes processbody_URLquote to always return byte strings (by escaping the URL also); comparing the old and the new string is no longer possible since the old string is Unicode and the new string is a list-encoded byte string. - changes text archiving to have the archives in the list's encoding, with unsupported characters 'replace'd With these changes, I can process the playground archives correctly, to get mojibake-free pages.
* Donn Cave's patch #602087 to honor configure's --srcdir switch.bwarsaw2002-12-121-1/+1
|
* Tokio Kikichi's patch for multibyte i18n problems. Patch #646884,bwarsaw2002-12-081-39/+60
| | | | | | | | | | | | | | | | | | | | | | | explanations: HyperArch.py in 2.1b5 use Utils.uquote() for CGIescape() and html_quote() but it does not take language argument. This is no good for multilbyte charset because characters are escaped in separate 8bit bytes which results in mojibake. We should rather use Utils.uncanonstr() to honor the legal characters within the multibyte charset. This patch fixes other minor bugs in the current code. and... Utils.uquote() makes a multibyte character into two or more fragmants of Latin-1 characters. Utils.uquote() makes all the 8bit-set character escaped while Utils.uncanonstr() checks if the character is within the charset and escapes only if the chatacter is not legal. Some additional minor code cleanup by Barry.
* _set_date(): Generalize w/ a nested function so we can try more thanbwarsaw2002-12-081-14/+15
| | | | | | | one header. Try Date first, and fall back to X-List-Received-Date which ArchRunner adds, before using self._last_article_time. After an idea by Carson Gaspar
* _set_date(): Don't convert to GMT. Keep dates local. Closes SF bugbwarsaw2002-12-071-1/+1
| | | | #643231
* decode_charset(): Greg Ward's patch for SF # 649007. If there is anbwarsaw2002-12-071-2/+2
| | | | | | unknown character set specified in an RFC 2047 encoded header, or in the Content-Type of one of the parts, we'd get a LookupError. This simply moves the make_header() call to inside the try/except.
* sizeof(): Watch out for ENOENT exceptions which can happen if the mboxbwarsaw2002-12-071-1/+7
| | | | | | | file was moved or deleted, and an explicit mbox file name was given to bin/arch. Closes SF # 649011
* update_article(): Reword the messages for proper i18n style. Closesbwarsaw2002-12-051-6/+9
| | | | SF bug #648604.
* setListIfUnset(): Greg Ward's patch to actually make this work. ;)bwarsaw2002-12-051-2/+1
| | | | Closes SF bug #648607
* Article.__init__(): Use a slightly safer invocation of parseaddr().bwarsaw2002-12-021-4/+4
| | | | _set_date(): Convenience.