summaryrefslogtreecommitdiff
path: root/Mailman
Commit message (Collapse)AuthorAgeFilesLines
...
* checkperms(): 'mode' -> 'stat[ST_MODE]'.twouters2001-07-101-1/+1
| | | | | | Slight style nit, too: code is using 'oct()' to convert mode to a string, instead of a '0%(mode)o' format. Changing this to make more sense would break translations, though :P
* Move COMMASPACE global from NewsRunner.py (where it isn't used) totwouters2001-07-102-2/+1
| | | | | | ToUsenet.py (where it is.) This is probably a glitch in the functionality split, anyway, and moving around the global saves on creation and destruction costs. Very important, that!
* main(): don't call handle_no_list() with a 'doc' argument: it doesn't wanttwouters2001-07-101-1/+1
| | | | it, and we don't have it to start with!
* process(): Remove any Urgent: headers since these can containbwarsaw2001-07-101-1/+2
| | | | passwords.
* send_i18n_digests(): Because messages are now enqueued as pickles bybwarsaw2001-07-101-7/+3
| | | | | | | | | default, we can't use a StringableMIME class here, otherwise it won't have a get_sender() method when unpickled. So instead, use a Message.Message class and just set Content-Type: and MIME-Version: headers manually. StringableMIME: Removed.
* All classes should use the renamed base class: Errors.MessageHeld =>bwarsaw2001-07-101-10/+10
| | | | Errors.HoldMessage.
* MessageHeld => HoldMessagebwarsaw2001-07-101-1/+4
| | | | | RejectMessage: New base exception class, used to signal messages that should be bounced back to the original sender.
* bump_digest_volume(): Fixed cut-n-paste typos (mlist => self).bwarsaw2001-07-101-2/+2
|
* GLOBAL_PIPELINE: Move CalcRecips ahead of Cleanse since the formerbwarsaw2001-07-101-1/+2
| | | | | | | | | will calculate recipients based on the Urgent: header, while the latter removes the Urgent: header from the original message (so it wouldn't be there by the time CalcRecips see it!). BOUNCEQUEUE_DIR: New variable in preparation for a separate bounce processing queue.
* BounceMessage(): New method that will `bounce' a message back to thebwarsaw2001-07-101-0/+19
| | | | | | | message sender (calculated with msg.get_sender()). It actually wraps the original message up in a message/rfc822 MIME document and stuffs that into a multipart/mixed with the first part being the bounce message.
* _shortcircuit(): Return self._stop as a default. This allows abwarsaw2001-07-081-1/+1
| | | | | runner.stop() method call to break the __oneloop() loop after any single message is processed.
* Cleaner startup/restart/shutdown implementation. This allows thebwarsaw2001-07-081-30/+48
| | | | | | | | | | | | | | | | | | | | | | | | sub-qrunners to cleanly exit themselves instead of potentially stopping them in the middle of processing a message. Specifically, sighup_handler(): Send SIGHUPs to the child processes instead of SIGINTs. start_lock_refresher(): Install our own SIGHUP handler, which simply toggles off an instance-based loop flag. The signal kicks us out of the sleep, so the next while test will return false and break us out of the loop, existing the lock refresher. No need to deal with KeyboardInterrupts. start_runner(): In the parent, just return the pid of the child. In the child, do the syslogging, and also install our own process's SIGHUP handler, which will call the qrunner's stop() method. This lets the qrunner break out of its loop at the next convenient place (i.e. after processing one of its files). Again, no need to deal with KeyboardInterrupts. master(): More accurate syslog messages. Also, make sure the children receive SIGHUP instead of SIGINT.
* Need to import sys!bwarsaw2001-07-061-14/+18
| | | | | | change_options(): Fixed the call to ApprovedAddMembers() so that we're correctly passing through the values of the form variables send_welcome_msg_to_this_batch and send_notifications_to_list_owner.
* get_sender(): Watch out for missing Sender: or From: fields, whichbwarsaw2001-07-061-4/+15
| | | | | | | | | | | cause None to be returned from self.__getitem__(). Keep looking through headers if that happens (this avoids a bug reported by Mentor Cana on messages with no Sender: header and USE_ENVELOPE_SENDER set to true). send(): If the message doesn't have a Message-ID (and it probably won't), craft one. This aids in debugging because the message-id will get logged to logs/smtp.
* unique_message_id(): New function to craft a guaranteed unique Message-ID.bwarsaw2001-07-061-0/+19
|
* process(): Call syslog.write_ex() directly (instead of syslog.write()bwarsaw2001-07-061-8/+8
| | | | | | implied by syslog.__call__()), passing in the MsgSafeDict instance to the kws argument. This works around the Python limitation that **kws in extended calls must be concrete dictionary objects.
* LogMsg() -> write()bwarsaw2001-07-061-3/+10
| | | | | | | | | | | | | write(): Just call new function write_ex(), passing arguments through. write_ex(): Use explicit arguments to pass in the args tuple and kws dictionary. This is because Python requires **kws in extended calls to be concrete dictionary objects, not generic mapping objects. SMTPDirect wants to pass in an instance of (subclassed) UserDict, so it calls write_ex() directly. Also, stash the msg argument in local variable origmsg, which is used if we get an exception during string interpolation.
* prepare_message(): Use Utils.unique_message_id() to generate thebwarsaw2001-07-061-6/+13
| | | | | | | | Message-ID header. mcre: Message-ID headers crafted by Mailman now include a serial number. Recognize this, and also use a verbose regular expression so it's not so cryptic.
* _open_list(): The lockp argument was unused, so remove it.bwarsaw2001-07-061-1/+1
|
* intermediatebwarsaw2001-07-051-0/+205
|
* PIDFILE: new variable pointing to $prefix/data/qrunner.pidbwarsaw2001-07-051-0/+1
|
* main(), show_results(): Removed unnecessary global declarations.bwarsaw2001-07-031-5/+1
| | | | | | | | | main(): If the WebAuthenticate() fails, search for the form key `adminpw' -- not `admlogin' -- to decide whether to include the error message or not. The former is the cgi key for the password field, while the latter is the key for the submit button, which isn't included in a Mozilla posted form if the Enter key is hit instead of clicking on the button.
* ConfirmUserPassword(): Obsolete; removed.bwarsaw2001-07-031-27/+49
| | | | | | | | | | | | | AuthContextInfo(): Allow `user' argument to be optional; default to None. Authenticate(): Re-install backwards compatibility for pre-MM2.1 list passwords. For AuthListAdmin context only, if the sha check fails, fallback to crypt (if the crypt module could be imported) and md5 checks. If either of the latter two matches, assume that the list password is "old style" and auto-upgrade it to the sha password, based on the matching plain text response. This way, MM2.0.x list passwords won't just be broken upon an upgrade.
* DEAL_WITH_PERMFAILURES_EVERY: controls how often _doperiodic() willbwarsaw2001-06-281-1/+12
| | | | | | | | | | | | | try to deal with deferred permanent failures. _doperiodic(): It can be a bit expensive to actually deal with permanent failures every time through this loop, and we don't need that level of accuracy. So now we keep a counter and only process permanent failures every DEAL_WITH_PERMFAILURES_EVERY times. (Okay, so this variable defaults to 1, but you get the idea. :) Also, move the Save() inside the try clause. I've decided that finally clauses should only unlock the list, not try to save it.
* Several changes which allow subclasses to do some calculation for eachbwarsaw2001-06-281-3/+48
| | | | | | | | | | | | | | | | | | | | | file processed. This would allow for example, a throttling algorithm which limited the number of files processed per time period, or when load averages were too high. Specifically, run(): Allow __oneloop() to return any false value, not just zero, to trigger the snooze alarm. __oneloop(): After each file is processed, call _shortcircuit() and break out of the file loop if that returns a true value. This way, _shortcircuit() is executed for each file processed, and gives subclasses a chance to do some per-file calculation. _doperiodic() is at a finer granularity, since it conflates per-file and per-processing-loop calculations. _cleanup(), _dispose(), _doperiodic(), _snooze(), _shortcircuit(): Add docstrings describing their interface. _shortcircuit(): Default is to return 0, meaning don't shortcircuit.
* UserNotification.__init__(): change the signature so that the textbwarsaw2001-06-281-2/+3
| | | | | argument defaults to None. Only set the payload when the text argument is not None.
* Performance enhancement. In order to save on the time it takes tobwarsaw2001-06-271-18/+35
| | | | | | | | | | | | | | | | | | | | | parse and generate the plain text message each time it's enqueued or dequeued, we now use a binary cpickle as the message representation file. This is controlled by a module global SAVE_MSGS_AS_PICKLES which defaults to 1. When a message is saved as a pickle, its extension will be .pck instead of .msg. dequeuing will automatically recognize the different message formats and load accordingly. Specific changes include: enqueue(): If SAVE_MSGS_AS_PICKLES is set and the message metadata does not have a "_plaintext" key, then the message object is stored as a binary cpickle dump for speed. The incoming scripts post, join, leave, etc. will set the _plaintext key because they funnel the text straight from stdin to the .msg file, and the message text is only parsed on the first dequeue from qfiles/in. dequeue(): First try to load and unpickle the .pck file, falling back to loading and parsing the .msg text file if the former is missing.
* GetStandardReplacements(): When displaying the selected language,bwarsaw2001-06-271-2/+5
| | | | | first try to get the index of the explicit argument, falling back to the list's preferred language, and the server's default.
* main(): Fixed the handling of the user's preferred language. Now itbwarsaw2001-06-271-10/+10
| | | | | | | | | is retrieved out of the cgidata early on, so as to catch any new language setting the user is making. Falls back to using the last stored user preference. Also, fixed indentation bug which prevented user's language setting to take effect unless they had set some other option as well.
* main(): Fix this to use the new authentication machinery.bwarsaw2001-06-271-5/+13
|
* process(): Add support for configurable log files. Four new variablesbwarsaw2001-06-271-14/+34
| | | | | | | | | | | | have been added: SMTP_LOG_EVERY_MESSAGE SMTP_LOG_SUCCESS SMTP_LOG_REFUSED SMTP_LOG_EACH_FAILURE The usage and format of these variables are described in Defaults.py.in.
* Add support for configurable log files, at least for the SMTPDirectbwarsaw2001-06-271-6/+73
| | | | | | | | | | | | | | module. Four new variables have been added: SMTP_LOG_EVERY_MESSAGE SMTP_LOG_SUCCESS SMTP_LOG_REFUSED SMTP_LOG_EACH_FAILURE The usage and format of these variables are described in detail in the preceding comment block. Also, HTML_DIR and CGI_DIR are removed since they are unused.
* Better syslog() calling conventions.bwarsaw2001-06-271-6/+2
| | | | | | | _dispose(): Remove the "except Exception" class which allows any exceptions to percolate up to Runner.__oneloop()'s catch-all exception handler. Runner properly implements the log-and-shunt procedure for any such exceptions.
* Remove an unused import.bwarsaw2001-06-271-1/+0
|
* Better syslog() calling conventions.bwarsaw2001-06-2710-22/+22
|
* Better syslog() calling conventions. Also, don't mark syslog messagesbwarsaw2001-06-2710-14/+12
| | | | as translatable.
* Better syslog() calling conventions. Also, log some messages tobwarsaw2001-06-271-4/+4
| | | | `mischief' instead of `error'.
* Use better syslog() calling convention.bwarsaw2001-06-271-4/+4
|
* Use better syslog() calling convention.bwarsaw2001-06-271-4/+3
|
* Use better syslog() calling convention.bwarsaw2001-06-274-54/+51
|
* MsgSafeDict(): New class which is used in SMTPDirect and allows forbwarsaw2001-06-271-0/+27
| | | | | syslog format strings to include information from the message headers.
* Use better syslog() calling convention.bwarsaw2001-06-271-9/+8
| | | | Also, syslog messages should not be marked as translatable.
* write(): Compare to None with `is' not `=='.bwarsaw2001-06-271-3/+6
|
* LogMsg(): Extended function signature to make argument passing bothbwarsaw2001-06-271-3/+12
| | | | | | nicer and more robust. String interpolation is now done here instead of at callee site, so exceptions like TypeError and ValueError can be caught and dealt with better.
* print_results(): Toggle off the output of <head><body> tags by settingbwarsaw2001-06-251-0/+5
| | | | | | doc.suppress_head to 1. This is because the output generated from this function comes largely from the subscribe.html template, which includes those tags.
* options_page(): Toggle off the output of <head><body> tags by settingbwarsaw2001-06-251-0/+5
| | | | | | doc.suppress_head to 1. This is because the output generated from this function comes largely from the options.html template, which includes those tags.
* Classes Document and HeadlessDocument are almost identical, exceptbwarsaw2001-06-251-30/+29
| | | | | | | | | | | | | | | | | that the former adds <head><body> tags, while the latter suppresses them. Document should be used for pages that are created by the scripts out of whole cloth, while HeadlessDocument should be used for any template-based page (which must supply its own head & body tags, although not all of them do, I think). It turns out to be useful to transform a Document into a HeadlessDocument, so the trigger to output the head & body tags is the instance variable "suppress_head" which Document defaults to 0 and HeadlessDocument defaults to 1. All the real work is performed in Document.Format(). Document.get_content_type(): Add the extra newline here, for convenience.
* listinfo_overview(): Applied David Champion's SF patch 401452 tobwarsaw2001-06-071-4/+9
| | | | alternatively highlight the list rows.
* admin_overview(): Applied David Champion's SF patch 401452 tobwarsaw2001-06-071-3/+9
| | | | alternatively highlight the list rows.
* Added WEB_HIGHLIGHT_COLOR; adapted from David Champion's SF patchbwarsaw2001-06-071-0/+2
| | | | 401452.