rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
slines[0] = '%2d. ' % msgcount + slines[0]
def send_i18n_digests(mlist, mboxfp): mbox = Mailbox(mboxfp) # Prepare common information lang = mlist.preferred_language lcset = Utils.GetCharSet(lang) realname = mlist.real_name volume = mlist.volume issue = mlist.next_digest_number digestid = _('%(realname)s Digest, Vol %(volume)d, Issue %(issue)d') digestsubj = Hea...
print >> toc
def send_i18n_digests(mlist, mboxfp): mbox = Mailbox(mboxfp) # Prepare common information lang = mlist.preferred_language lcset = Utils.GetCharSet(lang) realname = mlist.real_name volume = mlist.volume issue = mlist.next_digest_number digestid = _('%(realname)s Digest, Vol %(volume)d, Issue %(issue)d') digestsubj = Hea...
uh = lheader(msg[h], lcset, header_name=h, continuation_ws='\t') print >> plainmsg, '%s: %s' % (h, uh)
uh = Utils.wrap('%s: %s' % (h, oneline(msg[h], lcset))) uh = '\n\t'.join(uh.split('\n')) print >> plainmsg, uh
def send_i18n_digests(mlist, mboxfp): mbox = Mailbox(mboxfp) # Prepare common information lang = mlist.preferred_language lcset = Utils.GetCharSet(lang) realname = mlist.real_name volume = mlist.volume issue = mlist.next_digest_number digestid = _('%(realname)s Digest, Vol %(volume)d, Issue %(issue)d') digestsubj = Hea...
if os.path.exists(path): self.dict = marshal.load(open(path))
self.dict = {} self.sorted = [] try: fp = open(path) try: self.dict = marshal.load(fp) finally: fp.close() except IOError, e: if e.errno <> errno.ENOENT: raise pass except EOFError: pass else:
def __init__(self, path): self.current_index = 0 self.path = path self.lockfile = LockFile.LockFile(self.path + ".lock") self.lock() self.__dirty = 0 if os.path.exists(path): self.dict = marshal.load(open(path)) self.__sort(dirty=1) else: self.dict = {} self.sorted = []
else: self.dict = {} self.sorted = []
def __init__(self, path): self.current_index = 0 self.path = path self.lockfile = LockFile.LockFile(self.path + ".lock") self.lock() self.__dirty = 0 if os.path.exists(path): self.dict = marshal.load(open(path)) self.__sort(dirty=1) else: self.dict = {} self.sorted = []
a URL similar to this one, but with a '/' and the %(adj)s
enter a URL similar to this one, but with a '/' and the %(adj)s
def listinfo_overview(msg=''): # Present the general listinfo overview hostname = Utils.get_domain() # Set up the document and assign it the correct language. The only one we # know about at the moment is the server's default. doc = Document() doc.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) legend = _("%(hostname)s ...
def RegisterBounce(self, email, msg, saveifdirty=1):
def RegisterBounce(self, email, msg):
def RegisterBounce(self, email, msg, saveifdirty=1): """Detect and handle repeat-offender bounce addresses. We use very sketchy bounce history profiles in self.bounce_info (see comment above it's initialization), together with list- specific thresholds self.minimum_post_count_before_bounce_action and self.max_posts_be...
dirty = 0
def RegisterBounce(self, email, msg, saveifdirty=1): """Detect and handle repeat-offender bounce addresses. We use very sketchy bounce history profiles in self.bounce_info (see comment above it's initialization), together with list- specific thresholds self.minimum_post_count_before_bounce_action and self.max_posts_be...
try: now = time.time() secs_per_day = 24 * 60 * 60 pid = self.post_id maxposts = self.max_posts_between_bounces stalesecs = self.minimum_removal_date * secs_per_day * 5 for k, v in self.bounce_info.items(): if now - v[0] > stalesecs: del self.bounce_info[k] dirty = 1 this_dude = Utils.FindMatchingAddresses(email, s...
now = time.time() secs_per_day = 24 * 60 * 60 pid = self.post_id maxposts = self.max_posts_between_bounces stalesecs = self.minimum_removal_date * secs_per_day * 5 for k, v in self.bounce_info.items(): if now - v[0] > stalesecs: del self.bounce_info[k]
def RegisterBounce(self, email, msg, saveifdirty=1): """Detect and handle repeat-offender bounce addresses. We use very sketchy bounce history profiles in self.bounce_info (see comment above it's initialization), together with list- specific thresholds self.minimum_post_count_before_bounce_action and self.max_posts_be...
return addr = string.lower(this_dude[0]) hist = self.bounce_info[addr] difference = now - hist[0] if len(Utils.FindMatchingAddresses(addr, self.members)): if self.post_id - hist[2] > self.max_posts_between_bounces: syslog("bounce", report + "first fresh") self.bounce_info[addr] = [now, self.post_id, self.post_id] ...
this_dude = Utils.FindMatchingAddresses(email, self.bounce_info) if not this_dude: self.bounce_info[string.lower(email)] = [now, self.post_id, self.post_id] syslog("bounce", report + "first") dirty = 1 return addr = string.lower(this_dude[0]) hist = self.bounce_info[addr] difference = now - hist[0] if len(Utils.Find...
def RegisterBounce(self, email, msg, saveifdirty=1): """Detect and handle repeat-offender bounce addresses. We use very sketchy bounce history profiles in self.bounce_info (see comment above it's initialization), together with list- specific thresholds self.minimum_post_count_before_bounce_action and self.max_posts_be...
if ((self.post_id - hist[1] > self.minimum_post_count_before_bounce_action) and (difference > self.minimum_removal_date * secs_per_day)): syslog("bounce", report + "exceeded limits") self.HandleBouncingAddress(addr, msg) return else: post_count = (self.minimum_post_count_before_bounce_action - (self.post_id - hist[1]))...
return self.bounce_info[addr][2] = self.post_id dirty = 1 if ((self.post_id - hist[1] > self.minimum_post_count_before_bounce_action) and (difference > self.minimum_removal_date * secs_per_day)): syslog("bounce", report + "exceeded limits") self.HandleBouncingAddress(addr, msg) return
def RegisterBounce(self, email, msg, saveifdirty=1): """Detect and handle repeat-offender bounce addresses. We use very sketchy bounce history profiles in self.bounce_info (see comment above it's initialization), together with list- specific thresholds self.minimum_post_count_before_bounce_action and self.max_posts_be...
syslog("bounce", "%s: address %s not a member." % (self.internal_name(), addr)) finally: if dirty and saveifdirty: self.Save()
post_count = (self.minimum_post_count_before_bounce_action - (self.post_id - hist[1])) if post_count < 0: post_count = 0 remain = (self.minimum_removal_date * secs_per_day - difference) syslog("bounce", report + ("%d more allowed over %d secs" % (post_count, remain))) return elif len(Utils.FindMatchingAddresses(addr, ...
def RegisterBounce(self, email, msg, saveifdirty=1): """Detect and handle repeat-offender bounce addresses. We use very sketchy bounce history profiles in self.bounce_info (see comment above it's initialization), together with list- specific thresholds self.minimum_post_count_before_bounce_action and self.max_posts_be...
msg.rewindbody() body = msg.fp.read()
def HandleBouncingAddress(self, addr, msg): """Disable or remove addr according to bounce_action setting.""" if self.automatic_bounce_action == 0: return elif self.automatic_bounce_action == 1: # Only send if call works ok. (succeeded, send) = self.DisableBouncingAddress(addr) did = "disabled" elif self.automatic_bounc...
Utils.QuotePeriods(body) + '\n' + \
Utils.QuotePeriods(msg.body) + '\n' + \
def HandleBouncingAddress(self, addr, msg): """Disable or remove addr according to bounce_action setting.""" if self.automatic_bounce_action == 0: return elif self.automatic_bounce_action == 1: # Only send if call works ok. (succeeded, send) = self.DisableBouncingAddress(addr) did = "disabled" elif self.automatic_bounc...
syslog('qrunner', 'qfile metadata specifies no list: %s' %
syslog('error', 'qfile metadata specifies no list: %s' %
def __onefile(self, msg, msgdata): # Do some common sanity checking on the message metadata. It's got to # be destined for a particular mailing list. This switchboard is used # to shunt off badly formatted messages. We don't want to just trash # them because they may be fixable with human intervention. Just get # t...
syslog('qrunner',
syslog('error',
def __onefile(self, msg, msgdata): # Do some common sanity checking on the message metadata. It's got to # be destined for a particular mailing list. This switchboard is used # to shunt off badly formatted messages. We don't want to just trash # them because they may be fixable with human intervention. Just get # t...
syslog('qrunner', 'error opening list: %s\n%s' % (listname, e))
syslog('error', 'error opening list: %s\n%s' % (listname, e))
def _open_list(self, listname, lockp=1): # Cache the opening of the list object given its name. The probably # is only a moderate win because when a list is locked, all its # attributes are re-read from the config.db file. This may help more # when there's a real backing database. if self._cachelists: mlist = self._l...
syslog('qrunner', 'Uncaught runner exception: %s' % exc)
syslog('error', 'Uncaught runner exception: %s' % exc)
def _log(self, exc): syslog('qrunner', 'Uncaught runner exception: %s' % exc) s = StringIO() traceback.print_exc(file=s) syslog('qrunner', s.getvalue())
syslog('qrunner', s.getvalue())
syslog('error', s.getvalue())
def _log(self, exc): syslog('qrunner', 'Uncaught runner exception: %s' % exc) s = StringIO() traceback.print_exc(file=s) syslog('qrunner', s.getvalue())
url = mlist.GetAbsoluteOptionsURL(addr)
url = mlist.GetOptionsURL(addr, relative=1)
def optionslinks(listname, user=user): mlist = MailList.MailList(listname, lock=0) addrs = Utils.FindMatchingAddresses(user, mlist.members, mlist.digest_members) if addrs: addr = Utils.ObscureEmail(addrs[0]) if mlist.obscure_addresses: addr = Utils.ObscureEmail(addr) url = mlist.GetAbsoluteOptionsURL(addr) link = Link(...
def SetUserDigest(self, sender, value):
def SetUserDigest(self, sender, value, force=0):
def SetUserDigest(self, sender, value):
if not self.digestable:
if not force and not self.digestable:
def SetUserDigest(self, sender, value):
if not self.nondigestable:
if not force and not self.nondigestable:
def SetUserDigest(self, sender, value):
config_info = {} config_info['digest'] = Digester.GetConfigInfo(self) config_info['archive'] = Archiver.GetConfigInfo(self) config_info['gateway'] = GatewayManager.GetConfigInfo(self) config_info['autoreply'] = Autoresponder.GetConfigInfo(self) WIDTH = mm_cfg.TEXTFIELDWIDTH
langnames = [_(Utils.GetLanguageDescr(L)) for L in langs] langi = langs.index(self.preferred_language)
def GetConfigInfo(self): langs = self.GetAvailableLanguages()
('real_name', mm_cfg.String, WIDTH, 0, _('The public name of this list (make case-changes only).'), _("The capitalization of this name can be changed to make it" " presentable in polite company as a proper noun, or to make an" " acronym part all upper case, etc. However, the name" " will be advertised as the email ad...
('real_name', mm_cfg.String, WIDTH, 0, _('The public name of this list (make case-changes only).'), _('''The capitalization of this name can be changed to make it presentable in polite company as a proper noun, or to make an acronym part all upper case, etc. However, the name will be advertised as the email address (e...
def GetConfigInfo(self): langs = self.GetAvailableLanguages()
(langs, map(_, map(Utils.GetLanguageDescr, langs)), langs.index(self.preferred_language)), 0, _("Default language for this list."), _("All messages not related to an specific user will be displayed in this language.")), ('description', mm_cfg.String, WIDTH, 0, _('A terse phrase identifying this list.'), _("This descr...
(langs, langnames, langi), 0, _('Default language for this list.'), _('''All messages not related to an specific user will be displayed in this language.''')), ('description', mm_cfg.String, WIDTH, 0, _('A terse phrase identifying this list.'), _('''This description is used when the mailing list is listed with other ...
def GetConfigInfo(self): langs = self.GetAvailableLanguages()
_('Where are replies to list messages directed? <tt>Poster</tt> is <em>strongly</em> recommended for most mailing lists.'),
_('''Where are replies to list messages directed? <tt>Poster</tt> is <em>strongly</em> recommended for most mailing lists.'''),
def GetConfigInfo(self): langs = self.GetAvailableLanguages()
_("(Administrivia filter) Check postings and intercept ones" " that seem to be administrative requests?"), _("Administrivia tests will check postings to see whether" " it's really meant as an administrative request (like" " subscribe, unsubscribe, etc), and will add it to the" " the administrative requests queue, noti...
_('''(Administrivia filter) Check postings and intercept ones that seem to be administrative requests?'''), _("""Administrivia tests will check postings to see whether it's really meant as an administrative request (like subscribe, unsubscribe, etc), and will add it to the the administrative requests queue, notifying ...
def GetConfigInfo(self): langs = self.GetAvailableLanguages()
_('Should administrator get notices of subscribes/unsubscribes?')),
_('''Should administrator get notices of subscribes and unsubscribes?''')),
def GetConfigInfo(self): langs = self.GetAvailableLanguages()
_('Send mail to poster when their posting is held for approval?'), _("Approval notices are sent when mail triggers certain of the" " limits <em>except</em> routine list moderation and spam" " filters, for which notices are <em>not</em> sent. This" " option overrides ever sending the notice.")), ('max_message_size', ...
_('Send mail to poster when their posting is held for approval?'), _("""Approval notices are sent when mail triggers certain of the limits <em>except</em> routine list moderation and spam filters, for which notices are <em>not</em> sent. This option overrides ever sending the notice.""")), ('max_message_size', mm_cf...
def GetConfigInfo(self): langs = self.GetAvailableLanguages()
_("The host_name is the preferred name for email to mailman-related" " addresses on this host, and generally should be the mail" " host's exchanger address, if any. This setting can be useful" " for selecting among alternative names of a host that has" " multiple addresses.")), ('web_page_url', mm_cfg.String, WIDTH, ...
_("""The "host_name" is the preferred name for email to mailman-related addresses on this host, and generally should be the mail host's exchanger address, if any. This setting can be useful for selecting among alternative names of a host that has multiple addresses.""")), ('web_page_url', mm_cfg.String, WIDTH, 0, _('...
def GetConfigInfo(self): langs = self.GetAvailableLanguages()
(_('none'), _('confirm'), _('require approval'), _('confirm+approval')), 0, _("What steps are required for subscription?<br>"), _("None - no verification steps (<em>Not" " Recommended </em>)<br>" "confirm (*) - email confirmation step" " required <br>" "require approval - require list administrator" " approval for sub...
(_('none'), _('confirm'), _('require approval'), _('confirm+approval')), 0, _('What steps are required for subscription?<br>'), _('''None - no verification steps (<em>Not Recommended </em>)<br> confirm (*) - email confirmation step required <br> require approval - require list administrator approval for subscriptions <...
def GetConfigInfo(self): langs = self.GetAvailableLanguages()
"<p> (*) when someone requests a subscription," " mailman sends them a notice with a unique" " subscription request number that they must" " reply to in order to subscribe.<br> This" " prevents mischievous (or malicious) people" " from creating subscriptions for others" " without their consent.") )
<p>(*) when someone requests a subscription, Mailman sends them a notice with a unique subscription request number that they must reply to in order to subscribe.<br> This prevents mischievous (or malicious) people from creating subscriptions for others without their consent.'''))
def GetConfigInfo(self): langs = self.GetAvailableLanguages()
(_('confirm'), _('require approval'), _('confirm+approval')), 1, _("What steps are required for subscription?<br>"), _("confirm (*) - email confirmation required <br>" "require approval - require list administrator" " approval for subscriptions <br>" "confirm+approval - both confirm and approve" "<p> (*) when someone ...
(_('confirm'), _('require approval'), _('confirm+approval')), 1, _('What steps are required for subscription?<br>'), _('''confirm (*) - email confirmation required <br> require approval - require list administrator approval for subscriptions <br> confirm+approval - both confirm and approve <p>(*) when someone requests...
def GetConfigInfo(self): langs = self.GetAvailableLanguages()
_("""List access policies, including anti-spam measures, covering members and outsiders. See also the <a href="%(admin)s/archive">Archival Options section</a> for separate archive-privacy settings."""), _("Subscribing"), ('advertised', mm_cfg.Radio, (_('No'), _('Yes')), 0, _("""Advertise this list when people ask wh...
_("""List access policies, including anti-spam measures, covering members and outsiders. See also the <a href="%(admin)s/archive">Archival Options section</a> for separate archive-privacy settings."""), _('Subscribing'), ('advertised', mm_cfg.Radio, (_('No'), _('Yes')), 0, _('''Advertise this list when people ask wha...
def GetConfigInfo(self): langs = self.GetAvailableLanguages()
_("""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> setting below""")), ('posters', mm_cfg.EmailList, (5, WIDTH), 1, _("""Addresses of members accepted for posting to this list
_("""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> setting below.""")), ('posters', mm_cfg.EmailList, (5, WIDTH), 1, _('''Addresses of members accepted for posting to this list
def GetConfigInfo(self): langs = self.GetAvailableLanguages()
posting by list members"""), _("""Adding entries here will have one of two effects, according to whether another option restricts posting to members. <ul> <li>If <i>member_posting_only</i> is 'yes', then entries added here will have posting privilege in addition to list members. <li>If <i>member_posting_only</i> is ...
posting by list members'''), _("""Adding entries here will have one of two effects, according to whether another option restricts posting to members. <ul> <li>If y<i>member_posting_only</i> is 'yes', then entries added here will have posting privilege in addition to list members. <li>If <i>member_posting_only</i> is...
def GetConfigInfo(self): langs = self.GetAvailableLanguages()
('max_num_recipients', mm_cfg.Number, 5, 0, _('Ceiling on acceptable number of recipients for a posting.'), _("""If a posting has this number, or more, of recipients, it is held for admin approval. Use 0 for no ceiling.""")), ('forbidden_posters', mm_cfg.EmailList, (5, WIDTH), 1,
('max_num_recipients', mm_cfg.Number, 5, 0, _('Ceiling on acceptable number of recipients for a posting.'), _('''If a posting has this number, or more, of recipients, it is held for admin approval. Use 0 for no ceiling.''')), ('forbidden_posters', mm_cfg.EmailList, (5, WIDTH), 1,
def GetConfigInfo(self): langs = self.GetAvailableLanguages()
_("""Email addresses whose posts should always be held for
_('''Email addresses whose posts should always be held for
def GetConfigInfo(self): langs = self.GetAvailableLanguages()
arbitrary headers.""")), ('bounce_matching_headers', mm_cfg.Text, (6, WIDTH), 0, _('Hold posts with header value matching a specified regexp.'),
arbitrary headers.''')), ('bounce_matching_headers', mm_cfg.Text, (6, WIDTH), 0, _('Hold posts with header value matching a specified regexp.'),
def GetConfigInfo(self): langs = self.GetAvailableLanguages()
('nondigestable', mm_cfg.Toggle, (_('No'), _('Yes')), 1, _("""Can subscribers choose to receive mail immediately, rather than in batched digests?""")), ('msg_header', mm_cfg.Text, (4, WIDTH), 0, _('Header added to mail sent to regular list members'), _("""Text prepended to the top of every immediately-delivery messag...
('nondigestable', mm_cfg.Toggle, (_('No'), _('Yes')), 1, _("""Can subscribers choose to receive mail immediately, rather than in batched digests?""")), ('msg_header', mm_cfg.Text, (4, WIDTH), 0, _('Header added to mail sent to regular list members'), _('''Text prepended to the top of every immediately-delivery message...
def GetConfigInfo(self): langs = self.GetAvailableLanguages()
remote = _(" from %s") % remote
remote = _(" from %(remote)s")
def AddMember(self, name, password, digest=0, remote=None, lang=None):
"listname" : self.real_name,
"listname" : realname,
def AddMember(self, name, password, digest=0, remote=None, lang=None):
}, lang)
}, lang=lang)
def AddMember(self, name, password, digest=0, remote=None, lang=None):
_('%s -- confirmation of subscription -- request %d') % (self.real_name, cookie),
_('%(realname)s -- confirmation of subscription -- request %(cookie)d'),
def AddMember(self, name, password, digest=0, remote=None, lang=None):
raise Errors.MMNeedApproval, \ _('subscriptions to %s require administrator approval') % \ self.real_name
raise Errors.MMNeedApproval, _( 'subscriptions to %(realname)s require administrator approval')
def AddMember(self, name, password, digest=0, remote=None, lang=None):
raise Errors.MMNeedApproval, \ _('subscriptions to %s require administrator approval') % \ self.real_name
name = self.real_name raise Errors.MMNeedApproval, _( 'subscriptions to %(name)s require administrator approval')
def ProcessConfirmation(self, cookie): from Pending import Pending got = Pending().confirmed(cookie) if not got: raise Errors.MMBadConfirmation else: (email_addr, password, digest, lang) = got try: if self.subscribe_policy == 3: # confirm + approve self.HoldSubscription(email_addr, password, digest, lang) raise Errors....
}, lang)
}, lang=lang)
def ApprovedAddMembers(self, names, passwords, digest, ack=None, admin_notif=None, lang=None): """Subscribe members in list `names'.
}, self.preferred_language)
}, lang=self.preferred_language)
def DoActualRemoval(alias, me=self): kind = "(unfound)" try: del me.passwords[alias] except KeyError: pass if me.user_options.has_key(alias): del me.user_options[alias] try: del me.members[alias] kind = "regular" except KeyError: pass try: del me.digest_members[alias] kind = "digest" except KeyError: pass if me.languag...
sender = msg.GetSender()
sender = msg.get_sender()
def HoldMessage(self, msg, reason, msgdata={}): # Make a copy of msgdata so that subsequent changes won't corrupt the # request database. TBD: remove the `filebase' key since this will # not be relevant when the message is resurrected. newmsgdata = {} newmsgdata.update(msgdata) msgdata = newmsgdata # assure that the d...
self.preferred_language)
lang=self.preferred_language)
def __sendAdminBounceNotice(self, member, msg): # BAW: This is a bit kludgey, but we're not providing as much # information in the new admin bounce notices as we used to (some of # it was of dubious value). However, we'll provide empty, strange, or # meaningless strings for the unused %()s fields so that the language ...
self._sock.send('HELO %s\r\n' % host) self.getresp()
self._sock.send('EHLO %s\r\n' % host) try: resp = self.getresp() except error_perm: self._sock.send('HELO %s\r\n' % host) resp = self.getresp() self.DSN_support = (string.find(resp, '-DSN') != -1)
def helo(self, host):
self._sock.send('RCPT TO: <%s>\r\n' % to)
self._sock.send(rcpt_form % to)
def send(self, to, frm, text, headers=None):
valid_recipients.append(to)
valid_recipients.append(rcpt_form % to)
def send(self, to, frm, text, headers=None):
self._sock.send('RCPT TO: <%s>\r\n' % item)
self._sock.send(rcpt_form % item)
def send(self, to, frm, text, headers=None):
if not lastresp:
if type(lastresp) == type(""):
def send(self, to, frm, text, headers=None):
syslog('error', 'pattern: %s', pattern)
def handleForm(self, mlist, category, subcat, cgidata, doc): topics = [] # We start i at 1 and keep going until we no longer find items keyed # with the marked tags. i = 1 while 1: deltag = 'topic_delete_%02d' % i boxtag = 'topic_box_%02d' % i reboxtag = 'topic_rebox_%02d' % i desctag = 'topic_desc_%02d' % i where...
fmsg.set_payload(copy)
fmsg.attach(copy)
def __handlepost(self, record, value, comment, preserve, forward, addr): # For backwards compatibility with pre 2.0beta3 ptime, sender, subject, reason, filename, msgdata = record path = os.path.join(mm_cfg.DATA_DIR, filename) # Handle message preservation if preserve: parts = os.path.split(path)[1].split(DASH) parts[0...
for mlist in advertised: table.AddRow( [Link(mlist.GetScriptURL('listinfo'), Bold(mlist.real_name)), mlist.description or Italic(_('[no description available]'))])
highlight = 1 for mlist in advertised: table.AddRow( [Link(mlist.GetScriptURL('listinfo'), Bold(mlist.real_name)), mlist.description or Italic(_('[no description available]'))]) if highlight and mm_cfg.WEB_HIGHLIGHT_COLOR: table.AddRowInfo(table.GetCurrentRowIndex(), bgcolor=mm_cfg.WEB_HIGHLIGHT_COLOR) highlight = not ...
def listinfo_overview(msg=''): # Present the general listinfo overview hostname = Utils.get_domain() # Set up the document and assign it the correct language. The only one we # know about at the moment is the server's default. doc = Document() doc.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) legend = _("%(hostname)s ...
subject = subject[len(sp) + 1:]
subject = subject[len(sp):]
def SendPostAck(self, msg, sender):
try: final_digesters = mlist.one_last_digest.keys() mlist.one_last_digest = {} except AttributeError: final_digesters = [] digestmembers = mlist.GetDigestMembers() + final_digesters recipients = filter(delivery_enabled_p, digestmembers)
digestmembers = {} if hasattr(mlist, 'one_last_digest'): digestmembers.update(mlist.one_last_digest) del mlist.one_last_digest for addr in mlist.GetDigestMembers(): digestmembers[addr] = addr recipients = filter(delivery_enabled_p, digestmembers.keys())
def hates_mime_p(x, s=mlist, v=mm_cfg.DisableMime): return s.GetUserOption(x, v)
if not os.environ.has_key('HTTP_COOKIE'):
cookiedata = os.environ.get('HTTP_COOKIE') if not cookiedata:
def CheckCookie(self, key): if not os.environ.has_key('HTTP_COOKIE'): return 0 c = Cookie.Cookie(os.environ['HTTP_COOKIE']) if not c.has_key(key): return 0 cookie = c[key].value if (type(cookie) <> type([]) or len(cookie) <> 4): raise Errors.MMInvalidCookieError client_ip = os.environ.get('REMOTE_ADDR') or '0.0.0.0' no...
c = Cookie.Cookie(os.environ['HTTP_COOKIE'])
keylen = len(key) if cookiedata[keylen+1] <> '"' and cookiedata[-1] <> '"': cookiedata = key + '="' + cookiedata[keylen+1:] + '"' c = Cookie.Cookie(cookiedata)
def CheckCookie(self, key): if not os.environ.has_key('HTTP_COOKIE'): return 0 c = Cookie.Cookie(os.environ['HTTP_COOKIE']) if not c.has_key(key): return 0 cookie = c[key].value if (type(cookie) <> type([]) or len(cookie) <> 4): raise Errors.MMInvalidCookieError client_ip = os.environ.get('REMOTE_ADDR') or '0.0.0.0' no...
loopaddr = Utils.get_site_email(mlist.host_name, 'loop') loopmbox = os.path.join(mm_cfg.DATA_DIR, 'owner-bounces.mbox')
def addlist(mlist, db, fp): listname = mlist.internal_name() fieldsz = len(listname) + len('-request') # Seek to the end of the file, but if it's empty write the standard # disclaimer, and the loop catch address. fp.seek(0, 2) if not fp.tell(): print >> fp, """\
loopaddr = mm_cfg.MAILMAN_SITE_LIST + '-loop' loopmbox = os.path.join(mm_cfg.DATA_DIR, 'owner-bounces.mbox') print >> fp, ' print >> fp, '%s: %s' % (loopaddr, loopmbox)
print >> fp, ' print >> fp, '%s: %s' % (Utils.ParseEmail(loopaddr)[0], loopmbox)
def addlist(mlist, db, fp): listname = mlist.internal_name() fieldsz = len(listname) + len('-request') # Seek to the end of the file, but if it's empty write the standard # disclaimer, and the loop catch address. fp.seek(0, 2) if not fp.tell(): print >> fp, """\
print >> fp, k + ':', ((fieldsz - len(k)) * ' '), v
print >> fp, k + ':', ((fieldsz - len(k) + 1) * ' '), v
def addlist(mlist, db, fp): listname = mlist.internal_name() fieldsz = len(listname) + len('-request') # Seek to the end of the file, but if it's empty write the standard # disclaimer, and the loop catch address. fp.seek(0, 2) if not fp.tell(): print >> fp, """\
def create(mlist, cgi=0): lock = makelock() lock.lock()
def addvirtual(mlist, db, fp): listname = mlist.internal_name() fieldsz = len(listname) + len('request') hostname = mlist.host_name loopaddr = Utils.get_site_email(mlist.host_name, 'loop') mailbox, domain = Utils.ParseEmail(loopaddr) fp.seek(0, 2) if not fp.tell(): print >> fp, """\ """ print >> fp, hostname, '\...
def create(mlist, cgi=0): # Acquire the global list database lock lock = makelock() lock.lock() lockfp = None try: # First, open the dbhash file using built-in open so we can acquire an # exclusive lock on it. See the discussion above for why we do it # this way instead of specifying the `l' option to dbhash.open() lo...
lockfp = open(DBFILE)
lockfp = open(dbfile)
def create(mlist, cgi=0): # Acquire the global list database lock lock = makelock() lock.lock() lockfp = None try: # First, open the dbhash file using built-in open so we can acquire an # exclusive lock on it. See the discussion above for why we do it # this way instead of specifying the `l' option to dbhash.open() lo...
db = dbhash.open(DBFILE, 'c')
db = dbhash.open(dbfile, 'c')
def create(mlist, cgi=0): # Acquire the global list database lock lock = makelock() lock.lock() lockfp = None try: # First, open the dbhash file using built-in open so we can acquire an # exclusive lock on it. See the discussion above for why we do it # this way instead of specifying the `l' option to dbhash.open() lo...
fp = open(TEXTFILE, 'r+')
fp = open(textfile, 'r+')
def create(mlist, cgi=0): # Acquire the global list database lock lock = makelock() lock.lock() lockfp = None try: # First, open the dbhash file using built-in open so we can acquire an # exclusive lock on it. See the discussion above for why we do it # this way instead of specifying the `l' option to dbhash.open() lo...
fp = open(TEXTFILE, 'w+')
fp = open(textfile, 'w+')
def create(mlist, cgi=0): # Acquire the global list database lock lock = makelock() lock.lock() lockfp = None try: # First, open the dbhash file using built-in open so we can acquire an # exclusive lock on it. See the discussion above for why we do it # this way instead of specifying the `l' option to dbhash.open() lo...
addlist(mlist, db, fp)
func(mlist, db, fp)
def create(mlist, cgi=0): # Acquire the global list database lock lock = makelock() lock.lock() lockfp = None try: # First, open the dbhash file using built-in open so we can acquire an # exclusive lock on it. See the discussion above for why we do it # this way instead of specifying the `l' option to dbhash.open() lo...
lock.unlock(unconditionally=1) def remove(mlist, cgi=0):
def create(mlist, cgi=0, nolock=0):
def create(mlist, cgi=0): # Acquire the global list database lock lock = makelock() lock.lock() lockfp = None try: # First, open the dbhash file using built-in open so we can acquire an # exclusive lock on it. See the discussion above for why we do it # this way instead of specifying the `l' option to dbhash.open() lo...
lock = LockFile.LockFile(LOCKFILE) lock.lock()
lock = None if not nolock: lock = makelock() lock.lock() try: do_create(mlist, DBFILE, TEXTFILE, addlist) if mm_cfg.POSTFIX_STYLE_VIRTUAL_DOMAINS: dbfile, textfile = virtual_files(mlist.host_name) do_create(mlist, dbfile, textfile, addvirtual) finally: if lock: lock.unlock(unconditionally=1) def do_remove(mlist, db...
def remove(mlist, cgi=0): # Acquire the global list database lock lock = LockFile.LockFile(LOCKFILE) lock.lock() lockfp = None try: listname = mlist.internal_name() # Crack open the dbhash file, and delete all the entries. See the # discussion above for while we lock the aliases.db file this way. lockfp = open(DBFILE)...
lockfp = open(DBFILE)
lockfp = open(dbfile)
def remove(mlist, cgi=0): # Acquire the global list database lock lock = LockFile.LockFile(LOCKFILE) lock.lock() lockfp = None try: listname = mlist.internal_name() # Crack open the dbhash file, and delete all the entries. See the # discussion above for while we lock the aliases.db file this way. lockfp = open(DBFILE)...
db = dbhash.open(DBFILE, 'c')
db = dbhash.open(dbfile, 'c')
def remove(mlist, cgi=0): # Acquire the global list database lock lock = LockFile.LockFile(LOCKFILE) lock.lock() lockfp = None try: listname = mlist.internal_name() # Crack open the dbhash file, and delete all the entries. See the # discussion above for while we lock the aliases.db file this way. lockfp = open(DBFILE)...
db['YP_LAST_MODIFIED'] = '%010d' % time.time() if not db.has_key('YP_MASTER_NAME'): db['YP_MASTER_NAME'] = socket.getfqdn()
if not virtualp: db['YP_LAST_MODIFIED'] = '%010d' % time.time() if not db.has_key('YP_MASTER_NAME'): db['YP_MASTER_NAME'] = socket.getfqdn()
def remove(mlist, cgi=0): # Acquire the global list database lock lock = LockFile.LockFile(LOCKFILE) lock.lock() lockfp = None try: listname = mlist.internal_name() # Crack open the dbhash file, and delete all the entries. See the # discussion above for while we lock the aliases.db file this way. lockfp = open(DBFILE)...
outfile = TEXTFILE
def remove(mlist, cgi=0): # Acquire the global list database lock lock = LockFile.LockFile(LOCKFILE) lock.lock() lockfp = None try: listname = mlist.internal_name() # Crack open the dbhash file, and delete all the entries. See the # discussion above for while we lock the aliases.db file this way. lockfp = open(DBFILE)...
infp = open(TEXTFILE)
infp = open(textfile)
def remove(mlist, cgi=0): # Acquire the global list database lock lock = LockFile.LockFile(LOCKFILE) lock.lock() lockfp = None try: listname = mlist.internal_name() # Crack open the dbhash file, and delete all the entries. See the # discussion above for while we lock the aliases.db file this way. lockfp = open(DBFILE)...
outfp = open(TEXTFILE + '.tmp', 'w')
outfp = open(textfile + '.tmp', 'w')
def remove(mlist, cgi=0): # Acquire the global list database lock lock = LockFile.LockFile(LOCKFILE) lock.lock() lockfp = None try: listname = mlist.internal_name() # Crack open the dbhash file, and delete all the entries. See the # discussion above for while we lock the aliases.db file this way. lockfp = open(DBFILE)...
os.rename(TEXTFILE+'.tmp', TEXTFILE)
os.rename(textfile+'.tmp', textfile)
def remove(mlist, cgi=0): # Acquire the global list database lock lock = LockFile.LockFile(LOCKFILE) lock.lock() lockfp = None try: listname = mlist.internal_name() # Crack open the dbhash file, and delete all the entries. See the # discussion above for while we lock the aliases.db file this way. lockfp = open(DBFILE)...
conn.close()
conn.quit()
def process(mlist, msg, msgdata): recips = msgdata.get('recips') if not recips: # Nobody to deliver to! return # Calculate the envelope sender. When VERPing, envsender is a 2-tuple # containing the list's bounces address and the list's host_name. envsender = None if mlist: listname = mlist.internal_name() if not msgda...
conn.close()
conn.quit()
def threaded_deliver(envsender, msgtext, chunks, failures): threads = {} numchunks = len(chunks) chunkq = Queue.Queue(numchunks) # Populate the queue with all the chunks that need processing. for chunk in chunks: chunkq.put(chunk) # Start all the threads. We want each thread to share a connection to the # SMTP server....
email_regexp = '<?\([^ \t@s|<>]+@[^ \t@<>]+\.[^ \t<>.]+\)>?'
email_regexp = '<?\([^ \t@|<>]+@[^ \t@<>]+\.[^ \t<>.]+\)>?'
def ScanMessage(self, msg):
(regex.compile('.*%s: User unknown.*' % email_regexp), REMOVE))
(regex.compile('.*%s: User unknown.*' % email_regexp), REMOVE), (regex.compile('.*%s\.\.\. User unknown' % email_regexp), REMOVE))
def ScanMessage(self, msg):
cookie_key = self._internal_name + ':' + cookie else: cookie_key = self._internal_name if password is not None:
key = key + ':' + cookie if password is not None:
def WebAuthenticate(self, user=None, password=None, cookie=None): if cookie: cookie_key = self._internal_name + ':' + cookie else: cookie_key = self._internal_name if password is not None: # explicit login if user: self.ConfirmUserPassword(user, password) else: self.ConfirmAdminPassword(password) print self.MakeCookie...
print self.MakeCookie(cookie_key)
print self.MakeCookie(key)
def WebAuthenticate(self, user=None, password=None, cookie=None): if cookie: cookie_key = self._internal_name + ':' + cookie else: cookie_key = self._internal_name if password is not None: # explicit login if user: self.ConfirmUserPassword(user, password) else: self.ConfirmAdminPassword(password) print self.MakeCookie...
return self.CheckCookie(cookie_key)
return self.CheckCookie(key)
def WebAuthenticate(self, user=None, password=None, cookie=None): if cookie: cookie_key = self._internal_name + ':' + cookie else: cookie_key = self._internal_name if password is not None: # explicit login if user: self.ConfirmUserPassword(user, password) else: self.ConfirmAdminPassword(password) print self.MakeCookie...
issued = time.time() expires = int(issued) + mm_cfg.ADMIN_COOKIE_LIFE
def MakeCookie(self, key): # Make sure we have the necessary ingredients for our cookie issued = time.time() expires = int(issued) + mm_cfg.ADMIN_COOKIE_LIFE # ... including the secret ingredient :) secret = self.password mac = md5.new(secret + `issued` + `expires`).digest() # Mix all ingredients gently together, c = C...
mac = md5.new(secret + `issued` + `expires`).digest()
issued = int(time.time()) expires = issued + int(mm_cfg.ADMIN_COOKIE_LIFE) mac = sha.new(secret + `issued` + `expires`).hexdigest()
def MakeCookie(self, key): # Make sure we have the necessary ingredients for our cookie issued = time.time() expires = int(issued) + mm_cfg.ADMIN_COOKIE_LIFE # ... including the secret ingredient :) secret = self.password mac = md5.new(secret + `issued` + `expires`).digest() # Mix all ingredients gently together, c = C...
c[key] = [issued, expires, mac] path = urlparse(self.web_page_url)[2]
c[key] = Utils.hexlify(marshal.dumps((issued, expires, mac))) path = urlparse(self.web_page_url)[2]
def MakeCookie(self, key): # Make sure we have the necessary ingredients for our cookie issued = time.time() expires = int(issued) + mm_cfg.ADMIN_COOKIE_LIFE # ... including the secret ingredient :) secret = self.password mac = md5.new(secret + `issued` + `expires`).digest() # Mix all ingredients gently together, c = C...
keylen = len(key) try: if cookiedata[keylen+1] <> '"' and cookiedata[-1] <> '"': cookiedata = key + '="' + cookiedata[keylen+1:] + '"' except IndexError: pass
def CheckCookie(self, key): cookiedata = os.environ.get('HTTP_COOKIE') if not cookiedata: return 0 # # TBD: At least some versions of MS Internet Explorer stores cookies # without the double quotes. This has been verified for MSIE 4.01, # although MSIE 5 is fixed. The bug (see PR#80) is that if these # double quotes ...
cookie = c[key].value if type(cookie) <> ListType or len(cookie) <> 3:
try: cookie = marshal.loads(Utils.unhexlify(c[key].value)) issued, expires, received_mac = cookie except (EOFError, ValueError, TypeError):
def CheckCookie(self, key): cookiedata = os.environ.get('HTTP_COOKIE') if not cookiedata: return 0 # # TBD: At least some versions of MS Internet Explorer stores cookies # without the double quotes. This has been verified for MSIE 4.01, # although MSIE 5 is fixed. The bug (see PR#80) is that if these # double quotes ...
[issued, expires, received_mac] = cookie
def CheckCookie(self, key): cookiedata = os.environ.get('HTTP_COOKIE') if not cookiedata: return 0 # # TBD: At least some versions of MS Internet Explorer stores cookies # without the double quotes. This has been verified for MSIE 4.01, # although MSIE 5 is fixed. The bug (see PR#80) is that if these # double quotes ...
mac = md5.new(secret + `issued` + `expires`).digest()
mac = sha.new(secret + `issued` + `expires`).hexdigest()
def CheckCookie(self, key): cookiedata = os.environ.get('HTTP_COOKIE') if not cookiedata: return 0 # # TBD: At least some versions of MS Internet Explorer stores cookies # without the double quotes. This has been verified for MSIE 4.01, # although MSIE 5 is fixed. The bug (see PR#80) is that if these # double quotes ...
lang = self.getMemberLanguage(addr)
addrs = getaddresses([addr]) if len(addrs) == 1: realname, addr = addrs[0] lang = self.getMemberLanguage(addr) else: addr = [a for realname, a in addrs] lang = self.preferred_language
def __handlepost(self, record, value, comment, preserve, forward, addr): # For backwards compatibility with pre 2.0beta3 ptime, sender, subject, reason, filename, msgdata = record path = os.path.join(mm_cfg.DATA_DIR, filename) # Handle message preservation if preserve: parts = os.path.split(path)[1].split(DASH) parts[0...
kind, formataddr((email, name)), whence)
kind, formataddr((name, email)), whence)
def ApprovedAddMember(self, userdesc, ack=None, admin_notif=None, text='', whence=''): """Add a member right now.
f = StringIO(txt) import HyperArch h = HyperArch.HyperArchive(self) h.processUnixMailbox(f, HyperArch.Article) h.close() f.close()
private_p = self.archive_private if mm_cfg.PUBLIC_EXTERNAL_ARCHIVER and not private_p: self.ExternalArchive(mm_cfg.PUBLIC_EXTERNAL_ARCHIVER, txt) elif mm_cfg.PRIVATE_EXTERNAL_ARCHIVER and private_p: self.ExternalArchive(mm_cfg.PRIVATE_EXTERNAL_ARCHIVER, txt) else: f = StringIO(txt) import HyperArch h = HyperArch.Hyper...
def ArchiveMail(self, msg): """Store postings in mbox and/or pipermail archive, depending."""
table.AddRow([Bold(_('List')), Bold(_('Description'))])
table.AddRow([Bold(FontAttr(_('List'), size='+2')), Bold(FontAttr(_('Description'), size='+2')) ]) highlight = 1
def admin_overview(msg=''): # Show the administrative overview page, with the list of all the lists on # this host. msg is an optional error message to display at the top of # the page. # # This page should be displayed in the server's default language, which # should have already been set. hostname = mm_cfg.DEFAULT_H...
mlist.description or Italic(_('[no description available]')), ])
mlist.description or Italic(_('[no description available]'))]) if highlight and mm_cfg.WEB_HIGHLIGHT_COLOR: table.AddRowInfo(table.GetCurrentRowIndex(), bgcolor=mm_cfg.WEB_HIGHLIGHT_COLOR) highlight = not highlight
def admin_overview(msg=''): # Show the administrative overview page, with the list of all the lists on # this host. msg is an optional error message to display at the top of # the page. # # This page should be displayed in the server's default language, which # should have already been set. hostname = mm_cfg.DEFAULT_H...