diff options
| author | cotton | 1998-11-01 18:58:04 +0000 |
|---|---|---|
| committer | cotton | 1998-11-01 18:58:04 +0000 |
| commit | aa98464ae190aee8532d844ca582d44db31d02c5 (patch) | |
| tree | c27716d085ffef00e0e930f2c76fa1689a995d51 | |
| parent | 8cf5cb147eb2b5aa1cfbddcb16f6590126e95b90 (diff) | |
| download | mailman-aa98464ae190aee8532d844ca582d44db31d02c5.tar.gz mailman-aa98464ae190aee8532d844ca582d44db31d02c5.tar.zst mailman-aa98464ae190aee8532d844ca582d44db31d02c5.zip | |
took out posters_includes_members in favor of having it reference the
member_posting_only variable. made it so that old lists not
expecting this behavior will have member_posting_only turned off in
the event that they have posters defined (preserving the old behavior
where defining posters made the list act as if member_posting_only was
set to "no" whether or not it was set as such).
| -rw-r--r-- | Mailman/Defaults.py.in | 4 | ||||
| -rw-r--r-- | Mailman/MailList.py | 48 | ||||
| -rw-r--r-- | Mailman/versions.py | 19 |
3 files changed, 35 insertions, 36 deletions
diff --git a/Mailman/Defaults.py.in b/Mailman/Defaults.py.in index 517ae6bdc..7d21888ab 100644 --- a/Mailman/Defaults.py.in +++ b/Mailman/Defaults.py.in @@ -113,7 +113,7 @@ DEFAULT_MAIL_COMMANDS_MAX_LINES = 25 # daily pending-request reminder? DEFAULT_ADMIN_IMMED_NOTIFY = 1 DEFAULT_MODERATED = 0 -DEFAULT_POSTERS_INCLUDES_MEMBERS = 0 + # Bounce if 'to' or 'cc' fields don't explicitly name list (anti-spam)? DEFAULT_REQUIRE_EXPLICIT_DESTINATION = 1 # Alternate names acceptable as explicit destinations for this list. @@ -271,4 +271,4 @@ PRIVATE_ARCHIVE_FILE_DIR = os.path.join(PREFIX, 'archives/private') VERSION = '@VERSION@' # Data file version number -DATA_FILE_VERSION = 9 +DATA_FILE_VERSION = 10 diff --git a/Mailman/MailList.py b/Mailman/MailList.py index 652760504..ed1e9fed0 100644 --- a/Mailman/MailList.py +++ b/Mailman/MailList.py @@ -472,45 +472,30 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, "General posting filters", ('moderated', mm_cfg.Radio, ('No', 'Yes'), 0, - 'Must posts be approved by an administrator?' - "If the 'posters' option has any entries then it forces the" - ' list to be moderated, regadless of this setting.'), + 'Must posts be approved by an administrator?'), ('member_posting_only', mm_cfg.Radio, ('No', 'Yes'), 0, - 'Restrict posting privilege to only list members?', + 'Restrict posting privilege to list members?', - "Use this option if you want posting from list members " - "<em>only</em>. If you want list members to be able to " + "Use this option if you want to restrict posting to list members. " + "If you want list members to be able to " "post, plus a handful of other posters, see the <i> posters </i> " - "and <i>posters_includes_members</i> settings below"), + "setting below"), ('posters', mm_cfg.EmailList, (5, 30), 1, 'Addresses of members accepted for posting to this' - ' list with no required approval. (See <i> posters_includes_members </i> ' - 'below for whether or not list members are effected by adding ' + ' list with no required approval. (See <i> member_posting_only </i> ' + 'above for whether or not list members posting is effected by adding ' 'addresses here.', "Adding any entries here will have one of 2 effects according to the " - "setting of <i>posters_includes_members </i>: <p> If <i>posters_includes_members</i> " + "setting of <i>member_posting_only </i>: <p> If <i>member_posting_only</i> " "is set to 'yes', then adding entries here will allow list members and anyone " "listed here to post without going through administrative approval. <p> " - "If <i>posters_includes_members</i> is set to 'no', then <em>only</em> the " + "If <i>member_posting_only</i> is set to 'no', then <em>only</em> the " "posters listed here will be able to post without administrative approval. "), - ('posters_includes_members', mm_cfg.Radio, ('No', 'Yes'), 0, - "If you have anyone listed under 'posters' above, should you " - "allow list members to post as well? ", - - "If you have listed addresses under <i>posters</i> " - "then setting this to 'yes' will allow list members <em>and</em> the addresses " - "listed in the <i> posters</i> setting to post without administrative approval. <br>" - "Correspondingly, setting this to 'no' will allow only the addresses " - " listed in <i> posters </i> to post to the list without approval, regardless " - " of whether or not they are a member of the list.<br>" - "Setting this when there are no addresses listed under the <i>posters</i> " - "setting has no effect whatsoever. "), - "Spam-specific posting filters", ('require_explicit_destination', mm_cfg.Radio, ('No', 'Yes'), 0, @@ -791,7 +776,7 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, self.Save() if ack: self.SendSubscribeAck(name, password, digest) - + def ProcessConfirmation(self, cookie): from Pending import Pending @@ -950,10 +935,14 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, self.AddRequest('post', Utils.SnarfMessage(msg), Errors.FORBIDDEN_SENDER_MSG, msg.getheader('subject')) + if self.moderated: + self.AddRequest('post', Utils.SnarfMessage(msg), + Errors.MODERATED_LIST_MSG, + msg.getheader('subject')) if len(self.posters): addrs = Utils.FindMatchingAddresses(sender, self.posters) if not len(addrs): - if self.posters_includes_members: + if self.member_posting_only: if not self.IsMember(sender): self.AddRequest('post', Utils.SnarfMessage(msg), 'Only approved posters may post without ' @@ -964,11 +953,8 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, 'Only approved posters may post without ' 'moderator approval.', msg.getheader('subject')) - elif self.moderated: - self.AddRequest('post', Utils.SnarfMessage(msg), - Errors.MODERATED_LIST_MSG, - msg.getheader('subject')) - if self.member_posting_only and not self.IsMember(sender): + + elif self.member_posting_only and not self.IsMember(sender): self.AddRequest('post', Utils.SnarfMessage(msg), 'Postings from member addresses only.', msg.getheader('subject')) diff --git a/Mailman/versions.py b/Mailman/versions.py index e3f2df273..80fee9260 100644 --- a/Mailman/versions.py +++ b/Mailman/versions.py @@ -85,9 +85,22 @@ def UpdateOldVars(l, stored_state): setattr(l, "administrivia", mm_cfg.DEFAULT_ADMINISTRIVIA) if not hasattr(l, "admin_member_chunksize"): setattr(l, "admin_member_chunksize", mm_cfg.DEFAULT_ADMIN_MEMBER_CHUNKSIZE) - if not hasattr(l, "posters_includes_members"): - setattr(l, "posters_includes_members", - mm_cfg.DEFAULT_POSTERS_INCLUDES_MEMBERS) + # + # this attribute was added then deleted, so there are a number of + # cases to take care of + # + if hasattr(l, "posters_includes_members"): + if l.posters_includes_members: + if l.posters: + l.member_posting_only = 1 + else: + if l.posters: + l.member_posting_only = 0 + delattr(l, "posters_includes_members") + else: # make sure everyone gets the behavior the list used to have + if l.posters: + l.member_posting_only = 0 + def UpdateOldUsers(l): """Transform sense of changed user options.""" |
