diff options
| -rw-r--r-- | Mailman/Autoresponder.py | 53 | ||||
| -rw-r--r-- | Mailman/Bouncer.py | 40 | ||||
| -rw-r--r-- | Mailman/Deliverer.py | 9 | ||||
| -rw-r--r-- | Mailman/Digester.py | 82 | ||||
| -rw-r--r-- | Mailman/GatewayManager.py | 36 |
5 files changed, 8 insertions, 212 deletions
diff --git a/Mailman/Autoresponder.py b/Mailman/Autoresponder.py index 94c2d2622..64ec18f19 100644 --- a/Mailman/Autoresponder.py +++ b/Mailman/Autoresponder.py @@ -41,56 +41,3 @@ class Autoresponder: self.admin_responses = {} self.request_responses = {} - def GetConfigInfo(self): - WIDTH = mm_cfg.TEXTFIELDWIDTH - - return [ - _("""\ -Auto-responder characteristics.<p> - -In the text fields below, Python %(string)s interpolation is performed with -the following key/value substitutions: -<p><ul> - <li><b>%(listname)s</b> - <em>gets the name of the mailing list</em> - <li><b>%(listurl)s</b> - <em>gets the list's listinfo URL</em> - <li><b>%(requestemail)s</b> - <em>gets the list's -request address</em> - <li><b>%(adminemail)s</b> - <em>gets the list's -admin address</em> - <li><b>%(owneremail)s</b> - <em>gets the list's -owner address</em> -</ul> - -<p>For each text field, you can either enter the text directly into the text -box, or you can specify a file on your local system to upload as the text."""), - - ('autorespond_postings', mm_cfg.Toggle, (_('No'), _('Yes')), 0, - _('''Should Mailman send an auto-response to mailing list - posters?''')), - - ('autoresponse_postings_text', mm_cfg.FileUpload, - (6, WIDTH), 0, - _('Auto-response text to send to mailing list posters.')), - - ('autorespond_admin', mm_cfg.Toggle, ('No', 'Yes'), 0, - _('''Should Mailman send an auto-response to emails sent to the - -admin and -owner addresses?''')), - - ('autoresponse_admin_text', mm_cfg.FileUpload, - (6, WIDTH), 0, - _('Auto-response text to send to -admin and -owner emails.')), - - ('autorespond_requests', mm_cfg.Radio, - (_('No'), _('Yes, w/discard'), _('Yes, w/forward')), 0, - _('''Should Mailman send an auto-response to emails sent to the - -request address? If you choose yes, decide whether you want - Mailman to discard the original email, or forward it on to the - system as a normal mail command.''')), - - ('autoresponse_request_text', mm_cfg.FileUpload, - (6, WIDTH), 0, - _('Auto-response text to send to -request emails.')), - - ('autoresponse_graceperiod', mm_cfg.Number, 3, 0, - _('''Number of days between auto-responses to either the mailing - list or -admin/-owner address from the same poster. Set to zero - (or negative) for no grace period (i.e. auto-respond to every - message).''')), - ] diff --git a/Mailman/Bouncer.py b/Mailman/Bouncer.py index 0a6f44559..743df5921 100644 --- a/Mailman/Bouncer.py +++ b/Mailman/Bouncer.py @@ -61,36 +61,6 @@ class Bouncer: self.max_posts_between_bounces = \ mm_cfg.DEFAULT_MAX_POSTS_BETWEEN_BOUNCES - def GetConfigInfo(self): - return [ - _('''Policies regarding systematic processing of bounce messages, - to help automate recognition and handling of defunct - addresses.'''), - - ('bounce_processing', mm_cfg.Toggle, (_('No'), _('Yes')), 0, - _('Try to figure out error messages automatically?')), - - ('minimum_removal_date', mm_cfg.Number, 3, 0, - _('''Minimum number of days an address has been non-fatally bad - before we take action''')), - - ('minimum_post_count_before_bounce_action', mm_cfg.Number, 3, 0, - _('''Minimum number of posts to the list since members first - bounce before we consider removing them from the list''')), - - ('max_posts_between_bounces', mm_cfg.Number, 3, 0, - _('''Maximum number of messages your list gets in an hour. (Yes, - bounce detection finds this info useful)''')), - - ('automatic_bounce_action', mm_cfg.Radio, - (_("Do nothing"), - _("Disable and notify me"), - _("Disable and DON'T notify me"), - _("Remove and notify me")), - 0, - _("Action when critical or excessive bounces are detected.")) - ] - def ClearBounceInfo(self, email): email = email.lower() if self.bounce_info.has_key(email): @@ -278,19 +248,19 @@ Bad admin recipient: %s''', self.internal_name(), addr) Returning success and notification status. """ - if not self.IsMember(addr): + if not self.isMember(addr): reason = _('User not found.') syslog('bounce', '%s: NOT disabled %s: %s', self.real_name, addr, reason) return reason, 1 try: - if self.GetUserOption(addr, mm_cfg.DisableDelivery): + if self.getMemberOption(addr, mm_cfg.DisableDelivery): # No need to send out notification if they're already disabled. syslog('bounce', '%s: already disabled %s' % self.real_name, addr) return 1, 0 else: - self.SetUserOption(addr, mm_cfg.DisableDelivery, 1) + self.setMemberOption(addr, mm_cfg.DisableDelivery, 1) syslog('bounce', '%s: disabled %s', self.real_name, addr) self.Save() return 1, 1 @@ -305,13 +275,13 @@ Bad admin recipient: %s''', self.internal_name(), addr) """Unsubscribe user with bouncing address. Returning success and notification status.""" - if not self.IsMember(addr): + if not self.isMember(addr): reason = _('User not found.') syslog('bounce', '%s: NOT removed %s: %s', self.real_name, addr, reason) return reason, 1 try: - self.DeleteMember(addr, "bouncing addr") + self.ApprovedDeleteMember(addr, "bouncing addr") syslog('bounce', '%s: removed %s', self.real_name, addr) self.Save() return 1, 1 diff --git a/Mailman/Deliverer.py b/Mailman/Deliverer.py index 9fe5954c0..91901a875 100644 --- a/Mailman/Deliverer.py +++ b/Mailman/Deliverer.py @@ -69,7 +69,6 @@ your membership administrative address, %(addr)s.''')) msg.send(self) def SendUnsubscribeAck(self, name): - os.environ['LANG'] = self.GetPreferredLanguage(name) realname = self.real_name msg = Message.UserNotification( self.GetMemberAdminEmail(name), self.GetAdminEmail(), @@ -78,14 +77,12 @@ your membership administrative address, %(addr)s.''')) msg.send(self) def MailUserPassword(self, user): - os.environ['LANG'] = self.GetPreferredLanguage(user) listfullname = '%s@%s' % (self.real_name, self.host_name) ok = 1 - # find the lowercased version of the user's address - user = self.FindUser(user) requestaddr = self.GetRequestEmail() - if user and self.passwords.has_key(user): - cpuser = self.GetUserSubscribedAddress(user) + # find the lowercased version of the user's address + if self.isMember(user) and self.getMemberPassword(user): + cpuser = self.getMemberCPAddress(user) recipient = self.GetMemberAdminEmail(cpuser) subject = _('%(listfullname)s mailing list reminder') adminaddr = self.GetAdminEmail() diff --git a/Mailman/Digester.py b/Mailman/Digester.py index 215b083c8..2d8fe1aa1 100644 --- a/Mailman/Digester.py +++ b/Mailman/Digester.py @@ -46,88 +46,6 @@ class Digester: self.next_digest_number = 1 self.digest_last_sent_at = 0 - def GetConfigInfo(self): - WIDTH = mm_cfg.TEXTFIELDWIDTH - os.environ['LANG'] = self.preferred_language - - return [ - _("Batched-delivery digest characteristics."), - - ('digestable', mm_cfg.Toggle, (_('No'), _('Yes')), 1, - _('Can list members choose to receive list traffic ' - 'bunched in digests?')), - - ('digest_is_default', mm_cfg.Radio, - (_('Regular'), _('Digest')), 0, - _('Which delivery mode is the default for new users?')), - - ('mime_is_default_digest', mm_cfg.Radio, - (_('Plain'), _('MIME')), 0, - _('When receiving digests, which format is default?')), - - ('digest_size_threshhold', mm_cfg.Number, 3, 0, - _('How big in Kb should a digest be before it gets sent out?')), - # Should offer a 'set to 0' for no size threshhold. - - ('digest_send_periodic', mm_cfg.Radio, (_('No'), _('Yes')), 1, - _('Should a digest be dispatched daily when the size threshold ' - "isn't reached?")), - - ('digest_header', mm_cfg.Text, (4, WIDTH), 0, - _('Header added to every digest'), - _("Text attached (as an initial message, before the table" - " of contents) to the top of digests. ") - + Utils.maketext('headfoot.html', raw=1, mlist=self)), - - ('digest_footer', mm_cfg.Text, (4, WIDTH), 0, - _('Footer added to every digest'), - _("Text attached (as a final message) to the bottom of digests. ") - + Utils.maketext('headfoot.html', raw=1, mlist=self)), - - ('digest_volume_frequency', mm_cfg.Radio, - (_('Yearly'), _('Monthly'), _('Quarterly'), - _('Weekly'), _('Daily')), 0, - _('How often should a new digest volume be started?'), - _('''When a new digest volume is started, the volume number is - incremented and the issue number is reset to 1.''')), - - ('_new_volume', mm_cfg.Toggle, (_('No'), _('Yes')), 0, - _('Should Mailman start a new digest volume?'), - _('''Setting this option instructs Mailman to start a new volume - with the next digest sent out.''')), - - ('_send_digest_now', mm_cfg.Toggle, (_('No'), _('Yes')), 0, - _('''Should Mailman send the next digest right now, if it is not - empty?''')), - ] - - def SetUserDigest(self, sender, value, force=0): - self.IsListInitialized() - addr = self.FindUser(sender) - if not addr: - raise Errors.MMNotAMemberError - cpuser = self.GetUserSubscribedAddress(addr) - if self.members.has_key(addr): - if value == 0: - raise Errors.MMAlreadyUndigested - else: - if not force and not self.digestable: - raise Errors.MMCantDigestError - del self.members[addr] - self.digest_members[addr] = cpuser - else: - if value == 1: - raise Errors.MMAlreadyDigested - else: - if not force and not self.nondigestable: - raise Errors.MMMustDigestError - try: - self.one_last_digest[addr] = self.digest_members[addr] - except AttributeError: - self.one_last_digest = {addr: self.digest_members[addr]} - del self.digest_members[addr] - self.members[addr] = cpuser - def send_digest_now(self): # Note: Handler.ToDigest.send_digests() handles bumping the digest # volume and issue number. diff --git a/Mailman/GatewayManager.py b/Mailman/GatewayManager.py index 54c0e5c9b..24ba0cee4 100644 --- a/Mailman/GatewayManager.py +++ b/Mailman/GatewayManager.py @@ -32,39 +32,3 @@ class GatewayManager: self.linked_newsgroup = '' self.gateway_to_news = 0 self.gateway_to_mail = 0 - - def GetConfigInfo(self): - WIDTH = mm_cfg.TEXTFIELDWIDTH - - return [ - _('Mail-to-News and News-to-Mail gateway services.'), - - ('nntp_host', mm_cfg.String, WIDTH, 0, - _('''The Internet address of the machine your News server is - running on.'''), - _('''The News server is not part of Mailman proper. You have to - already have access to a NNTP server, and that NNTP server has to - recognize the machine this mailing list runs on as a machine - capable of reading and posting news.''')), - - ('linked_newsgroup', mm_cfg.String, WIDTH, 0, - _('The name of the Usenet group to gateway to and/or from.')), - - ('gateway_to_news', mm_cfg.Toggle, (_('No'), _('Yes')), 0, - _('''Should new posts to the mailing list be sent to the - newsgroup?''')), - - ('gateway_to_mail', mm_cfg.Toggle, (_('No'), _('Yes')), 0, - _('''Should new posts to the newsgroup be sent to the mailing - list?''')), - - ('_mass_catchup', mm_cfg.Toggle, (_('No'), _('Yes')), 0, - _('Should Mailman perform a <em>catchup</em> on the newsgroup?'), - _('''When you tell Mailman to perform a catchup on the newsgroup, - this means that you want to start gating messages to the mailing - list with the next new message found. All earlier messages on - the newsgroup will be ignored. This is as if you were reading - the newsgroup yourself, and you marked all current messages as - <em>read</em>. By catching up, your mailing list members will - not see any of the earlier messages.''')) - ] |
