summaryrefslogtreecommitdiff
path: root/Mailman (follow)
Commit message (Collapse)AuthorAgeFilesLines
* .__repr__(): Use the class name in the repr string, rather thanklm1998-08-031-7/+9
| | | | | | | hardcoded "Logger", so derived classes (eg, StampedLogger) identify themselves correctly. .__init__(): Clarified function docstring a bit.
* TrySMTPDelivery(): Regularize the ways that various exceptions areklm1998-08-031-14/+21
| | | | expressed, and log failures to smtp-failures.
* Some small refinements to some options descriptions. (Prompted byklm1998-08-011-8/+11
| | | | potential confusion pointed out by jeremy.)
* TrySMTPDelivery: The queueing activity had to be more discriminating,klm1998-08-011-5/+26
| | | | | | | | | | | | | | | | | or else failures, like bad local recipients, would remain on the queue forever, and cause repeat deliveries. (I believe this is part of the problem behind the repeats we're seeing - but i'm not convinced it's all of it.) To fix, i made it so only partcicular exceptions - currently socket.error, for absent SMTP listener - cause items to be left on queue. Otherwise it falls through to a blanket except which discards the item, leaving a note in the error log to that effect. *** I think where the info should go back to the maillist structure, to, e.g., disable the recipient, or whatever. However, this is happening in a forked process, so we cannot use an exception, and the routine itself doesn't, and shouldn't know which the list is.
* CGI_MODULES: *.py instead of error-prone explicit listbwarsaw1998-07-311-3/+1
|
* MODULES: *.py instead of error-prone explicit listbwarsaw1998-07-311-7/+1
|
* call_script(): Two fixes: first past `list' in as a parameter so youbwarsaw1998-07-311-4/+5
| | | | | | | | don't accidently get the built-in list function. Second, import and run main() of the passed in `which' script, which seems currently to be only options.py. Q: How did this ever work???
* StampedLogger.__init__(): Added new default argument `immediate'bwarsaw1998-07-311-3/+6
| | | | which is passed through to the Logger.__init__().
* __logexc() => _logexc()bwarsaw1998-07-311-4/+4
| | | | XXX: This class is no longer used by the driver script.
* __logexc() => _logexc()bwarsaw1998-07-311-9/+16
| | | | | | | | | | | Logger.__init__(): New default argument `immediate' says to open the log file immediately upon creation (so we learn of errors early). Otherwise the log file is opened when first needed. Logger.__get_f(): Re-raise the exception using Python 1.5 semantics; can't guarantee everyone has Python 1.5.1. Also if nofail, then set the file pointer to be sys.__stderr__ so at least the exceptions will get logged to the Web server log file.
* __logexc(): Renamed to _logexc() -- single leading underscore -- so itbwarsaw1998-07-311-1/+2
| | | | doesn't get name mangled.
* Removed import of marshal. It isn't used here.bwarsaw1998-07-231-1/+0
|
* .DeliverToList(): Restructured to send deliver parameters via itsklm1998-07-231-30/+21
| | | | | | | stdin, instead of as command line arguments, to avoid exposing addresses to shell. In the process, eliminated the use of the temp file for the content - it's passed via stdin as well. Also, fixed or removed some obsolete comments, etc.
* SmtpConnection.send(): More provision for when a local address isklm1998-07-231-7/+27
| | | | | | | | | | | | | | | | | | recognized as bad and refused immediately (rather than being queued up, as happens for any offsite recipients). In particular, had to detect whether all recipients in the batch failed, and then just return - otherwise the DATA command would fail (no valid recipients), and raise a disruptive exception. It's worth noting that no bounce is generated for invalid local recipients, which means now way to disable or even notice that they're bad. This should be rectified at some point, but offhand i'm not sure the right way, other than by special casing local deliveries. Anyway, i left an XXX note to sorta this effect in the code. And finally - it looks like the "official" python smtplib already does the right kinds of thing regarding bad recipients, which makes me feel good about merging with it.
* Fixed package name in import of __logexc. If the module is not in thebwarsaw1998-07-231-1/+1
| | | | | | current directory, the full path of the package must be given. Strictly speaking, the package path isn't necessary since it is guaranteed to find the right Utils.
* Added a LogStdErr() call to enable error logging from this module allklm1998-07-231-10/+2
| | | | the time.
* Simplify the import, exploiting the fact that it's within the package.klm1998-07-232-2/+2
|
* LogStdErr(): New routine to simplify hooking up a StampedLogger withklm1998-07-231-0/+21
| | | | sys.stderr (and tee it to sys.stdout, also).
* __del__(): Only unlock if locked.bwarsaw1998-07-222-2/+4
|
* InitTempVars(): Remove the call of HTMLFormatter.InitTempVars() sincebwarsaw1998-07-221-1/+1
| | | | | | that method has been renamed. InitVars(): Added a call to HTMLFormatter.InitVars()
* InitTempVars(): Two changes, first after our conversation at lunch, Ibwarsaw1998-07-221-3/+3
| | | | | | | believe this should be InitVars(). Second, I move the list's HTML template files into $prefix/lists/<listname>. SnarfHTMLTemplate(): Call InitVars() instead of InitTempVars()
* set_pending(): wrap the code between the lock and the unlock in abwarsaw1998-07-221-4/+8
| | | | try/finally, with unlocking being done in the finally clause.
* Several changes, primarily to make this more robust. So far, no morebwarsaw1998-07-222-52/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | locking problems. JV please eyeball... 1. Got rid of is_locked attribute. Test for locking makes an explicit test that a) the tmpfname exists and b) the pid read from the file is our pid. This means that two instances of FileLock in the same process that share the same lockfile will always be locked and unlocked together (probably doesn't occur except in testing). 2. Added an __del__() which unlocks 3. Moved the creation of the basic lockfile to __kickstart() and added a force argument. When force is true (default is false), the lockfile is first removed then recreated. This is only used if the lockfile contains bogus data, such that the winner could not be determined. In that case, the only way to "break" the lock is to recreate a new basic lockfile. This could potentially leave tmpfname turds, but in reality this shouldn't happen very often. 4. Encapsulate reading and writing of the lockfile into __write() and __read(), so that (most importantly) the umask will be set correctly. This should fix most of the permission problems associated with the lockfile by assuring that they are group writable. A side effect: don't eval() the contents of the lockfile. 5. lock(): Use the above changes. Added an assert for what I think is an invariant: that the winner filename better not be equal to self.tmpfname. Moved the timeout check into an else clause of the pid comparison and eliminated the check of hung_timeout > 0 (this is the one I'm least sure about).
* CreateSubscribeAck(): Wrap the self.welcome_msg. This is typed into abwarsaw1998-07-221-2/+3
| | | | | | | web form by the user who probably doesn't hit hard carriage returns. This looks ugly went emailed in the raw. SendUnsubscribeAck(): Likewise for self.goodbye_msg
* wrap(): Two small fixes: strip off the two extra newlines that get putbwarsaw1998-07-221-2/+9
| | | | | on the end of the last line of wrapped text; watch out for whitespace at the front of split lines.
* Add new OutgoingQueue.py to the list of MODULES.klm1998-07-211-1/+1
|
* Whoops, there was another call to smtplib that needed the indirection.viega1998-07-202-4/+1
|
* Wrapped the call to smtplib with some queueing code.viega1998-07-202-3/+66
| | | | There's a new crontab entry that checks the queue once every 30 mins.
* PrintRequests(): happened to notice a typo while here.klm1998-07-201-2/+3
|
* PrintRequests(): call to list.RequestsPending() becomesklm1998-07-201-1/+1
| | | | list.NumRequestsPending() (missed this one when i made the change).
* .Unlock(): Do not raise an exception if the list is already unlocked,klm1998-07-171-3/+4
| | | | | just return. (Was raising two different AttributeErrors, depending on whether or not the list had never been locked.)
* .getresp(): Moved setting of self.lastresp to before the impunityklm1998-07-171-5/+9
| | | | | | return - despite the fact that lastresp is not apparently used anywhere, i'm not ready to just yank it, and so it might as well be in the right place.
* NumRequestsPending(): Changed name from RequestsPending(), reflectingklm1998-07-171-1/+1
| | | | the fact that it returns a number, and not a list of requests...
* .SentTextToUser(): Somebody (correctly) got rid of theklm1998-07-161-1/+0
| | | | | | repr(recipient), since the underlying SendTextTouser() no longer forks a command via a shell, but left the comment in, so i'm getting rid of the comment.
* Corrected docstring-typo, missing close paren.klm1998-07-151-1/+1
|
* In all multiple-destination sends, *ignore* the MTA response whenklm1998-07-141-10/+15
| | | | | we're specifying the recipients. This way, one bad one in a batch will not clobber the whole send...
* Neglected to apply format value for 'remote', to be used in theklm1998-07-131-1/+1
| | | | verify.txt.
* New var "DEFAULT_PLAIN_DIGEST_KEEP_HEADERS" specifies the reallyklm1998-07-131-8/+3
| | | | | | | | | | | | | | | | | | interesting headers that should be kept in the plain digests. The only potentially controversial one in my initial inclusion is 'organization', which i think can be essential on professional lists. I'd be interested to hear whether there's any other essiantial ones i've neglected to include... The current list is: message date from subject to cc reply-to organization
* For plain digests we now filter the headers to remove everything butklm1998-07-131-4/+54
| | | | | the really interesting ones, as specified with defaults setting, 'mm_cfg.DEFAULT_PLAIN_DIGEST_KEEP_HEADERS'.
* .ProcessSubscribeCmd(): Using .FinishSubscribe(), which handles allklm1998-07-131-37/+47
| | | | | | | | | | | | | | | | | the constraints. (It looks like .FinishSubscribe() was made for this purpose, but not used anywhere! Perhaps it was used but someone inadvertantly switched away from it. I changed the location of the definitions to reflect .FinishSubscribe()'s subordinate role. Also, adapted to new version of verify.txt. .FinishSubscribe(): added option for running AddApprovedMember, so this routine can be used for both kinds of Add*Member. Also, fixed crashing NameError reference in MMNeedApproval case. Also, logging error details in case where unrecognized disposition exception is encountered. Added docstrings to help distinguish the relationship of .ProcessSubscribeCmd() and .ProcessConfirmCmd()
* Better RFC 821 compliance (MAIL and RCPT, and CRLF in data)guido1998-07-131-15/+37
| | | | by Carey Evans <c.evans@clear.net.nz>, for picky mail servers.
* .ParseMailCommands(): Escape the list real_name that's interpolatedklm1998-07-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | into the confimation-expression pattern, to prevent regex-significant characters in maillist names from tripping-up the regex compiler. This really can happen - in fact, it does when people try to subscribe to the "c++-sig"! (I've cursorily checked through the python stuff in scripts, Mailman, and Mailman/Cgi for other interpolations that might trip re.compile, but didn't find any other instances. Be on the lookout, though, this is a tricky one...) (This was present in 1.0b4, as well, and i believe it accounts for two elusive, outstanding problems: - the "pcre.error : ('nothing to repeat', 2)" traceback, which i mentioned on my recent "problems" list, and - reports i've gotten (one this morning, coincidentally) of failures in subscribing to c++-sig.) I'm going to deliver a patch for 1.0b4 to the newsgroup, once i track down a few other problems.)
* Prevent processing of exactly duplicated commands. This isklm1998-07-121-3/+18
| | | | | | | particularly to avoid the inevitable duplication in the subject and body, common for other mlm's, where people forget whether it's the subject or the body that has effect. In mailman, it's both - but now, not for duplicates.
* Informatively reject mail-command attempts to subscribeklm1998-07-121-3/+8
| | | | | | | | | | | | | | | | | | | already-subscribed members. (The prior checkin was for web-based subscription attempts.) NOTE that both these already-subscribed actions can constitute privacy leaks - someone could venture subscription attempts with addresses which they are trying to test for already-existing membership - and this response will provide unequivocal confirmation in the cases when the addresses are subscribed. One possible remedy is to send the refusal to the address being subscribed. This way the person taking the action gets no additional info unless they have access to the subscribees email channel. Problem with this is that it complicates the mail-command refusal process substantially, since it's currently geared, very simply, to send the refusal to the requesting address. Do we think the privacy leak is important enough to fill this hole?
* Recognize and refuse, in an informative way, subscription requests forklm1998-07-121-4/+10
| | | | | | already-subscribed members. (Wrapped a couple of long lines.)
* main(): There was a missing or incorrect format interpolation var forklm1998-07-121-2/+7
| | | | | | the verify.txt message, causing the subscribe script to bomb. I've corrected the field and refined the message a bit, to put in the origin phrase only if it's been discerned.
* The name_pat regex (which was alleged to have been "fixed" on the lastklm1998-07-111-9/+12
| | | | | checkin) would not compile, causing this script to completely fail - it should have been tested!
* ProcessSubscribeCmd(): Fixed a few of the other keys :-(bwarsaw1998-07-061-2/+2
|
* RefuseRequest(): Convert to maketext()bwarsaw1998-07-061-29/+13
|
* SendTextToUser(): Don't propagate removed raw flagbwarsaw1998-07-061-2/+2
|