diff options
| author | klm | 1999-01-05 00:30:14 +0000 |
|---|---|---|
| committer | klm | 1999-01-05 00:30:14 +0000 |
| commit | 2d269db580bc725ffd3c1a8035bb0d6724c41aa2 (patch) | |
| tree | bfc55c7d17f28ae826e2ce743be62af7d4041bf6 /Mailman/Utils.py | |
| parent | 3b7180329327cafd8568a3b7427d7fa1fb23375a (diff) | |
| download | mailman-2d269db580bc725ffd3c1a8035bb0d6724c41aa2.tar.gz mailman-2d269db580bc725ffd3c1a8035bb0d6724c41aa2.tar.zst mailman-2d269db580bc725ffd3c1a8035bb0d6724c41aa2.zip | |
IsAdministrivia(): Made more stringent about 'set' command, since we
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...)
Diffstat (limited to 'Mailman/Utils.py')
| -rw-r--r-- | Mailman/Utils.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Mailman/Utils.py b/Mailman/Utils.py index 2eeb0247f..522c6a0e0 100644 --- a/Mailman/Utils.py +++ b/Mailman/Utils.py @@ -553,7 +553,7 @@ def IsAdministrivia(msg): "who": (0,0), "info": (0,0), "lists": (0,0), - "set": (2, 3), + "set": (3, 3), "help": (0,0), "password": (2, 2), "options": (0,0), @@ -562,7 +562,7 @@ def IsAdministrivia(msg): for line in lines: if string.strip(line): lines_with_text = lines_with_text + 1 - if lines_with_text > 30: # we might want to change this to mm_cfg.DEFAULT_MAIL_COMMANDS_MAX_LINES. + if lines_with_text > mm_cfg.DEFAULT_MAIL_COMMANDS_MAX_LINES: return 0 sig_ind = string.find(msg.body, "\n-- ") if sig_ind != -1: @@ -583,6 +583,9 @@ def IsAdministrivia(msg): if admin_data.has_key(words[0]): min_args, max_args = admin_data[words[0]] if min_args <= len(words[1:]) <= max_args: + if (words[0] == 'set' + and (words[2] not in ['on', 'off'])): + continue return 1 return 0 |
