summaryrefslogtreecommitdiff
path: root/Mailman
Commit message (Collapse)AuthorAgeFilesLines
...
* ADMIN_COOKIE_LIFE now defaults to 0. This means Mailman will now usebwarsaw2000-07-201-3/+6
| | | | | session cookies instead of persistent cookies for admin authentication (i.e. the cookie expires when the the browser exits).
* Remove commented out syslog() lines.bwarsaw2000-07-201-2/+0
|
* hexlify(), unhexlify(): Make Python 1.5.2 compliant; slightbwarsaw2000-07-201-4/+7
| | | | performance improvements.
* main(), authenticate(): Factored out of main(), this function nowbwarsaw2000-07-191-51/+62
| | | | | | | | | | | | | handles all the tasks of authentication. It returns 1 if auth succeeded, 0 if it failed. On failure it also prints the admin login page, so main() should just exit. Note: authenticate() here is slightly different than the function in admin.py, but they should be folded in together since they largely do the same work. PrintRequests(): No need to pass in the cgi data, since it isn't used in this function.
* main(), authenticate(): Factored out of main(), this function nowbwarsaw2000-07-191-54/+57
| | | | | | handles all the tasks of authentication. It returns 1 if auth succeeded, 0 if it failed. On failure it also prints the admin login page, so main() should just exit.
* Several changes which will hopefully fix the cookie re-authenticationbwarsaw2000-07-191-37/+33
| | | | | | | | | | | | | | | | | | | | | | | problem. Specifically, WebAuthenticate(): Coding style changes. MakeCookie(): Create the cookie value in such a way as to guarantee that only the characters [0-9][a-f] are used. This should eliminate the need for the ugly quote-hack in CheckCookie(), and eliminate the possibility that wacky characters like semicolon, comma, and space (not to mention binary data) can confuse the browsers. Specifically, we marshal the tuple ourselves and hexlify the results, setting the key to a string. That way we avoid the Cookie module pickling the data and creating a binary string. Also, coerce both `issued' and `expires' to integers. Use sha module and hexdigest() instead of md5 and digest() to hash password+now+expires. CheckCookie(): Remove the crufty cookie data quote-hack. Decode the cookie value by unhexlifying and unmarshaling the string value ourselves. Use sha module hexdigest() instead of md5's digest().
* hexlify(), unhexlify(): New helper functions for cookie value encodingbwarsaw2000-07-191-0/+20
| | | | and decoding.
* parseaddr(): If the Original-Recipient: or Final-Recipient: headersbwarsaw2000-07-171-1/+5
| | | | | are bogus and don't contain the required address type field, don't try to guess -- return None.
* Bump to 2.0beta4.bwarsaw2000-07-061-2/+2
|
* ArchiveMail(): Comment out the debugging prints to syslog.bwarsaw2000-07-061-2/+2
|
* __handlepost(): Ricardo Kustner noticed that the forward feature wasbwarsaw2000-07-061-2/+2
| | | | | broken. Set the message recips to a list to fix this. Fixes SF Bug #108215.
* intermediatebwarsaw2000-07-061-9/+9
|
* __init__(): time.mktime() can generate OverflowError.bwarsaw2000-07-061-1/+1
|
* open_ex(): Transfor OSError into IOError correctly (this is abwarsaw2000-07-051-2/+3
| | | | disgusting hack).
* Create(): Fold in the CreateFiles() method. Don't use self.Lock()bwarsaw2000-07-051-13/+11
| | | | | | | | | | here because that reloads the database as a side-effect - but the config.db file doesn't exist at this point! This fixes the newlist problem. Also, there's no need to create the LOCK_DIR file; and use a safer way to create the next-digest and next-digest-topics files (which I'm not sure are strictly necessary anymore). CreateFiles(): Removed.
* HoldMessage(): Make a copy of the msgdata dictionary so thatbwarsaw2000-07-051-0/+5
| | | | | subsequent changes won't be reflected in the request database. This fixes Ricardo Kustner's perplexing problem.
* __handlesubscription(): When subscribing the addr, ApprovedAddMember()bwarsaw2000-06-281-0/+3
| | | | | | will end up calling SaveRequestsDb() which closes the database. The hack is to re-open the database so that the del in HandleRequest() doesn't fail.
* Unlock(): Use unconditionally flag to avoid NotLockedErrors.bwarsaw2000-06-281-8/+5
| | | | | | | | | | | | | | | | | | | | | | Lock(): Always re-load the config.db file once the lock has been acquired. This fixes a very serious data consistency bug, explained briefly as: - Process A opens a list unlocked, loading the marshaled dictionary. Process A then tries to acquire the list lock. - Meanwhile, Process B does the same, but it actually acquires the lock first. Process B makes some changes, saves the list's marshal and relinquishes the lock. - Process A now acquires the lock. However, its database is now out-of-date because of the Process B write. It does its work and blithely rewrites the marshal, blowing away all of Process B's changes. The solution is to reload the marshal when the list lock is acquired. __init__(): Use the new Lock() semantics more efficiently.
* QRUNNER_PROCESS_LIFETIME: decrease to 15 minutes.bwarsaw2000-06-281-1/+1
|
* main(): syslog() call needs log file first argument.bwarsaw2000-06-286-6/+6
|
* main(): syslog() call needs the log file as first argument. Found bybwarsaw2000-06-271-1/+1
| | | | Ron Jarrell.
* ScanMessages(): Watch out for exceptions in RegisterBounce().bwarsaw2000-06-271-2/+13
|
* 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.
* QRUNNER_PROCESS_LIFETIME, QRUNNER_MAX_MESSAGES: Two new resourcebwarsaw2000-06-261-0/+9
| | | | | management variables for limiting the work a single qrunner process can do.
* 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"? ;)
* __init__(): When the mktime() call fails due to a "bogus year mostbwarsaw2000-06-261-1/+1
| | | | | | likely", initialize the date variable to a float time seconds, not a time tuple. This is because the following time.ctime() call expects a float.
* main(): syslog() requires first argument to be the logfile to log to.bwarsaw2000-06-261-1/+1
|
* ParseMailCommands(): Use mm_cfg.LIKELY_BOUNCE_SENDERS instead ofbwarsaw2000-06-231-3/+1
| | | | hard-coded list (see change in qrunner).
* LIKELY_BOUNCE_SENDERS:bwarsaw2000-06-231-0/+8
| | | | | | | # List of addresses (lhs of the @) that likely come only from MTAs # bouncing messages. This is used in qrunner and # MailCommandHandler.py to stop processing or forwarding such # messages.
* main(): syslog doesn't need a trailing newlinebwarsaw2000-06-231-1/+1
|
* Administrivia.__doc__: Fixed typo (closes SF bug# 108128).bwarsaw2000-06-231-1/+1
|
* GetConfigInfo(): Reword slightly the two toggles to be morebwarsaw2000-06-231-4/+12
| | | | | understandable. Also, added the volatile _mass_catchup attribute for explicitly catching up a linked newsgroup.
* Hackish support for `volatile' properties in the web interface.bwarsaw2000-06-231-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | I.e. these are selections that can be presented in an admin page, but don't directly affect the value of a saved list attribute. This is used for a "Mass Catchup" button in the gateway category. Volatile property convention is that the name starts with an underscore. Specifically, GetItemGuiValue(): For Radios and Toggles, only do a getattr() of varname if the name does not start with an underscore. Otherwise default the checked value to 0. This is bogus because it would be better to take the default value from the property description, but that's too much of an API change for now. ChangeOptions(): If the property name starts with an underscore, do something different. This has to check for specific volatile parameters, of which the only one currently is `_mass_catchup'. If that's the property and the value is true, then set usenet_watermark to None, which is the signal to gate_news to do a mass catchup (i.e. set the watermark to the last article currently on the server). Note that the GatewayManager category used to always do a mass catchup when gateway_to_mail was toggled. This isn't always the right thing, so this change allows the admin to explicitly do a catch up.
* __load(): Simplify logic in the IOError handler.bwarsaw2000-06-231-4/+2
|
* reap(): Added optional argument `func' which, if supplied, is abwarsaw2000-06-231-1/+3
| | | | | | function to call with no arguments, every time through the while loop. This lets callers, e.g. keep a lock fresh while waiting for all the children to finish.
* 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.
* DumbBTree.__init__(): Rewrote the file opening and unmarshaling codebwarsaw2000-06-231-5/+15
| | | | | | | | | | | to be more robust so that if either fail, we end up with an empty self.dict and self.sorted. Note that the archiver subprocess will still fail with an exception. Fixing this will require much more work on the archiver as a whole, and isn't worth it right now. But this fix averts the problem when regenerating the archive from scratch using bin/arch, so at least corrupt archives can be rebuilt.
* do_pipeline(): Added a failsafe around the delivery module's process()bwarsaw2000-06-231-1/+5
| | | | | call. If the module does a fork, and the child process returns here, we exit immediately.
* process(), hold_for_approval(): The clue that the message has comebwarsaw2000-06-231-2/+2
| | | | | | | | from the gate_news cronjob is that the msgdata dictionary will contain a `fromusenet' key. This was erroneously checking the msg object for the `fromusenet' attribute (as was the case with the old interface), which caused notifications to go to Usenet posters whose messages were held. Bogus!
* process(): ArchiveMail() now takes a second argument, msgdata, whichbwarsaw2000-06-231-1/+1
| | | | will get filled with the pids of any children that get forked.
* process(): Be extra paranoid about the forks and child processes.bwarsaw2000-06-231-7/+11
| | | | | | | Make absolutely sure that the child process exits without returning control to the caller. If we complete successfully, we exit with status 0. If any exception occurs we print a traceback and exit with status 1.
* PrintAddMemberRequest(): First value should be mm_cfg.SUBSCRIBE.bwarsaw2000-06-201-1/+1
|
* do_pipeline(): Factored out from DeliverToList().bwarsaw2000-06-201-5/+12
| | | | | | | | | DeliverToList(): Handle `_enqueue_immediate' by bypassing the call to do_pipeline and enquing the message immediately to disk. Still maintains the same interface to the outside world. Also, copy the pipeline list regardless of whether it comes from LIST_PIPELINE or from msgdata.
* process(): Use the volatile `_kids' key to store the child pids.bwarsaw2000-06-201-2/+2
|
* PrintPostRequest(), PrintAddMemberRequest(): Use the new valuesbwarsaw2000-06-201-2/+5
| | | | | parameter to RadioButtonArray() constructor, and use the new symbolic constants instead of the hardcoded values.
* process(): Relax the search constraints even more. I've now seen twobwarsaw2000-06-201-4/+7
| | | | | | slightly different bounce reports froma NMS 3.6 servers. We now search just for multipart/* parts, and look only for message/* sub-parts.
* RadioButtonArray.__init__(): New optional argument `values' which canbwarsaw2000-06-201-8/+13
| | | | | | | | | be a sequence of values to assign to the buttons. Must be the same length as the `button_names' sequence. If not given, the values are the ordinal position of the button. RadioButtonArray.Format(): A more efficient way of generating the HTML text.
* reap(): Wait on a dictionary of child pids. Moved here from gate_newsbwarsaw2000-06-201-0/+13
| | | | so other scripts can use it.
* Use the constants defined in Defaults.py.inbwarsaw2000-06-201-21/+24
| | | | | | | | | HandleRequest(): Default comment, preserve, forward, addr arguments to None. Instead of raising LostHeldMessage() here, return LOST constant so the pending database can maintain consistency. Also, enqueue the message immediately instead of trying to delivery it here. This improves performance by pushing delivery off to qrunner, and it also helps to maintain pending database consistency.
* Enqueue(): New convention; msgdata keys that start with leadingbwarsaw2000-06-201-0/+5
| | | | underscore are volatile and don't get saved to disk.