diff options
| author | klm | 1998-09-05 20:50:44 +0000 |
|---|---|---|
| committer | klm | 1998-09-05 20:50:44 +0000 |
| commit | a2c73df9d6e712de07ad46b09b0cd272ff283b8e (patch) | |
| tree | 33d850fba758a5ea1f901b265cb7c8e61398985c | |
| parent | 5865b5d0d57db00dacb935b66e205be9cf1d829f (diff) | |
| download | mailman-a2c73df9d6e712de07ad46b09b0cd272ff283b8e.tar.gz mailman-a2c73df9d6e712de07ad46b09b0cd272ff283b8e.tar.zst mailman-a2c73df9d6e712de07ad46b09b0cd272ff283b8e.zip | |
.AddMember(): Check for and deny attempts to subscribe list to
itself. I'm implementing other, earlier in the web and mailcommand
subscription processes, to prevent it from getting this far - but it
should still be checked, and will be treated as a bad-address error if
it gets beyond here.
.Post(): Fix x-beenthere mechanism - it was supposed to be detecting
mail loops, but was apparently broken. (I'm pretty sure i tested it,
so maybe it was broken along the way somewhere.)
| -rw-r--r-- | Mailman/MailList.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Mailman/MailList.py b/Mailman/MailList.py index 7be036bef..476cbd1ed 100644 --- a/Mailman/MailList.py +++ b/Mailman/MailList.py @@ -632,6 +632,9 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, raise Errors.MMBadEmailError if self.IsMember(name): raise Errors.MMAlreadyAMember + if name == string.lower(self.GetListEmail()): + # Trying to subscribe the list to itself! + raise mm_err.MMBadEmailError if digest and not self.digestable: raise Errors.MMCantDigestError @@ -803,8 +806,9 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, # If it's the admin, which we know by the approved variable, # we can skip a large number of checks. if not approved: - from_lists = msg.getallmatchingheaders('x-beenthere') - if self.GetListEmail() in from_lists: + beentheres = map(lambda x: string.split(x, ": ")[1][:-1], + msg.getallmatchingheaders('x-beenthere')) + if self.GetListEmail() in beentheres: self.AddRequest('post', Utils.SnarfMessage(msg), Errors.LOOPING_POST, msg.getheader('subject')) |
