summaryrefslogtreecommitdiff
path: root/Mailman/Queue/IncomingRunner.py
Commit message (Collapse)AuthorAgeFilesLines
* Reorganize the qrunner infrastructure. First, the package has been renamedBarry Warsaw2007-09-291-183/+0
| | | | | | | | | | | | | | | | | | | | | | 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.
* Convert failing test_message.py to doctests bounces.txt and message.txt, whichBarry Warsaw2007-07-011-1/+1
| | | | | | | | | | | | | 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.
* Update copyright years.bwarsaw2007-01-191-1/+1
|
* Fix some buglets with virtual domain support and repair unit tests broken bybwarsaw2006-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | this change. More unit tests should be added. misc/sitelist.cfg is removed -- this is an ex-site list. MailList.GetNoReplyEmail() -> MailList.no_reply_address (property) UserNotification._enqueue(), OwnerNotification._enqueue(): when queing the message to the virgin queue, be sure to use the fully qualified (i.e. posting) address for the list. In the MTA modules, be sure to set up the target of the mail commands as the fqdn listname because otherwise we can't find the correct list. This needs some tweaking/testing for Postfix's virtual domain support. MailList.Load() has to grow an optional argument specifying the fqdn listname. The problem is that in some situations, we can't calculate that because we don't know _internal_name, so it has to be passed in. This is mostly the case in the MailList ctor where a Load hasn't happened yet. For backward compatibility though, if it's not passed in, just use mlist.fqdn_listname.
* First crack at real virtual domain support, i.e. mailing lists with the samebwarsaw2006-07-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Massive conversion process so that Mailman can be run from a user specifiedbwarsaw2006-07-081-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | configuration file. While the full conversion is not yet complete, everything that seems to be required to run mailmanctl, qrunner, rmlist, and newlist have been updated. Basically, modules should no longer import mm_cfg, but instead they should import Mailman.configuration.config. The latter is an object that's guaranteed to exist, but not guaranteed to be initialized until some top-level script calls config.load(). The latter should be called with the argument to -C/--config which is a new convention the above scripts have been given. In most cases, where mm_cfg.<variable> is used config.<variable> can be used, but the exceptions are where the default value must be available before config.load() is called. Sometimes you can import Mailman.Default and get the variable from there, but other times the code has to be changed to work around this limitation. Take each on a case-by-case basis. Note that the various directories calculated from VAR_PREFIX, EXEC_PREFIX, and PREFIX are now calculated in config.py, not in Defaults.py. This way a configuration file can override the base directories and everything should work correctly. Other changes here include: - mailmanctl, qrunner, and update are switched to optparse and $-strings, and changed to the mmshell architecture - An etc directory has been added to /usr/local/mailman and a mailman.cfg.sample file is installed there. Sites should now edit an etc/mailman.cfg file to do their configurations, although the mm_cfg file is still honored. The formats of the two files are identical. - list_lists is given the -C/--config option - Some coding style fixes in bin/update, but not extensive - Get rid of nested scope hacks in qrunner.py - A start on getting EmailBase tests working (specifically test_message), although not yet complete.
* - Convert all logging to Python's standard logging module. Get rid of allbwarsaw2006-04-171-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* FSF office has moved. chdcking in for MAIN branch.tkikuchi2005-08-271-1/+1
|
* Restore the resumable pipeline code.bwarsaw2003-02-051-5/+11
| | | | | | | | | | | _dispose(): Set the msgdata's pipeline attribute to the pipeline list before calling _dopipeline(). If there's no more to do, delete this attribute. This way, if one of the modules throws an exception, we'll resume the next delivery attempt at that module. (E.g. if we unshunt it later). _dopipeline(): Add a bare except which pushes the failing module back on the front of the pipeline list, then re-raises the exception.
* Update the big comment showing mail flow through the system.bwarsaw2002-04-011-40/+58
|
* Constructor simplification. Since most derived classes are justbwarsaw2002-03-021-3/+1
| | | | | | | specializing the queue directory, make QDIR a class attribute and have Runner's ctor use that instead of an __init__() argument. This lets us get rid of most of the __init__()'s in the derived classes. (OutgoingRunner still needs one though.)
* _dispose(): The mlist.Save() call should be in the try: block, sincebwarsaw2002-01-261-1/+1
| | | | | not making it to the end of the try ought to be morally equivalent to an aborted transaction.
* _dopipeline(): When discarding a message, log its Message-ID: to logs/vettebwarsaw2002-01-211-1/+3
|
* Some updating of the big comment. I'm not spending a lot of time onbwarsaw2001-11-201-6/+8
| | | | | this because I want to create a flow chart later to give a better description of the details.
* Convert from mimelib to email.bwarsaw2001-10-011-1/+1
| | | | | Also, use cStringIO directly instead of our own hack-around StringIO module.
* _dopipeline(): We don't need to save the return value of __import__().bwarsaw2001-07-131-1/+1
|
* _dopipeline(): Do not include the blank Exception catch-all here, butbwarsaw2001-07-131-9/+0
| | | | | | | | | | instead let them percolate up to Runner.__oneloop(). Now, the proper action when an uncaught exception occurs is to shunt the message instead of trying forever to re-deliver it (possibly causing logs/error to fill up /very/ quickly). Shunted messages can always be resent by moving them back to qfiles/in.
* _dopipeline(): Use a better mechanism for digging out the process()bwarsaw2001-07-101-4/+5
| | | | | | | | | function from the dynamically imported module. Also, MessageHeld -> HoldMessage Also, catch RejectMessage exceptions, bouncing the rejected message via mlist.BounceMessage().
* Better syslog() calling conventions.bwarsaw2001-06-271-2/+1
|
* _dispose(): Fix a bug whereby if an uncaught exception occurred, thebwarsaw2001-04-021-1/+4
| | | | | unprocessed pipeline module list wouldn't get saved in the message metadata.
* intermediatebwarsaw2001-02-151-91/+72
|
* Multiple queue runner classes, in a new package Mailman.Queue.bwarsaw2000-12-201-0/+175
Runner is the base class providing the framework for other qrunner specializations. IncomingRunner runs through qfiles/in taking messages from the smtpd, sending them through the standard message handler pipeline and potentially writing the message to qfiles/out or qfiles/news. OutgoingRunner takes message from qfiles/out and hands them over to the MTA. NewsRunner takes message from qfiles/news and hands them over to the news server.