summaryrefslogtreecommitdiff
path: root/Mailman/Archiver/pipermail.py
Commit message (Collapse)AuthorAgeFilesLines
* Bite the bullet: rename the Mailman package to mailman.Barry Warsaw2008-02-271-874/+0
|
* - Convert all logging to Python's standard logging module. Get rid of allbwarsaw2006-04-171-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-6/+6
| | | | | | | | | | | - 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 out Revision 2.30 patch for email.Message.set_payload() bugtkikuchi2006-01-291-6/+1
| | | | because it is overwrapped in Mailman.Message.
* Fixes for email.set_payload() not distinguish parsed or virgin payload.tkikuchi2005-12-241-1/+6
|
* back porting from 2.1.6tkikuchi2005-08-281-4/+23
|
* _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.
* _set_date(): Watch out for TypeErrors that can come from time.mktime()bwarsaw2003-01-101-1/+1
|
* _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
* Article.__init__(): Use a slightly safer invocation of parseaddr().bwarsaw2002-12-021-4/+4
| | | | _set_date(): Convenience.
* Whitespace normalization and some Pychecker cleanup.bwarsaw2002-10-091-345/+340
|
* processUnixMailbox(): Small but useful refactoring. Don't pass thebwarsaw2002-10-091-4/+6
| | | | | | | | article class as an argument. Instead call out to an override-able method _makeArticle() to return the article instance. This will be overridden in HyperArch.py. Bump __version__ while we're at it.
* processUnixMailbox(): We don't need to catch MessageParseError sincebwarsaw2002-08-291-9/+5
| | | | | | the base class's .next() method will never raise them (it's factory masks them). However, the end condition is now that "m is None" instead of m being false.
* processUnixMailbox(): When an uncaught exception occurs duringbwarsaw2002-08-221-0/+6
| | | | | iteration, provide some more useful information in the logs/error file.
* Article.__init__(): Use the Reply-To: address as the self.email onlybwarsaw2002-04-291-4/+6
| | | | | | | | as a last resort, if no valid email address could be retrieved from the From: line. Previously it would always defer to the Reply-To: address with unintended side effects. Closes SF bug #224274.
* processUnixMailbox(): Ignore any MessageParseErrors in either thebwarsaw2002-04-031-0/+7
| | | | | skipping or processing loops. They usually mean MIME boundary problems, which legit email rarely has.
* processUnixMailbox(): Add optional start and end arguments so that webwarsaw2002-03-161-3/+16
| | | | | | | can fast forward past a bunch of messages in the mailbox. This will be used by bin/arch to process a huge .mbox file in chunks (manually). Not fully tested, but it seems to work.
* T.__init__(): Add comment by Marc MERLIN.bwarsaw2002-01-021-1/+4
|
* processUnixMailbox(): Add some useful diagnostics which only getbwarsaw2001-11-301-0/+4
| | | | | printed in VERBOSE mode (i.e. running bin/arch). Print out a message counter and the Message-ID: of the message being processed.
* processUnixMailbox(): Instantiate an ArchiverMailbox instead of abwarsaw2001-10-241-4/+8
| | | | | | UnixMailbox. The main difference being we pass in the MailList instance to the constructor, so all the magic of the message scrubber can work.
* De-string-module-ification.bwarsaw2001-10-151-37/+33
| | | | | | | import cPickle as pickle Convert to use email package so we're dealing with one kind of Message object.
* Style nit.bwarsaw2001-08-171-1/+1
|
* BSDDBdatabase.__openIndices(): 'pas' -> 'pass'twouters2001-07-101-1/+1
|
* Fix typo observed by nobody (aka Anonymous) in SF bug #426002: 'data' shouldtwouters2001-05-291-1/+1
| | | | | | | be 'date'. I don't usually like touching pipermail, but in this case, the pain is minimal. Closes SF bug #426002.
* T.__init__(), T.new_archive(), BSDDBdatabase.__openIndices(): Usebwarsaw2001-05-181-7/+20
| | | | os.mkdir() instead of Utils.mkdir().
* Import _ from Mailman.i18n.bwarsaw2001-03-261-3/+1
|
* close(), _open_index_file_as_stdout(), write_article():bwarsaw2001-02-151-8/+17
| | | | Utils.open_ex() is obsolete.
* _(): new function to fake out i18n for now.bwarsaw2000-12-201-0/+3
|
* First integration patch of Juan Carlos's i18n string marking changes.bwarsaw2000-12-071-7/+7
|
* Comment out a couple of print statements which can cause annoying cronbwarsaw2000-10-201-2/+2
| | | | emails. These should really be log file output.
* Article.__init__(): Because I don't know why Pipermail uses modifiedbwarsaw2000-10-031-2/+11
| | | | | | | | | versions of the In-Reply-To, References, and Message-ID headers, I retain the original values in different variables. These are used to generate the periodic downloadable archives. _set_date(): Initialize date to '' not 'None' if there is no date header.
* Fold the UnixMailbox optimization into Mailman.Mailbox.Mailbox class,bwarsaw2000-09-241-6/+3
| | | | and use that class here.
* Extensive cleanup and performance improvements. Most signficant changes are:jhylton2000-09-221-11/+10
| | | | | | | | | | | | | | | | - add support for decoding subjects in links to next and prev message if the encodings of the two messages are the same - change re.sub('"',...) with string.replace('"', ...) - remove unused __processbody_CGIescape method - vast simplification and speed up of format_article (still more to do in methods it calls) - change logic of loadbody_fromHTML to avoid unnecessary tests - add slightly optimized mailbox class
* Fix index generation bug that oocasionally prevented messages fromjhylton2000-09-221-92/+136
| | | | | | | | | | | | | | | | | | | | | | | | appearing in index. pipermail generated several indexes by assuming that date was unique. If two messages arrived with, e.g., the same author and date, then the author index treated them as identical. As a result, both messages were archived, but only the last one was included in the index. Solution is to always include the msgid, which is unique, in the index key. Change database keys to combine elements using tuples instead of string concatenation with \000 as separator. Fix was accomplished by refactoring on pipermail.Database and its subclasses. Push index-key generation into common concrete base class Database; rename abstract base class to DatabaseInterface. Break up addArticle method into several pieces. TBD There is still more refactoring to do on Database class. Because date key has changed, HyperDatabase method to return first and last date changed to reflect format of date key. Refactor pipermail.T.add_article into several pieces.
* Numerous changes to support message bodies and headers that use ajhylton2000-09-221-11/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | non-ascii charset. HyperArch: call write_index_entry from write_threadindex_entry more style issues; refactoring of several methods add ctype, charset, and decode attrs to Article; set based on Content-Type header and an encoded-words in header add extra blank lines to html templates so that they interact better with iso-2022-jp text handle msg <title> and <h1> tags separately to avoid non-ascii characters in title add encoding format to index and message headers add explicit template for index entry pipermail: handle messages with timezone gracefully catch EOFError when loading archive pickle fix a few bugs that were hidden by bogus overrides in HyperArch
* pipermail:jhylton2000-09-211-11/+21
| | | | | | | | factor out "write article as html" as write_article method fix a few bugs in previous checkin HyperArch: get rid of bogus add_article override; over_ride write_article instead
* Fix Article class in HyperArch. It is a subclass of pipermail.Article,jhylton2000-09-211-16/+24
| | | | | | | | but it also had some methods that were overridden cut-n-paste style. pipermail: move Article date handling into separate method (should probably do this for the rest of __init__)
* massive reformatting and refactoringjhylton2000-09-211-316/+386
| | | | | | | | | fix some of the hardest-to-read style problems: - no space around = in assignment - obscure comparisons (e.g. use if seq: instead of if len(seq):) - put body of if/else try/except on separate lines refactoring: separate some large and/or obscure chunks of code into methods
* updateThreadedIndex(), update_archive(): Wrap thebwarsaw2000-06-261-11/+26
| | | | | | | self.database.getArticle() calls in a try/except KeyError. These are stopgap measures to avoid exceptions percolating upwards when an archive is regenerated with bin/arch. But it doesn't really fix anything substantial (can you say "pipermail is broken"? ;)
* Make sure we use cPickle if it exists. This change may or may notbwarsaw1999-08-211-3/+8
| | | | have any effect.
* added a snippet to T.__init__ to make it possible to move archivescotton1998-11-051-0/+8
| | | | | | | | | | | from one place to another. simply take the basedir argument as precedent over the saved state version of basedir. I initially considered doing this for the purpose of upgrading list html archives from cvs sources between b5 and b6. Seems as though anyone who set up pipermail archiving previously will benefit from the change, and that it's a good thing for the pipermail module to. scott
* Changes to avoid having to chmod files, which may fail.bwarsaw1998-11-041-15/+14
| | | | | | | | | | | | | | Import open_ex() from Mailman.Utils and assign it to open in the module's globals, so this gets picked up before builtin open. Saves rewriting lots of occurances of open(), but could be confusing when reading a method. Hmmm... __version__ is appended to indicate that this is a Mailman-hacked versio of Pipermail. Use Mailman.Utils.mkdir() instead of os.mkdir(). All chmod()s are commented out, they are obsolete.
* __openIndices(): Wrap the os.mkdir() call in a umask setting of 0 andbwarsaw1998-11-031-2/+8
| | | | | don't set the mod of the directory to 700. (permissions on the parent directory are sufficient).
* code cleanup: put all the web archive related stuff into it's own subcotton1998-10-221-0/+626
package. Details: changed Makefile to add the sub package as a directory to make recursively in changed configure to make the replacements to Mailman/Archiver/Makefile.in changed Mailman/Makefile.in to add Archiver as a sub package moved Mailman/Archiver.py to Mailman/Archiver/Archiver.py and Mailman/Hyper* to Mailman/Archiver Mailman/pipermail.py to Mailman/Archiver/ created Mailman/Archiver/__init__.py to do a "from Archiver import *" in order to make it's interface identical to previously. import change: changed imports to import Mailman.<module> from import <module> in order to accomodate the package import semantics, also localized <module> by calling <module> = Mailman.<module>. see diffs for details if this sounds confusing, it's not. this change was applied to all of the moved files except pipermail, which didn't need it. did a basic new installation test to make sure all the Makefile/configure changes took place atleast basically correctly. scott