rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
otherlinks.AddItem(Link(mlist.GetRelativeScriptURL('admindb'),
otherlinks.AddItem(Link(mlist.GetScriptURL('admindb'),
def FormatConfiguration(doc, mlist, category, category_suffix, cgi_data): """Produce the overall doc, *except* any processing error messages.""" for k, v in CATEGORIES: if k == category: label = v doc.SetTitle('%s Administration (%s)' % (mlist.real_name, label)) doc.AddItem(Center(Header(2, '%s mailing list administra...
otherlinks.AddItem(Link(mlist.GetRelativeScriptURL('listinfo'),
otherlinks.AddItem(Link(mlist.GetScriptURL('listinfo'),
def FormatConfiguration(doc, mlist, category, category_suffix, cgi_data): """Produce the overall doc, *except* any processing error messages.""" for k, v in CATEGORIES: if k == category: label = v doc.SetTitle('%s Administration (%s)' % (mlist.real_name, label)) doc.AddItem(Center(Header(2, '%s mailing list administra...
otherlinks.AddItem(Link(mlist.GetRelativeScriptURL('edithtml'),
otherlinks.AddItem(Link(mlist.GetScriptURL('edithtml'),
def FormatConfiguration(doc, mlist, category, category_suffix, cgi_data): """Produce the overall doc, *except* any processing error messages.""" for k, v in CATEGORIES: if k == category: label = v doc.SetTitle('%s Administration (%s)' % (mlist.real_name, label)) doc.AddItem(Center(Header(2, '%s mailing list administra...
form = Form("%s/%s" % (mlist.GetRelativeScriptURL('admin'), category))
form = Form("%s/%s" % (mlist.GetScriptURL('admin'), category))
def FormatOptionHelp(doc, varref, mlist): item = None reflist = string.split(varref, '/') if len(reflist) == 2: category, varname = reflist options = GetConfigOptions(mlist, category) for i in options: if i and i[0] == varname: item = i break if not item: bad = ("Option %s/%s not found. %s" % (category, varname, os.env...
doc.AddItem(Link('%s/%s' % (mlist.GetRelativeScriptURL('admin'), category),
doc.AddItem(Link('%s/%s' % (mlist.GetScriptURL('admin'), category),
def FormatOptionHelp(doc, varref, mlist): item = None reflist = string.split(varref, '/') if len(reflist) == 2: category, varname = reflist options = GetConfigOptions(mlist, category) for i in options: if i and i[0] == varname: item = i break if not item: bad = ("Option %s/%s not found. %s" % (category, varname, os.env...
Link(('../' * (Utils.GetNestingLevel()-1) + mlist.internal_name() + '/?VARHELP=' + category + '/' + varname),
Link(mlist.GetScriptURL('admin') + '/?VARHELP=' + category + '/' + varname,
def GetItemGuiDescr(mlist, category, varname, descr, detailsp): """Return the item's description, with link to details. Details are not included if this is a VARHELP page, because that /is/ the details page! """ if not detailsp: return '<div ALIGN="right">' + descr + '</div>' return Container('<div ALIGN="right">' + d...
mlist.GetOptionsURL(member, obscure=1, relative=1),
mlist.GetOptionsURL(member, obscure=1),
def FormatMembershipOptions(mlist, cgi_data): container = Container() header = Table(width="100%") header.AddRow([Center(Header(2, "Membership Management"))]) header.AddCellInfo(max(header.GetCurrentRowIndex(), 0), 0, colspan=2, bgcolor="#99ccff") container.AddItem(header) user_table = Table(width="90%", border='2') us...
if not mlist.filter_content or not mlist.filter_mime_types:
if not mlist.filter_content: return if msgdata.get('isdigest'):
def process(mlist, msg, msgdata): # Short-circuits if not mlist.filter_content or not mlist.filter_mime_types: return # We also don't care about our own digests or plaintext ctype = msg.get_type('text/plain') mtype = msg.get_main_type('text') if msgdata.get('isdigest') or ctype == 'text/plain': return # Check to see if...
ctype = msg.get_type('text/plain') mtype = msg.get_main_type('text') if msgdata.get('isdigest') or ctype == 'text/plain': return
ctype = msg.get_content_type() mtype = msg.get_content_maintype()
def process(mlist, msg, msgdata): # Short-circuits if not mlist.filter_content or not mlist.filter_mime_types: return # We also don't care about our own digests or plaintext ctype = msg.get_type('text/plain') mtype = msg.get_main_type('text') if msgdata.get('isdigest') or ctype == 'text/plain': return # Check to see if...
filter_parts(msg, filtertypes)
filter_parts(msg, filtertypes, passtypes)
def process(mlist, msg, msgdata): # Short-circuits if not mlist.filter_content or not mlist.filter_mime_types: return # We also don't care about our own digests or plaintext ctype = msg.get_type('text/plain') mtype = msg.get_main_type('text') if msgdata.get('isdigest') or ctype == 'text/plain': return # Check to see if...
if msg.get_type() == 'multipart/alternative':
if mtype == 'multipart':
def process(mlist, msg, msgdata): # Short-circuits if not mlist.filter_content or not mlist.filter_mime_types: return # We also don't care about our own digests or plaintext ctype = msg.get_type('text/plain') mtype = msg.get_main_type('text') if msgdata.get('isdigest') or ctype == 'text/plain': return # Check to see if...
msg.set_payload(firstalt.get_payload()) del msg['content-type'] del msg['content-transfer-encoding'] del msg['content-disposition'] del msg['content-description'] msg['Content-Type'] = firstalt.get('content-type', 'text/plain') cte = firstalt.get('content-transfer-encoding') if cte: msg['Content-Transfer-Encoding'] = c...
reset_payload(msg, firstalt)
def process(mlist, msg, msgdata): # Short-circuits if not mlist.filter_content or not mlist.filter_mime_types: return # We also don't care about our own digests or plaintext ctype = msg.get_type('text/plain') mtype = msg.get_main_type('text') if msgdata.get('isdigest') or ctype == 'text/plain': return # Check to see if...
def filter_parts(msg, filtertypes):
def reset_payload(msg, subpart): payload = subpart.get_payload() if subpart.get_content_type() == 'text/plain' and payload[-1] <> '\n': payload += '\n' msg.set_payload(payload) del msg['content-type'] del msg['content-transfer-encoding'] del msg['content-disposition'] del msg['content-description'] msg['Content-Type...
def filter_parts(msg, filtertypes): # Look at all the message's subparts, and recursively filter if not msg.is_multipart(): return 1 payload = msg.get_payload() prelen = len(payload) newpayload = [] for subpart in payload: keep = filter_parts(subpart, filtertypes) if not keep: continue ctype = subpart.get_type('text/pl...
keep = filter_parts(subpart, filtertypes)
keep = filter_parts(subpart, filtertypes, passtypes)
def filter_parts(msg, filtertypes): # Look at all the message's subparts, and recursively filter if not msg.is_multipart(): return 1 payload = msg.get_payload() prelen = len(payload) newpayload = [] for subpart in payload: keep = filter_parts(subpart, filtertypes) if not keep: continue ctype = subpart.get_type('text/pl...
ctype = subpart.get_type('text/plain') mtype = subpart.get_main_type('text')
ctype = subpart.get_content_type() mtype = subpart.get_content_maintype()
def filter_parts(msg, filtertypes): # Look at all the message's subparts, and recursively filter if not msg.is_multipart(): return 1 payload = msg.get_payload() prelen = len(payload) newpayload = [] for subpart in payload: keep = filter_parts(subpart, filtertypes) if not keep: continue ctype = subpart.get_type('text/pl...
if subpart.get_type() == 'multipart/alternative':
if subpart.get_content_type() == 'multipart/alternative':
def collapse_multipart_alternatives(msg): if not msg.is_multipart(): return newpayload = [] for subpart in msg.get_payload(): if subpart.get_type() == 'multipart/alternative': try: firstalt = subpart.get_payload(0) newpayload.append(firstalt) except IndexError: pass else: newpayload.append(subpart) msg.set_payload(newp...
text = text[bol+1:]
bol = bol + 1 while bol < len(text) and text[bol] in string.whitespace: bol = bol + 1 text = text[bol:]
def wrap(text, column=70): """Wrap and fill the text to the specified column. Wrapping is always in effect, although if it is not possible to wrap a line (because some word is longer than `column' characters) the line is broken at the next available whitespace boundary. Paragraphs are also always filled, unless the l...
return wrapped
return wrapped[:-2]
def wrap(text, column=70): """Wrap and fill the text to the specified column. Wrapping is always in effect, although if it is not possible to wrap a line (because some word is longer than `column' characters) the line is broken at the next available whitespace boundary. Paragraphs are also always filled, unless the l...
d['description'] = _("all the %(esender)s's held messages.")
esender = cgi.escape(sender) d['description'] = _("all of %(esender)s's held messages.")
def sigterm_handler(signum, frame, mlist=mlist): # Make sure the list gets unlocked... mlist.Unlock() # ...and ensure we exit, otherwise race conditions could cause us to # enter MailList.Save() while we're in the unlocked state, and that # could be bad! sys.exit(0)
if not details:
if addform:
def sigterm_handler(signum, frame, mlist=mlist): # Make sure the list gets unlocked... mlist.Unlock() # ...and ensure we exit, otherwise race conditions could cause us to # enter MailList.Save() while we're in the unlocked state, and that # could be bad! sys.exit(0)
pairs.append(fieldval.split()[1])
pairs.append(('', fieldval.split()[1]))
def get_senders(self, preserve_case=0, headers=None): """Return a list of addresses representing the author of the email.
fieldval = self[h] if fieldval: pairs.extend(email.Utils.getaddresses([fieldval]))
fieldvals = self.get_all(h) if fieldvals: pairs.extend(email.Utils.getaddresses(fieldvals))
def get_senders(self, preserve_case=0, headers=None): """Return a list of addresses representing the author of the email.
if e is not None: self.email = e
if not self.email and e is not None: ignoreauthor, self.email = email.Utils.parseaddr(e)
def __init__(self, message = None, sequence = 0, keepHeaders = []):
'''(<i>The %(which)s is only available to the list
'''(<i>%(which)s is only available to the list
def RestrictedListMessage(self, which, restriction): if not restriction: return '' elif restriction == 1: return _( '''(<i>The %(which)s is only available to the list members.</i>)''') else: return _('''(<i>The %(which)s is only available to the list administrator.</i>)''')
return _('''(<i>The %(which)s is only available to the list
return _('''(<i>%(which)s is only available to the list
def RestrictedListMessage(self, which, restriction): if not restriction: return '' elif restriction == 1: return _( '''(<i>The %(which)s is only available to the list members.</i>)''') else: return _('''(<i>The %(which)s is only available to the list administrator.</i>)''')
container.AddItem(self.RestrictedListMessage(_('subscribers list'), self.private_roster)
container.AddItem( self.RestrictedListMessage(_('The subscribers list'), self.private_roster)
def RosterOption(self, lang): container = Container() container.AddItem(Hidden('language', lang)) if not self.private_roster: container.AddItem(_("Click here for the list of ") + self.real_name + _(" subscribers: ")) container.AddItem(SubmitButton('SubscriberRoster', _("Visit Subscriber list"))) else: if self.private_r...
self.RestrictedListMessage(_('current archive'),
self.RestrictedListMessage(_('The current archive'),
def GetStandardReplacements(self, lang=None): dmember_len = len(self.getDigestMemberKeys()) member_len = len(self.getRegularMemberKeys()) # If only one language is enabled for this mailing list, omit the # language choice buttons. if len(self.GetAvailableLanguages()) == 1: listlangs = _(Utils.GetLanguageDescr(self.pref...
<p>Send questions or comments to '''),
<p>If you are having trouble using the lists, please contact '''),
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 ...
listlangs = Utils.GetLanguageDescr(self.preferred_language)
listlangs = _(Utils.GetLanguageDescr(self.preferred_language))
def GetStandardReplacements(self, lang=None): dmember_len = len(self.getDigestMemberKeys()) member_len = len(self.getRegularMemberKeys()) # If only one language is enabled for this mailing list, omit the # language choice buttons. if len(self.GetAvailableLanguages()) == 1: listlangs = Utils.GetLanguageDescr(self.prefer...
def convert(varname, func, mlist=mlist, cgidata=cgidata, doc=doc):
def convert(varname, func, self=self, mlist=mlist, cgidata=cgidata, doc=doc):
def convert(varname, func, mlist=mlist, cgidata=cgidata, doc=doc): self.__convert(mlist, cgidata, varname, doc, func)
fp = open(os.path.join('tests', 'bounces', file))
fp = open(os.path.join(prefix, 'Mailman', 'testing', 'bounces', file))
def test_bounce(self): for modname, file, addrs in self.DATA: module = 'Mailman.Bouncers.' + modname __import__(module) fp = open(os.path.join('tests', 'bounces', file)) try: msg = email.message_from_file(fp) finally: fp.close() foundaddrs = sys.modules[module].process(msg) # Some modules return None instead of [] for ...
fp = open(os.path.join('tests', 'bounces', 'postfix_01.txt'))
fp = open(os.path.join(prefix, 'Mailman', 'testing', 'bounces', 'postfix_01.txt'))
def test_SMTP32_failure(self): from Mailman.Bouncers import SMTP32 # This file has no X-Mailer: header fp = open(os.path.join('tests', 'bounces', 'postfix_01.txt')) try: msg = email.message_from_file(fp) finally: fp.close() self.failIf(msg['x-mailer'] is not None) self.failIf(SMTP32.process(msg))
if isinstance(body, types.UnicodeType): body = body.encode(Utils.GetCharSet(self._lang), 'replace')
cset = Utils.GetCharSet(self._lang) if not isinstance(body, types.UnicodeType): body = unicode(body, cset, 'replace')
def as_text(self): d = self.__dict__.copy() # We need to guarantee a valid From_ line, even if there are # bososities in the headers. if not d.get('fromdate', '').strip(): d['fromdate'] = time.ctime(time.time()) if not d.get('email', '').strip(): d['email'] = 'bogus@does.not.exist.com' if not d.get('datestr', '').strip...
'\g<1>' + _(' at ') + '\g<2>', body)
'\g<1>' + atmark + '\g<2>', body)
def as_text(self): d = self.__dict__.copy() # We need to guarantee a valid From_ line, even if there are # bososities in the headers. if not d.get('fromdate', '').strip(): d['fromdate'] = time.ctime(time.time()) if not d.get('email', '').strip(): d['email'] = 'bogus@does.not.exist.com' if not d.get('datestr', '').strip...
if mlist.subscribe_policy in (1, 3):
if mlist.subscribe_policy in (2, 3):
def subscription_prompt(mlist, doc, cookie, userdesc): email = userdesc.address name = userdesc.fullname password = userdesc.password digest = userdesc.digest lang = userdesc.language title = _('Confirm subscription request') doc.SetTitle(title) i18n.set_language(lang) doc.set_language(lang) form = Form(mlist.GetScrip...
self.sock.connect(self.host, self.port)
self.sock.connect((self.host, self.port))
def __init__(self, host, port=NNTP_PORT, user=None, password=None, readermode=None): """Initialize an instance. Arguments: - host: hostname to connect to - port: port to connect to (default the standard NNTP port) - user: username to authenticate with - password: password to use with username - readermode: if true, se...
- resp: server response if succesful
- resp: server response if successful
def newgroups(self, date, time): """Process a NEWGROUPS command. Arguments: - date: string 'yymmdd' indicating the date - time: string 'hhmmss' indicating the time Return: - resp: server response if succesful - list: list of newsgroup names"""
- resp: server response if succesful
- resp: server response if successful
def newnews(self, group, date, time): """Process a NEWNEWS command. Arguments: - group: group name or '*' - date: string 'yymmdd' indicating the date - time: string 'hhmmss' indicating the time Return: - resp: server response if succesful - list: list of article ids"""
- resp: server response if succesful
- resp: server response if successful
def list(self): """Process a LIST command. Return: - resp: server response if succesful - list: list of (group, last, first, flag) (strings)"""
- resp: server response if succesful
- resp: server response if successful
def group(self, name): """Process a GROUP command. Argument: - group: the group name Returns: - resp: server response if succesful - count: number of articles (string) - first: first article number (string) - last: last article number (string) - name: the group name"""
- resp: server response if succesful
- resp: server response if successful
def help(self): """Process a HELP command. Returns: - resp: server response if succesful - list: list of strings"""
- resp: server response if succesful
- resp: server response if successful
def stat(self, id): """Process a STAT command. Argument: - id: article number or message id Returns: - resp: server response if succesful - nr: the article number - id: the article id"""
- resp: server response if succesful
- resp: server response if successful
def head(self, id): """Process a HEAD command. Argument: - id: article number or message id Returns: - resp: server response if succesful - nr: article number - id: message id - list: the lines of the article's header"""
- resp: server response if succesful
- resp: server response if successful
def body(self, id): """Process a BODY command. Argument: - id: article number or message id Returns: - resp: server response if succesful - nr: article number - id: message id - list: the lines of the article's body"""
- resp: server response if succesful
- resp: server response if successful
def article(self, id): """Process an ARTICLE command. Argument: - id: article number or message id Returns: - resp: server response if succesful - nr: article number - id: message id - list: the lines of the article"""
- resp: server response if succesful"""
- resp: server response if successful"""
def slave(self): """Process a SLAVE command. Returns: - resp: server response if succesful"""
- resp: server response if succesful
- resp: server response if successful
def xhdr(self, hdr, str): """Process an XHDR command (optional server extension). Arguments: - hdr: the header type (e.g. 'subject') - str: an article nr, a message id, or a range nr1-nr2 Returns: - resp: server response if succesful - list: list of (nr, value) strings"""
- resp: server response if succesful
- resp: server response if successful
def xover(self,start,end): """Process an XOVER command (optional server extension) Arguments: - start: start of range - end: end of range Returns: - resp: server response if succesful - list: list of (art-nr, subject, poster, date, id, references, size, lines)"""
- resp: server response if succesful
- resp: server response if successful
def xgtitle(self, group): """Process an XGTITLE command (optional server extension) Arguments: - group: group name wildcard (i.e. news.*) Returns: - resp: server response if succesful - list: list of (name,title) strings"""
resp: server response if succesful
resp: server response if successful
def xpath(self,id): """Process an XPATH command (optional server extension) Arguments: - id: Message id of article Returns: resp: server response if succesful path: directory path to article"""
resp: server response if succesful
resp: server response if successful
def date (self): """Process the DATE command. Arguments: None Returns: resp: server response if succesful date: Date suitable for newnews/newgroups commands etc. time: Time suitable for newnews/newgroups commands etc."""
- resp: server response if succesful"""
- resp: server response if successful"""
def post(self, f): """Process a POST command. Arguments: - f: file containing the article Returns: - resp: server response if succesful"""
- resp: server response if succesful
- resp: server response if successful
def ihave(self, id, f): """Process an IHAVE command. Arguments: - id: message-id of the article - f: file containing the article Returns: - resp: server response if succesful Note that if the server refuses the article an exception is raised."""
- resp: server response if succesful"""
- resp: server response if successful"""
def quit(self): """Process a QUIT command and close the socket. Returns: - resp: server response if succesful"""
old = os.umask(0022) f = open(SITE_PW_FILE, "w+") f.write(Crypt.crypt(pw, Utils.GetRandomSeed())) f.close() os.umask(old)
fp = Utils.open_ex(SITE_PW_FILE, 'w', perms=0640) fp.write(Crypt.crypt(pw, Utils.GetRandomSeed())) fp.close()
def SetSiteAdminPassword(self, pw): old = os.umask(0022)
if not mlist.isMember(oldaddr):
if not mlist.isMember(addr):
def ChangeMemberName(self, addr, name, globally): self.setMemberName(addr, name) if not globally: return for listname in Utils.list_names(): # Don't bother with ourselves if listname == self.internal_name(): continue mlist = MailList(listname, lock=0) if mlist.host_name <> self.host_name: continue if not mlist.isMember...
mlist.InviteNewMember(userdesc, invitation)
if mlist.isMember(address): raise Errors.MMAlreadyAMember else: mlist.InviteNewMember(userdesc, invitation)
def safeint(formvar, defaultval=None): try: return int(cgidata.getvalue(formvar)) except (ValueError, TypeError): return defaultval
i18n.set_language(lang) doc.set_language(lang)
def subscription_prompt(mlist, doc, cookie, userdesc): email = userdesc.address password = userdesc.password digest = userdesc.digest lang = userdesc.language name = Utils.uncanonstr(userdesc.fullname, lang) title = _('Confirm subscription request') doc.SetTitle(title) i18n.set_language(lang) doc.set_language(lang) fo...
values = [mm_cfg.LC_DESCRIPTIONS[l][0] for l in langs]
values = [_(Utils.GetLanguageDescr(l)) for l in langs]
def subscription_prompt(mlist, doc, cookie, userdesc): email = userdesc.address password = userdesc.password digest = userdesc.digest lang = userdesc.language name = Utils.uncanonstr(userdesc.fullname, lang) title = _('Confirm subscription request') doc.SetTitle(title) i18n.set_language(lang) doc.set_language(lang) fo...
Pending.confirm(cookie, expunge=1)
userdesc = Pending.confirm(cookie, expunge=1)[1] lang = userdesc.language i18n.set_language(lang) doc.set_language(lang)
def subscription_cancel(mlist, doc, cookie): # Discard this cookie Pending.confirm(cookie, expunge=1) doc.AddItem(_('You have canceled your subscription request.'))
if error: PrintResults(mlist, results, doc) else:
if not error:
def process_form(mlist, doc): form = cgi.FieldStorage() error = 0 results = '' # Preliminaries done, actual processing of the form input below. if form.has_key("UserOptions") or \ form.has_key("info") and \ not form.has_key("email"): # then # Go to user options section. if not form.has_key("info"): doc.AddItem(Header(...
ign, sender, msgsubject, givenreason, ign, ign = mlist.GetRecord(id)
try: data = mlist.GetRecord(id) except KeyError: data = None
def sigterm_handler(signum, frame, mlist=mlist): mlist.Unlock() sys.exit(0)
ign, sender, msgsubject, givenreason, ign, ign = data
def sigterm_handler(signum, frame, mlist=mlist): mlist.Unlock() sys.exit(0)
Please send mail to <a href=%s>%s</a> explaining exactly what happened to provoke this error.<p>''' % (mm_cfg.MAILMAN_OWNER))
Please send mail to <a href="mailto:%(owner)s">%(owner)s</a> explaining exactly what happened to provoke this error.<p>''' % {'owner': mm_cfg.MAILMAN_OWNER})
def main(): # XXX: blech, yuk, ick global list global operation global doc doc = htmlformat.Document() path = os.environ['PATH_INFO'] list_info = Utils.GetPathPieces(path) if len(list_info) < 2: doc.AddItem(htmlformat.Header(2, "Error")) doc.AddItem(htmlformat.Bold("Invalid options to CGI script.")) print doc.Format...
<a href="http://www.faqs.org/rfc/rfc2369.html">RFC 2369</a>
<a href="http://www.faqs.org/rfcs/rfc2369.html">RFC 2369</a>
def GetConfigInfo(self, mlist, category, subcat): if category <> 'general': return None WIDTH = mm_cfg.TEXTFIELDWIDTH
<a href="http://www.faqs.org/rfc/rfc2369.html">RFC 2369</a>.
<a href="http://www.faqs.org/rfcs/rfc2369.html">RFC 2369</a>.
def GetConfigInfo(self, mlist, category, subcat): if category <> 'general': return None WIDTH = mm_cfg.TEXTFIELDWIDTH
'listaddress' : self.GetListEmail(),
'listaddr' : self.GetListEmail(),
def ProcessSubscribeCmd(self, args, cmd, mail):
'request_addr': self.GetRequestEmail(),
'requestaddr' : self.GetRequestEmail(),
def ProcessSubscribeCmd(self, args, cmd, mail):
not see any of the earlier messages.'''))
not see any of the earlier messages.''')), ('news_prefix_subject_too', mm_cfg.Toggle, (_('No'), _('Yes')), 0, _('Prefix <tt>Subject:</tt> headers on postings gated to news?'), _("""Mailman prefixes <tt>Subject:</tt> headers with <a href="?VARHELP=general/subject_prefix">text you can customize</a> and normally, this pr...
def GetConfigInfo(self, mlist, category, subcat=None): if category <> 'gateway': return None WIDTH = mm_cfg.TEXTFIELDWIDTH
lines = map(string.lower, msg.readlines()) if len(lines) > 30: return 0
lines = map(string.lower, string.split(msg.body, "\n"))
def IsAdministrivia(msg): lines = map(string.lower, msg.readlines()) if len(lines) > 30: return 0 # # check to see how many lines that actually have text in them there are # admin_data = {"subscribe": (0, 3), "unsubscribe": (0, 1), "who": (0,0), "info": (0,0), "lists": (0,0), "set": (2, 3), "help": (0,0), "password": (...
if lines_with_text > 10:
if lines_with_text > 30:
def IsAdministrivia(msg): lines = map(string.lower, msg.readlines()) if len(lines) > 30: return 0 # # check to see how many lines that actually have text in them there are # admin_data = {"subscribe": (0, 3), "unsubscribe": (0, 1), "who": (0,0), "info": (0,0), "lists": (0,0), "set": (2, 3), "help": (0,0), "password": (...
if admin_data.has_key(string.lower(string.strip(msg.body))):
sig_ind = string.find(msg.body, "\n-- ") if sig_ind != -1: body = msg.body[:sig_ind] else: body = msg.body if admin_data.has_key(string.lower(string.strip(body))):
def IsAdministrivia(msg): lines = map(string.lower, msg.readlines()) if len(lines) > 30: return 0 # # check to see how many lines that actually have text in them there are # admin_data = {"subscribe": (0, 3), "unsubscribe": (0, 1), "who": (0,0), "info": (0,0), "lists": (0,0), "set": (2, 3), "help": (0,0), "password": (...
return
continue
def IsAdministrivia(msg): lines = map(string.lower, msg.readlines()) if len(lines) > 30: return 0 # # check to see how many lines that actually have text in them there are # admin_data = {"subscribe": (0, 3), "unsubscribe": (0, 1), "who": (0,0), "info": (0,0), "lists": (0,0), "set": (2, 3), "help": (0,0), "password": (...
langs = mlist.GetAvailableLanguages() langnames = [_(Utils.GetLanguageDescr(L)) for L in langs] try: langi = langs.index(mlist.preferred_language) except ValueError: langi = 0
def GetConfigInfo(self, mlist): WIDTH = mm_cfg.TEXTFIELDWIDTH
_("Fundamental list characteristics, including descriptive" " info and basic behaviors."),
_('''Fundamental list characteristics, including descriptive info and basic behaviors.'''),
def GetConfigInfo(self, mlist): WIDTH = mm_cfg.TEXTFIELDWIDTH
('preferred_language', mm_cfg.Select, (langs, langnames, langi), 0, _('Default language for this list.'), _('''All messages not related to an specific user will be displayed in this language.''')),
def GetConfigInfo(self, mlist): WIDTH = mm_cfg.TEXTFIELDWIDTH
})
}, pluser)
def SendSubscribeAck(self, name, password, digest): if not self.send_welcome_msg: return
digmode = ' (Digest mode)'
digmode = _(" (Digest mode)")
def SendSubscribeAck(self, name, password, digest): if not self.send_welcome_msg: return
listname = string.lower(parts[0])
listname = parts[0].lower()
def main(): doc = Document() parts = Utils.GetPathPieces() if not parts: doc.AddItem(Header(2, _("Error"))) doc.AddItem(Bold(_('Invalid options to CGI script'))) print doc.Format(bgcolor="#ffffff") return listname = string.lower(parts[0]) try: mlist = MailList.MailList(listname) mlist.IsListInitialized() except Errors...
mlist.IsListInitialized()
def main(): doc = Document() parts = Utils.GetPathPieces() if not parts: doc.AddItem(Header(2, _("Error"))) doc.AddItem(Bold(_('Invalid options to CGI script'))) print doc.Format(bgcolor="#ffffff") return listname = string.lower(parts[0]) try: mlist = MailList.MailList(listname) mlist.IsListInitialized() except Errors...
doc.AddItem(Bold(_('No such list <em>%s</em>') % listname))
doc.AddItem(Bold(_('No such list <em>%(listname)s</em>')))
def main(): doc = Document() parts = Utils.GetPathPieces() if not parts: doc.AddItem(Header(2, _("Error"))) doc.AddItem(Bold(_('Invalid options to CGI script'))) print doc.Format(bgcolor="#ffffff") return listname = string.lower(parts[0]) try: mlist = MailList.MailList(listname) mlist.IsListInitialized() except Errors...
os.environ['LANG'] = mlist.preferred_language
cgidata = cgi.FieldStorage() if cgidata.has_key('language'): language = form['language'].value else: language = mlist.preferred_language i18n.set_language(language) doc.set_language(language)
def main(): doc = Document() parts = Utils.GetPathPieces() if not parts: doc.AddItem(Header(2, _("Error"))) doc.AddItem(Bold(_('Invalid options to CGI script'))) print doc.Format(bgcolor="#ffffff") return listname = string.lower(parts[0]) try: mlist = MailList.MailList(listname) mlist.IsListInitialized() except Errors...
process_form(mlist, doc)
process_form(mlist, doc, cgidata, language)
def main(): doc = Document() parts = Utils.GetPathPieces() if not parts: doc.AddItem(Header(2, _("Error"))) doc.AddItem(Bold(_('Invalid options to CGI script'))) print doc.Format(bgcolor="#ffffff") return listname = string.lower(parts[0]) try: mlist = MailList.MailList(listname) mlist.IsListInitialized() except Errors...
os.environ['PATH_INFO'] = string.join([mlist.internal_name(), member], '/')
os.environ['PATH_INFO'] = SLASH.join([mlist.internal_name(), member])
def call_script(mlist, member, which): """A hack to call one of the other CGI scripts.""" os.environ['PATH_INFO'] = string.join([mlist.internal_name(), member], '/') pkg = __import__('Mailman.Cgi', globals(), locals(), [which]) mod = getattr(pkg, which) mlist.Save() mlist.Unlock() mod.main() sys.stdout.flush() sys.stde...
def process_form(mlist, doc): form = cgi.FieldStorage()
def process_form(mlist, doc, cgidata, lang):
def process_form(mlist, doc): form = cgi.FieldStorage() error = 0 results = '' # Preliminaries done, actual processing of the form input below. if form.has_key("language"): language = form["language"].value else: language = mlist.preferred_language os.environ['LANG'] = language if form.has_key("UserOptions") or \ fo...
if form.has_key("language"): language = form["language"].value else: language = mlist.preferred_language os.environ['LANG'] = language if form.has_key("UserOptions") or \ form.has_key("info") and \ not form.has_key("email"): if not form.has_key("info"):
if cgidata.has_key('UserOptions') or \ cgidata.has_key('info') and \ not cgidata.has_key("email"): if not cgidata.has_key('info'):
def process_form(mlist, doc): form = cgi.FieldStorage() error = 0 results = '' # Preliminaries done, actual processing of the form input below. if form.has_key("language"): language = form["language"].value else: language = mlist.preferred_language os.environ['LANG'] = language if form.has_key("UserOptions") or \ fo...
addr = form['info'].value
addr = cgidata['info'].value
def process_form(mlist, doc): form = cgi.FieldStorage() error = 0 results = '' # Preliminaries done, actual processing of the form input below. if form.has_key("language"): language = form["language"].value else: language = mlist.preferred_language os.environ['LANG'] = language if form.has_key("UserOptions") or \ fo...
doc.AddItem(Bold(_("%s has no subscribed addr <i>%s</i>.") % (mlist.real_name, addr)))
doc.AddItem(Bold( _("%(realname)s has no subscribed addr <i>%(addr)s</i>.")))
def process_form(mlist, doc): form = cgi.FieldStorage() error = 0 results = '' # Preliminaries done, actual processing of the form input below. if form.has_key("language"): language = form["language"].value else: language = mlist.preferred_language os.environ['LANG'] = language if form.has_key("UserOptions") or \ fo...
if not form.has_key("email"): error = 1 results = results + _("You must supply a valid email address.<br>")
if not cgidata.has_key('email'): error = 1 results += _("You must supply a valid email address.<br>")
def process_form(mlist, doc): form = cgi.FieldStorage() error = 0 results = '' # Preliminaries done, actual processing of the form input below. if form.has_key("language"): language = form["language"].value else: language = mlist.preferred_language os.environ['LANG'] = language if form.has_key("UserOptions") or \ fo...
email = "" else: email = form["email"].value
email = '' else: email = cgidata['email'].value
def process_form(mlist, doc): form = cgi.FieldStorage() error = 0 results = '' # Preliminaries done, actual processing of the form input below. if form.has_key("language"): language = form["language"].value else: language = mlist.preferred_language os.environ['LANG'] = language if form.has_key("UserOptions") or \ fo...
results = results + _("You must not subscribe a list to itself!<br>") if not form.has_key("pw") or not form.has_key("pw-conf"): error = 1 results = (results + _("You must supply a valid password, and confirm it.<br>")) else: pw = form["pw"].value pwc = form["pw-conf"].value if not error and pw <> pwc: error = 1 resu...
results += _('You must not subscribe a list to itself!<br>') if cgidata.has_key('pw'): password = cgidata['pw'].value else: password = None if cgidata.has_key('pw-conf'): confirmed = cgidata['pw-conf'].value else: confirmed = None if password is None and confirmed is None: password = Utils.MakeRandomPassword() elif ...
def process_form(mlist, doc): form = cgi.FieldStorage() error = 0 results = '' # Preliminaries done, actual processing of the form input below. if form.has_key("language"): language = form["language"].value else: language = mlist.preferred_language os.environ['LANG'] = language if form.has_key("UserOptions") or \ fo...
digest = int(form['digest'].value)
digest = int(cgidata['digest'].value)
def process_form(mlist, doc): form = cgi.FieldStorage() error = 0 results = '' # Preliminaries done, actual processing of the form input below. if form.has_key("language"): language = form["language"].value else: language = mlist.preferred_language os.environ['LANG'] = language if form.has_key("UserOptions") or \ fo...
if digest: digesting = " digest" else: digesting = "" mlist.AddMember(email, pw, digest, remote, language)
mlist.AddMember(email, password, digest, remote, lang)
def process_form(mlist, doc): form = cgi.FieldStorage() error = 0 results = '' # Preliminaries done, actual processing of the form input below. if form.has_key("language"): language = form["language"].value else: language = mlist.preferred_language os.environ['LANG'] = language if form.has_key("UserOptions") or \ fo...
results = results + (_("Mailman won't accept the given email " "address as a valid address. (Does it " "have an @ in it???)<p>"))
results += (_("Mailman won't accept the given email " "address as a valid address. (Does it " "have an @ in it???)<p>"))
def process_form(mlist, doc): form = cgi.FieldStorage() error = 0 results = '' # Preliminaries done, actual processing of the form input below. if form.has_key("language"): language = form["language"].value else: language = mlist.preferred_language os.environ['LANG'] = language if form.has_key("UserOptions") or \ fo...
results = results + (_("The list is not fully functional, and " "can not accept subscription requests.<p>"))
results += (_("The list is not fully functional, and " "can not accept subscription requests.<p>"))
def process_form(mlist, doc): form = cgi.FieldStorage() error = 0 results = '' # Preliminaries done, actual processing of the form input below. if form.has_key("language"): language = form["language"].value else: language = mlist.preferred_language os.environ['LANG'] = language if form.has_key("UserOptions") or \ fo...
results = results + (_("Confirmation from your email address is " "required, to prevent anyone from " "subscribing you without permission. " "Instructions are being " "sent to you at %s. Please note your " "subscription will not start until you " "confirm your subscription.") % email)
results += (_("Confirmation from your email address is " "required, to prevent anyone from " "subscribing you without permission. " "Instructions are being " "sent to you at %(email)s. Please note your " "subscription will not start until you " "confirm your subscription."))
def process_form(mlist, doc): form = cgi.FieldStorage() error = 0 results = '' # Preliminaries done, actual processing of the form input below. if form.has_key("language"): language = form["language"].value else: language = mlist.preferred_language os.environ['LANG'] = language if form.has_key("UserOptions") or \ fo...
results = results + (_("Subscription was <em>deferred</em> " "because %s. Your request has been " "forwarded to the list administrator. " "You will receive email informing you " "of the moderator's decision when they " "get to your request.<p>") % x)
results += (_("Subscription was <em>deferred</em> " "because %(x)s. Your request has been " "forwarded to the list administrator. " "You will receive email informing you " "of the moderator's decision when they " "get to your request.<p>"))
def process_form(mlist, doc): form = cgi.FieldStorage() error = 0 results = '' # Preliminaries done, actual processing of the form input below. if form.has_key("language"): language = form["language"].value else: language = mlist.preferred_language os.environ['LANG'] = language if form.has_key("UserOptions") or \ fo...
results = results + (_("Your subscription is not allowed because " "the email address you gave is insecure.<p>"))
results += (_("Your subscription is not allowed because " "the email address you gave is insecure.<p>"))
def process_form(mlist, doc): form = cgi.FieldStorage() error = 0 results = '' # Preliminaries done, actual processing of the form input below. if form.has_key("language"): language = form["language"].value else: language = mlist.preferred_language os.environ['LANG'] = language if form.has_key("UserOptions") or \ fo...
results = results + _("You are already subscribed!<p>")
results += _("You are already subscribed!<p>")
def process_form(mlist, doc): form = cgi.FieldStorage() error = 0 results = '' # Preliminaries done, actual processing of the form input below. if form.has_key("language"): language = form["language"].value else: language = mlist.preferred_language os.environ['LANG'] = language if form.has_key("UserOptions") or \ fo...
results = results + \ _("No one can subscribe to the digest of this list!")
results += _("No one can subscribe to the digest of this list!")
def process_form(mlist, doc): form = cgi.FieldStorage() error = 0 results = '' # Preliminaries done, actual processing of the form input below. if form.has_key("language"): language = form["language"].value else: language = mlist.preferred_language os.environ['LANG'] = language if form.has_key("UserOptions") or \ fo...