diff options
Diffstat (limited to 'Mailman')
| -rw-r--r-- | Mailman/Cgi/admin.py | 1 | ||||
| -rw-r--r-- | Mailman/Defaults.py.in | 7 | ||||
| -rw-r--r-- | Mailman/ListAdmin.py | 1 | ||||
| -rw-r--r-- | Mailman/MailCommandHandler.py | 1 | ||||
| -rw-r--r-- | Mailman/MailList.py | 38 | ||||
| -rw-r--r-- | Mailman/versions.py | 6 |
6 files changed, 50 insertions, 4 deletions
diff --git a/Mailman/Cgi/admin.py b/Mailman/Cgi/admin.py index 718f8e20a..bc2b0989d 100644 --- a/Mailman/Cgi/admin.py +++ b/Mailman/Cgi/admin.py @@ -763,6 +763,7 @@ def ChangeOptions(lst, category, cgi_info, document): document.AddItem(Header(5, "Successfully Subscribed:")) document.AddItem(apply(UnorderedList, tuple((subscribe_success)))) document.AddItem("<p>") + dirty = 1 if subscribe_errors: document.AddItem(Header(5, "Error Subscribing:")) items = map(lambda x: "%s -- %s" % (x[0], x[1]), subscribe_errors) diff --git a/Mailman/Defaults.py.in b/Mailman/Defaults.py.in index 12e7b04a8..db3d2c8d3 100644 --- a/Mailman/Defaults.py.in +++ b/Mailman/Defaults.py.in @@ -110,6 +110,11 @@ DEFAULT_MAIL_COMMANDS_MAX_LINES = 25 # Is admin notified of admin requests immediately by mail, as well as by # daily pending-request reminder? DEFAULT_ADMIN_IMMED_NOTIFY = 1 +# +# Is admin notified of subscribes/unsububscribes? +# +DEFAULT_ADMIN_NOTIFY_MCHANGES = 0 + DEFAULT_MODERATED = 0 # Bounce if 'to' or 'cc' fields don't explicitly name list (anti-spam)? @@ -269,4 +274,4 @@ PRIVATE_ARCHIVE_FILE_DIR = os.path.join(PREFIX, 'archives/private') VERSION = '@VERSION@' # Data file version number -DATA_FILE_VERSION = 11 +DATA_FILE_VERSION = 12 diff --git a/Mailman/ListAdmin.py b/Mailman/ListAdmin.py index 33ee13e36..aea0f7dba 100644 --- a/Mailman/ListAdmin.py +++ b/Mailman/ListAdmin.py @@ -172,6 +172,7 @@ class ListAdmin: else: try: self.ApprovedAddMember(destination_email, pw, digest) + self.Save() except Errors.MMAlreadyAMember: pass diff --git a/Mailman/MailCommandHandler.py b/Mailman/MailCommandHandler.py index f78eda456..2400ace02 100644 --- a/Mailman/MailCommandHandler.py +++ b/Mailman/MailCommandHandler.py @@ -456,6 +456,7 @@ class MailCommandHandler: remote = mail.GetSender() try: self.AddMember(subscribe_address, password, digest, remote) + self.Save() except Errors.MMSubscribeNeedsConfirmation: # # the confirmation message that's been sent takes place diff --git a/Mailman/MailList.py b/Mailman/MailList.py index 0ca5b1714..7917e8356 100644 --- a/Mailman/MailList.py +++ b/Mailman/MailList.py @@ -191,6 +191,8 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, self.posters = [] self.forbidden_posters = [] self.admin_immed_notify = mm_cfg.DEFAULT_ADMIN_IMMED_NOTIFY + self.admin_notify_mchanges = \ + mm_cfg.DEFAULT_ADMIN_NOTIFY_MCHANGES self.moderated = mm_cfg.DEFAULT_MODERATED self.require_explicit_destination = \ mm_cfg.DEFAULT_REQUIRE_EXPLICIT_DESTINATION @@ -373,6 +375,9 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, " option causes notices to be sent immediately on the arrival" " of new requests, as well."), + ('admin_notify_mchanges', mm_cfg.Radio, ('No', 'Yes'), 0, + 'Should administrator get notices of subscribes/unsubscribes?'), + ('dont_respond_to_post_requests', mm_cfg.Radio, ('Yes', 'No'), 0, 'Send mail to poster when their posting is held for approval?', @@ -774,12 +779,17 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, - def ApprovedAddMember(self, name, password, digest, ack=None): + def ApprovedAddMember(self, name, password, digest, ack=None, admin_notif=None): if ack is None: if self.send_welcome_msg: ack = 1 else: ack = 0 + if admin_notif is None: + if self.admin_notify_mchanges: + admin_notif = 1 + else: + admin_notif = 0 name = Utils.LCDomain(name) if self.IsMember(name): raise Errors.MMAlreadyAMember @@ -794,9 +804,17 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, self.LogMsg("subscribe", "%s: new%s %s", self._internal_name, kind, name) self.passwords[name] = password - self.Save() if ack: self.SendSubscribeAck(name, password, digest) + if admin_notif: + import Message + txt = Utils.maketext("adminsubscribeack.txt", + {"mmowner": mm_cfg.MAILMAN_OWNER, + "admin_email": self.GetAdminEmail(), + "listname": self.real_name, + "member": name}, 1) + msg = Message.IncomingMessage(txt) + self.DeliverToOwner(msg, self.owner) def ProcessConfirmation(self, cookie): @@ -813,7 +831,7 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, - def DeleteMember(self, name, whence=None): + def DeleteMember(self, name, whence=None, admin_notif=None): self.IsListInitialized() # FindMatchingAddresses *should* never return more than 1 address. # However, should log this, just to make sure. @@ -846,6 +864,20 @@ class MailList(MailCommandHandler, HTMLFormatter, Deliverer, ListAdmin, self.SendUnsubscribeAck(name) self.ClearBounceInfo(name) self.Save() + if admin_notif is None: + if self.admin_notify_mchanges: + admin_notif = 1 + else: + admin_notif = 0 + if admin_notif: + import Message + txt = Utils.maketext("adminunsubscribeack.txt", + {"mmowner": mm_cfg.MAILMAN_OWNER, + "admin_email": self.GetAdminEmail(), + "listname": self.real_name, + "member": name}, 1) + msg = Message.IncomingMessage(txt) + self.DeliverToOwner(msg, self.owner) if whence: whence = "; %s" % whence else: whence = "" self.LogMsg("subscribe", "%s: deleted %s%s", diff --git a/Mailman/versions.py b/Mailman/versions.py index c0d1f4d50..b145187ef 100644 --- a/Mailman/versions.py +++ b/Mailman/versions.py @@ -115,6 +115,12 @@ def UpdateOldVars(l, stored_state): for dm in l.digest_members: dmembers[dm] = 1 l.digest_members = dmembers + # + # set admin_notify_mchanges + # + if not hasattr(l, "admin_notify_mchanges"): + setatrr(l, "admin_notify_mchanges", + mm_cfg.DEFAULT_ADMIN_NOTIFY_MCHANGES) def UpdateOldUsers(l): |
