summaryrefslogtreecommitdiff
path: root/Mailman
Commit message (Collapse)AuthorAgeFilesLines
* getallrecipients(): returns a tuple list of all To: and Cc: headerbwarsaw1999-01-121-0/+16
| | | | recipients, parsed with AddressList()
* Copied from Python 1.5.2 since we'll need the new interface.bwarsaw1999-01-121-0/+904
|
* main(): when crafting the admlogin.txt and there's no REQUEST_URI, fixbwarsaw1999-01-091-1/+1
| | | | cut-and-paste error (found by Balazs Nagy).
* Copied from the Python 1.5.2 distribution.bwarsaw1999-01-091-0/+107
|
* ChangeOptions(): In `subscribees' section, ValidateEmail() now handlesbwarsaw1999-01-091-9/+2
| | | | | catching blank lines, so we can (mostly) get rid of the special treatment here.
* ValidateEmail(): Raise a MMBadEmailError on empty str.bwarsaw1999-01-091-0/+2
|
* GetAbsoluteOptionsURL(): Downcase the address, since it could come inbwarsaw1999-01-091-1/+2
| | | | here in its case-preserved form.
* GetValidValue(): Use new ValidateEmail() interface andbwarsaw1999-01-091-12/+9
| | | | | | | | EmailAddressError, and clean up logic. ChangeOptions(): In the `subscribees' section, add a call to ValidateEmail() so that invalid email addresses can't be added in the Membership Management text window.
* ApprovedAddMember(): Use the new ValidateEmail() interfacebwarsaw1999-01-091-2/+2
|
* ValidateEmail(): Renamed from ValidEmail().bwarsaw1999-01-091-13/+13
| | | | | | | | | | | | | | | | Cleaned up its interface so that it always raises an exception if an address problem is uncovered (it used to both raise exceptions and return 0 or 1). It now has no useful return value. Added a re to barf on other unacceptable characters in an email address, currently: [ ] ( ) < > | ; Should there be others? The test that were there are retained, but the domain_parts test was cleaned up (there was a redundant test in there). Note that now unqualified addresses (e.g. those that don't contain an `@' are now DISALLOWED). This goes partially toward Greg Stein's suggestion.
* A start on the conversion to class-based exceptions :-)bwarsaw1999-01-091-2/+9
| | | | | | | Because I want to be able to catch both MMBadEmailError and MMHostileAddress in a `politically correct' and clean except clause, I made both exceptions classes which derive from new exception class EmailAddressError.
* main(): in previous VARHELP workaround, QUERY_STRING could exist butbwarsaw1999-01-091-3/+4
| | | | be an empty string.
* HandleRequests(): the entries in the FieldStorage `form' could be abwarsaw1999-01-091-1/+4
| | | | | list, and not have a `value' attribute. Don't try to int()ify them if so.
* main(): Kludge-around for accessing variable details when cookies arebwarsaw1999-01-081-13/+23
| | | | | | | | | | | | | | disabled. The problem: because cookies are disabled, the admin has to authenticate for each access. We can't change this because otherwise option values could leak. So when the admin fills in the password and clicks `let me in...', the form gets POSTed, and even those the variable to get details on is given in the form's ACTION, cgi.py ignores any QUERY_STRING on a POST. Maybe cgi.py should be fixed? In the meantime, we just watch for the FieldStorage having a `request_login' field and a QUERY_STRING environment variable. In that case, we manually parse out the query string and use its value if available.
* DeliverToList(): Ignore ECHILD exceptions that have been reported onbwarsaw1999-01-081-1/+17
| | | | | Linux systems when we close the cmdproc pipe. We could be masking a real bug, but I can't figure it out, and it seems harmless.
* Changes to workaround some bogus clients which either don't include abwarsaw1999-01-081-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | content-type header, or include a bogus one. cgi.py FieldStorage.__init__(): if there is no content-type header, use text/plain for inner parts, but application/x-www-form-urlencoded for outer parts. Honor any existing content-type header. Lower down, if the content-type header is something we don't understand, default to text/plain for inner parts, but application/x-www-form-urlencoded for outer parts. This patch will be proposed for Python 1.5.2 driver run_main(): Play some games to get Mailman's special cgi.py module. We import it from Mailman.pythonlib.cgi, but then we jam this module into sys.modules['cgi'] so all those imports in all those Mailman.Cgi scripts get our special one (without having to hack all those scripts!)
* Minor reformattingbwarsaw1999-01-081-4/+4
|
* Added cgi.py from Python 1.5.2 distribution.bwarsaw1999-01-081-0/+1341
|
* chunkify(): Don't put mm_cfg.DEFAULT_ADMIN_MEMBER_CHUNKSIZE as abwarsaw1999-01-061-1/+3
| | | | | | default arg value because then this module can't be imported in older versions of Mailman. Use None in the arglist, and set to the proper value when None is detected.
* processQueue(): We can pretty much guarantee that if an os.error isbwarsaw1999-01-051-7/+2
| | | | | | raised from the os.stat() call, the value will unpack into a two-tuple. So just do the unpacking in place, check the code and use Utils.reraise() if it wasn't what we expected.
* TemporaryFile(): Divergence from Python 1.5.2 version. Can't use barebwarsaw1999-01-051-1/+6
| | | | | | `raise' here since we may be running under Python 1.5. I don't use Utils.reraise() because I don't want to import Utils, so just do the manual sys import and raise.
* Added a TODO: fix the file!bwarsaw1999-01-051-0/+1
|
* reraise(): can now take an optional val argument, which is only usedbwarsaw1999-01-051-3/+7
| | | | | | when exc is not None. open_ex(): Use reraise().
* Save(): Can't use a bare `raise' here, since Python 1.5 doesn't havebwarsaw1999-01-051-1/+1
| | | | | it and there are still some 1.5 users out there (thanks Brad Crittenden for finding this).
* IsAdministrivia(): Made more stringent about 'set' command, since weklm1999-01-051-2/+5
| | | | | | | | | | | | | | | | | | | got a false positive for a message that had the last line of a paragraph (hence, short enough to look like administrivia) begin with 'set'. - Require all 3 arguments (for some reason it was requiring 2 or 3, while MailCommandHandler seems to clearly require 3 - perhaps we want to catch malformed administrivia, i'm just assuming not) - Require second arg of set command matches to be 'on' or 'off'. I guess administrivia is a delicate balance between weeding out non-administrivia and catching mis-directed admin messages, even ones that were badly formed. I'm inclined to opt for greater stingency, at the risk of not catching malformed and misdirected admin messages. Tough luck, the misguided poster will have to change their password. (I bet i get stung by this one day, myself...)
* SendMailToNewsGroup(): Slight reconfiguration of error messagesbwarsaw1998-12-301-7/+7
|
* SendMailToNewsGroup(): Don't raise an exception when either thebwarsaw1998-12-301-4/+8
| | | | | | | | linked_newsgroup or nntp_host is empty. Instead log the error to logs/error and just return, otherwise the email doesn't get posted to the list. Removed exception ImproperNNTPConfigError.
* FormatMembershipOptions(): Changes to the table that gets built tobwarsaw1998-12-301-8/+28
| | | | | | make it much more readable. First, use bare checkboxes and column headers for what used to be the checkbox labels. Put a border around the table. Add a legend for what the column headers mean.
* new class: DefinitionListbwarsaw1998-12-301-5/+14
|
* AddMember(), ApprovedAddMember(): In both cases, normalize addressbwarsaw1998-12-301-0/+14
| | | | | through Utils.ParseAddrs() to get the real email address out of the name argument.
* In `subscribees' section, parse address through Utils.ParseAddrs() sobwarsaw1998-12-301-0/+1
| | | | | the success notification specifies the address instead of any other goo.
* ParseAddrs(): New function which attempts to parse out the emailbwarsaw1998-12-301-0/+42
| | | | | | | | | | addresses from lines such as User J. Person <person@allusers.com> person@allusers.com (User J. Person) It also handles bare email addresses. While this is rather simplistic regexp matching, I think it will catch most situations.
* __get_f(): Use Mailman.Utils.reraise()bwarsaw1998-12-291-5/+2
|
* Use the default argument to the reraise() functionbwarsaw1998-12-291-4/+4
|
* reraise(): exc argument is optional, to more closely resemble Pythonbwarsaw1998-12-291-2/+5
| | | | 1.5.1's bare raise statement
* ChangeOptions(): Rework the test for empty or whitespace-only blankbwarsaw1998-12-291-8/+18
| | | | line in mass subscribe dialog. The old way didn't really work.
* LogStdErr(): small patch to ensure we get a stdout. Python 1.5bwarsaw1998-12-291-1/+5
| | | | | | doesn't have the attribute sys.__stdout__; although this is placed into the sys module by the driver, I think there are non-CGI paths to this code.
* Be sure we import the latest version of tempfile.py from the Pythonbwarsaw1998-12-291-8/+13
| | | | | | 1.5.2 distribution, so that names are uniquely generated in fork() related children. Use a simlar import/hasattr trick as when importing the latest smtplib.py
* Copied from the Python 1.5.2b1 distribution, this version implementsbwarsaw1998-12-291-0/+141
| | | | safe filename generation across fork() related children.
* DeliverToUser(): Small stylistic tweak to change the sense of the testbwarsaw1998-12-291-19/+19
| | | | and put the child code in the block of the `if'.
* SendMailToNewsGroup(): Small stylistic tweak to put the os.fork() inbwarsaw1998-12-291-2/+2
| | | | line
* FormatListListinfo(): Small tweak to make the email addr entry box 30bwarsaw1998-12-291-1/+1
| | | | chars wide instead of 20.
* Fixed two instances where the old module named mm_err was beingbwarsaw1998-12-292-4/+4
| | | | | | | | | | referenced; these should be Errors. This was in response to an attempt to subscribe a list to itself by sending an subscribe email command and faking the From: field. Now we don't get a crash, but I'm not sure the current behavior is correct. The address (properly) doesn't get subscribed, but a message stating this *is* sent to the list!
* GetValidValue(): Fixed small bug in return value of mm_cfg.Numberbwarsaw1998-12-291-0/+1
| | | | converter
* Don't use eval() to turn a string into an int, use int() -- it's safer.bwarsaw1998-12-292-27/+24
|
* GetValidValue(): Zap another case of eval() for string->number conversion.bwarsaw1998-12-291-7/+11
|
* GetValidValue(): Don't use eval() to turn a string into an int, usebwarsaw1998-12-291-4/+3
| | | | int() -- it's safer.
* get_list(): Watch out for no trailing slash on the URL, in which casebwarsaw1998-12-271-1/+5
| | | | | $PATH_INFO isn't exported into the environment. Handle this the same as if no list name were given.
* Fixed bugs that occur when no list name is given in the URL.bwarsaw1998-12-271-45/+50
| | | | | | | | | | | | | | | | | | | | Also, several stylistic fixes: - ArchiveFilter() need not be nested - Don't use eval(str) to convert a string to an integer; it's slower and less safe than using int(str), but be sure to catch ValueError which might result when a bad string is given. - Note to anyone writing Mailman/Cgi scripts! Nothing but imports should happen as a side effect of importing this module. Run everything from inside a main() function (see scripts/driver for details). - get rid of unnecessary imports - Fix #! line, even though this script isn't typically run from the command line.
* LockFile.lock(): Two changes: first a minor one, if we raise abwarsaw1998-12-272-14/+54
| | | | | | | | | | TimeOutError, we want to unlink our tmpfname first, so we don't potentially leave our linkfile hanging around forever. The second change adds a `stolen' flag which gets set to 1 when we determine a link is stale, and should eliminate the occasional assert errors Ken is seeing. My analysis is included in the comment in the code, but I still wonder if the logic here isn't still flawed.