summaryrefslogtreecommitdiff
path: root/Mailman/Queue
Commit message (Collapse)AuthorAgeFilesLines
...
* verp_bounce(): Exim stashes the envelope recipient in the Envelope-To:bwarsaw2002-05-091-7/+7
| | | | header.
* make_response(): In the list comprehension where we're calculating thebwarsaw2002-05-031-1/+1
| | | | | unprocessed lines, check for line == None (can happen if the message is sent to e.g. mylist-join with no body).
* Results.__init__(): Don't try to get the payload if there were nobwarsaw2002-05-031-0/+3
| | | | text/plain parts in the message.
* do_command(): If the Subject: header command was attempted and itbwarsaw2002-05-021-4/+12
| | | | | | failed, it might be because of a Re: prefix (or localized version thereof). Pop off the first component of the args, use that as the command and try again... once.
* __onefile(): If there's no `listname' key in the message metadata, usebwarsaw2002-05-021-9/+8
| | | | | the site list to send the message. If there's no site list, you're in heap big trouble.
* Support the new email commands framework. We now no longer usebwarsaw2002-05-021-34/+115
| | | | | | | | | | | | | | MailCommandHandler.py. Specific changes include: class Results: Basically a bag to hold state during the processing of a particular email message loaded with commands. This makes it easy to pass data around (like the mailing list object and the message). It also contains the results of the command processing and gloms up the response email. _dispose(): This method actually gets simplified because it just needs to pass things to the Results instance and let it do the job of processing the email commands.
* _dispose(): In the SomeRecipientsFailed handler, be sure to set thebwarsaw2002-04-181-2/+3
| | | | | msgdata's "recips" key to the list of recipients that were rejected, otherwise lots of folks on the list will get duplicates!
* _dispose(): There are reports of None's showing up in the addrs. Notbwarsaw2002-04-111-0/+4
| | | | sure why that is, but let's filter them out anyway.
* _dispose(): Catch socket.errors that can come from the underlyingbwarsaw2002-04-101-0/+19
| | | | | | | | | delivery module (i.e. SMTPDirect) when it couldn't connect to the smtp server. When this happens, log an error message, but only do it once so we don't fill up logs/error with a message-per-second. We keep a self.__logged flag which is set when we log the error and reset in the class constructor, and when the process() function returned successfully.
* _dispose(): We need to iterate over the addrs list. Also, reload thebwarsaw2002-04-011-15/+17
| | | | | list's state via xlist.Load() -- conservative if the state hasn't changed.
* _dispose(): Since the runner doesn't normally need to lock the list,bwarsaw2002-04-012-3/+4
| | | | call mlist.Load() so we can be sure we've got the most current state.
* Update the big comment showing mail flow through the system.bwarsaw2002-04-011-40/+58
|
* _dispose(): Since the BounceRunner doesn't normally need to lock thebwarsaw2002-04-011-0/+2
| | | | | list, call mlist.Load() so we can be sure we've got the most current state.
* _snooze(): Use self.SLEEPTIME instead of mm_cfg.QRUNNER_SLEEP_TIME forbwarsaw2002-03-261-2/+4
| | | | | additional indirection that's overridden by the BounceRunner. Defaults to QRUNNER_SLEEP_TIME for backwards compatibility.
* A significant rewrite of the main bounce runner logic to make itbwarsaw2002-03-261-112/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | perform better. In general there are two changes: 1) we never lock a list until and unless absolutely necessary, 2) we only run the bounce runner once every minute (as opposed to the normal runners' once-per-second sleep time). Specifically, SLEEPTIME: The base class now looks at this attribute to decide how long to sleep between loop iterations, and it defines a default. We override the bounce runner's value to lengthen the time it sleeps to 1 minute (we may eventually want to move this to Defaults.py). __scanbounce(): Gone. All its functionality is subsumed in the new ScanMessages() method and the new _dispose(). __verpbounce(): Renamed to the non-method verp_bounce(). Also, we rip out the code that iterates through all the lists if the bounce came to the site list's -bounces address. _dispose(): Simply calls verp_bounce() to find bouncing addresses, and if that returns a false value (empty list), calls ScanMessages() to see if the bounce detector can find some bouncing addresses. If not, we're done (after possibly forwarding the non-matching message). Otherwise, we register the bounce either on the target mailing list, or on all the mailing lists if this came to the site's -bounces address.
* Update copyright years.bwarsaw2002-03-164-4/+4
|
* _dispose(): Fil correctly pointed out that each of thebwarsaw2002-03-151-9/+17
| | | | | ParseMailCommands() calls in this runner need to be wrapped around a catch of TimeOutError.
* _dispose(): Wrap the ParseMailCommands() call in a try/except. If thebwarsaw2002-03-151-1/+6
| | | | | acquisition of the shared pending.db database lock fails, we want to requeue the message for another try later.
* _dispose(): Add support for the `toconfirm' key, used by the newbwarsaw2002-03-141-2/+12
| | | | confirm mail script.
* Dang, left some debugging syslog()'s in there.bwarsaw2002-03-131-2/+0
|
* We can get rid of the old list cache, and the freshen machinery. Nowbwarsaw2002-03-133-30/+11
| | | | | | | | | _open_list() caches the MailList instances in a WeakValueDictionary which don't contribute to the reference count, but ensure that each runner will get one and only one copy of the MailList data. This should help in the memory footprint of the runners, but I suspect we may still be leaking something.
* __init__(): Remove cachelists from the constructor arguments. We canbwarsaw2002-03-123-4/+7
| | | | | | more conveniently use a class attribute to specify this. On the BounceRunner, turn off MailList object caching so that it'll be more friendly to long-term memory use.
* whichq(): New method which returns the queue directory.bwarsaw2002-03-111-0/+3
|
* __oneloop(): Stick the queue directory in the message metadata so thatbwarsaw2002-03-111-0/+2
| | | | we can unshunt it to the correct queue.
* _dispose(): Consult bounce_unrecognized_goes_to_list_owner beforebwarsaw2002-03-071-10/+16
| | | | | sending the unrecognized message on to the list owner. In either case, write a log entry to logs/bounce.
* __verpbounce(): Wrap the extraction of the match object's groups in abwarsaw2002-03-071-4/+10
| | | | | | try/except for IndexError. If the site admin's configured VERP_REGEXP incorrectly, it's better to provide a more useful error message in log/errors and ignore the bounce than to let a traceback percolate up.
* __init__(), _dispose(): Move the import of the DELIVERY_MODULE and thebwarsaw2002-03-041-5/+5
| | | | | | | | extraction of the process() method into the constructor. I don't think it's too much of a burden to have to restart the OutgoingRunner if you want to change the DELIVERY_MODULE (and I suspect it won't change that much anyway). This also seems to help control memory growth in the OutgoingRunner.
* Constructor simplification. Since most derived classes are justbwarsaw2002-03-028-25/+11
| | | | | | | 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.)
* __verpbounce(), __scanbounce(): Use self._open_list() to get abwarsaw2002-03-011-3/+2
| | | | MailList object instead of instantiating one explicitly.
* __verpbounce(), __scanbounce(): Make sure that we don't try to lock abwarsaw2002-02-281-4/+12
| | | | | | | | list that's already locked, e.g. the site list that we know we're processing for! Bug reported by Dan Mick. BAW: The loop in these two methods should really be factored out, but there's a bit of an impedance mismatch for the inner logic.
* _dispose(): We need to use msg.as_string() to flatten the message tobwarsaw2002-02-261-2/+2
| | | | | | plain text instead of msg.__str__(), otherwise we'll get the Unix From_ header in the output, which will bollux up NNTP. Bug discovered and fix verified by Ron Jarrell.
* A slightly cleaner way to do the freshening of MailList objects.bwarsaw2002-02-121-7/+6
| | | | | | | | | run(): After once through the loop, look at the freshen flag and if true, clear the cache. Thus all subsequent MailList objects will get updated state, but we'll gain the performance benefits of the cache for each iteration the the big loop. _open_list(): Return this function to its original state.
* __init__(): Default the self._freshen attribute to zero.bwarsaw2002-02-121-2/+13
| | | | | _open_list(): If we've pulled the list object from the cache, then freshen the state by re-Load()-ing it.
* __init__(): Set self._freshen so that the MailList cache in the basebwarsaw2002-02-121-9/+7
| | | | | | | | class knows to reload the state when pulling the object from the cache. Hmm, why do we even have a cache now? _dispose(): Don't do the `verp' key calculation here; it's done earlier and better in the ToOutgoing.py handler.
* get_switchboard(): Code cleanup. _sbcache does not need to bebwarsaw2002-01-261-2/+1
| | | | declared global.
* dequeue(): Handle the case when the email package throws abwarsaw2002-01-261-1/+17
| | | | | | | | | | MessageParseError during parsing of the message. Most likely cause is because of bad MIME encapsulation. /That's/ likely caused by the message being a virus <wink>. Disposition depends on QRUNNER_SAVE_BAD_MESSAGES. When true, the message text is saved in qfiles/bad. When false, it is discarded. We always log the error.
* _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
|
* __verpbounce(): Add some robustness for broken MTAs. We know of atbwarsaw2002-01-171-4/+20
| | | | | | | | | | | | least one in the wild (reported by Dan Mick) that leaves the To: header empty or useless, while the useful VERP'd bounce information ends up in a Delivered-To: header. Note that there can be multiple Delivered-To: headers so we need to search them all (and we don't worry about false positives for forwarded email, because only one should match VERP_REGEXP). Also try Apparently-To: if neither of the others yields a hit.
* __doperiodic(): RegisterBounce() -> registerBounce()bwarsaw2001-12-271-4/+4
|
* __verpbounce(): RegisterBounce() -> registerBounce()bwarsaw2001-12-271-2/+2
|
* __verpbounce(): Dan Mick points out that we were still hardcoding thebwarsaw2001-12-071-27/+26
| | | | VERP decoding. Use mm_cfg.VERP_REGEXP instead.
* Dan Mick discovers we need to import LockFile.bwarsaw2001-11-271-0/+1
|
* The qrunner that consumes qfiles/bounce messages, which come from thebwarsaw2001-11-211-0/+136
| | | | listname-bounces alias.
* _dispose(): Support for regular non-personalized VERP delivery.bwarsaw2001-11-201-0/+7
| | | | | Consults VERP_DELIVERY_INTERVAL to decide whether to set the `verp' metadata key.
* 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.
* This runner now only handles -request, -join, and -leave emails. Itbwarsaw2001-11-201-102/+10
| | | | | | | | | | | no longer handles any -admin or -owner messages, or any bounce processing. _dispose(): Don't look at the `authoritah' metadata key. Also, vastly simplify the main switch because it only needs to look at torequest, tojoin, and toleave. _toadmins(): Removed as unnecessary.
* _dispose(): Move the Save() call into the try (exceptions are morallybwarsaw2001-10-241-1/+1
| | | | equivalent to transaction aborts).
* We don't need this file any more, since everything's inlined withbwarsaw2001-10-181-229/+0
| | | | mailmanctl and qrunner.
* prepare_message(): Support the cleaning of headers based onbwarsaw2001-10-121-20/+16
| | | | | NNTP_REMOVE_HEADERS and NNTP_REWRITE_DUPLICATE_HEADERS as a more general approach.