rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
self.AddError('Subject line ignored:\n' + subject, trunc=0)
self.AddError('Subject line ignored:\n ' + subject)
def ParseMailCommands(self):
line = string.strip(lines[linecount]) if not line: continue
def ParseMailCommands(self):
line = string.strip(lines[linecount]) if not line: continue
def ParseMailCommands(self):
self.AddToResponse('\n***** End: ' + line) self.AddToResponse('\nThe rest of the message is ignored:')
self.AddToResponse('\n***** End: ' + line + '\n' 'The rest of the message is ignored:')
def ParseMailCommands(self):
self.AddToResponse('> ' + line, 0)
self.AddToResponse(line, trunc=0, prefix='> ')
def ParseMailCommands(self):
self.AddToResponse('') self.AddError('''\ Too many errors encountered; the rest of the message is ignored:''')
self.AddError('\nToo many errors encountered; ' 'the rest of the message is ignored:')
def ParseMailCommands(self):
errmsg = Utils.wrap( '''An unexpected Mailman error has occurred.
errmsg = Utils.wrap('''\ An unexpected Mailman error has occurred.
def ParseMailCommands(self):
list at %s. The traceback is attached below and will be forwarded to the list
list at <%s>. The traceback is attached below and will be forwarded to the list
def ParseMailCommands(self):
for line in string.split(errmsg, '\n'): self.AddError(line, trunc=0) self.AddError('') self.AddToResponse(tbmsg, trunc=0)
self.AddError(errmsg, trunc=0) self.AddToResponse('\n' + tbmsg, trunc=0)
def ParseMailCommands(self):
There were problems with the email commands you sent to Mailman via the administrative address %(sender)s. If you want to reach the human being that manages this mailing list, please send your message to %(admin)s. The following is a detailed description of the problems.
There were problems with the email commands you sent to Mailman via the administrative address <%(sender)s>. To obtain instructions on valid Mailman email commands, send email to <%(sender)s> with the word "help" in the subject line or in the body of the message. If you want to reach the human being that manages this...
def ParseMailCommands(self):
self.AddError("%s isn't subscribed to this list." % sender)
self.AddError("%s isn't subscribed to this list." % sender, trunc=0)
def ProcessPasswordCmd(self, args, cmd, mail):
self.AddError("Bad user - %s." % sender)
self.AddError("Bad user - %s." % sender, trunc=0)
def ProcessPasswordCmd(self, args, cmd, mail):
mail.GetSender())
mail.GetSender(), trunc=0)
def ProcessOptionsCmd(self, args, cmd, mail):
self.AddToResponse("") self.AddToResponse("To change an option, do: " "set <option> <on|off> <password>") self.AddToResponse("") self.AddToResponse("Option explanations:") self.AddToResponse("--------------------")
self.AddToResponse("\n" "To change an option, do: " "set <option> <on|off> <password>\n" "\n" "Option explanations:\n" "--------------------")
def ProcessOptionsCmd(self, args, cmd, mail):
self.AddToResponse(Utils.wrap(option_descs[option]), trunc=0) self.AddToResponse("")
self.AddToResponse(Utils.wrap(option_descs[option]) + '\n', trunc=0, prefix=" ")
def ProcessOptionsCmd(self, args, cmd, mail):
options = od.keys() options.sort() s.AddError("Usage: set <option> <on|off> <password>") s.AddError("Valid options are:")
options = od.keys() options.sort() desc_text = ""
def ShowSetUsage(s=self, od = option_descs): options = od.keys() options.sort() s.AddError("Usage: set <option> <on|off> <password>") s.AddError("Valid options are:") for option in options: s.AddError(" %8s: %s" % (option, od[option]))
s.AddError(" %8s: %s" % (option, od[option]))
desc_text = (desc_text + "%12s: %s\n" % (option, od[option])) s.AddError("Usage: set <option> <on|off> <password>\n" "Valid options are:\n" + desc_text)
def ShowSetUsage(s=self, od = option_descs): options = od.keys() options.sort() s.AddError("Usage: set <option> <on|off> <password>") s.AddError("Valid options are:") for option in options: s.AddError(" %8s: %s" % (option, od[option]))
% mail.GetSender())
% mail.GetSender(), trunc=0)
def ShowSetUsage(s=self, od = option_descs): options = od.keys() options.sort() s.AddError("Usage: set <option> <on|off> <password>") s.AddError("Valid options are:") for option in options: s.AddError(" %8s: %s" % (option, od[option]))
mail.GetSender())
mail.GetSender(), trunc=0)
def ShowSetUsage(s=self, od = option_descs): options = od.keys() options.sort() s.AddError("Usage: set <option> <on|off> <password>") s.AddError("Valid options are:") for option in options: s.AddError(" %8s: %s" % (option, od[option]))
lists = os.listdir(mm_cfg.LIST_DATA_DIR)
lists = Utils.list_names()
def ProcessListsCmd(self, args, cmd, mail):
self.AddToResponse('\trequests to: ' + listob.GetRequestEmail())
self.AddToResponse('\trequests to: ' + listob.GetRequestEmail(), trunc=0)
def ProcessListsCmd(self, args, cmd, mail):
self.AddError("To get subscribership for a particular list, "
self.AddError("Usage: who\n" "To get subscribership for a particular list, "
def ProcessWhoCmd(self, args, cmd, mail):
def AddTab(str): return '\t' + str
def AddTab(str): return '\t' + str
self.AddToResponse("") self.AddToResponse("Digest Members:")
def NotHidden(x, s=self, v=mm_cfg.ConcealSubscription): return not s.GetUserOption(x, v)
self.AddToResponse(string.join(map(AddTab,
self.AddToResponse("Digest Members:\n" + string.join(map(AddTab,
def NotHidden(x, s=self, v=mm_cfg.ConcealSubscription): return not s.GetUserOption(x, v)
self.AddToResponse("Non-Digest Members:")
def NotHidden(x, s=self, v=mm_cfg.ConcealSubscription): return not s.GetUserOption(x, v)
self.AddToResponse(string.join(map(AddTab,
self.AddToResponse("Non-Digest Members:\n" + string.join(map(AddTab,
def NotHidden(x, s=self, v=mm_cfg.ConcealSubscription): return not s.GetUserOption(x, v)
self.AddError("Must supply a password.")
self.AddError("Usage: unsubscribe <password> [<email-address>]")
def ProcessUnsubscribeCmd(self, args, cmd, mail):
self.AddError("To get unsubscribe from a particular list, " "send your request\nto the '-request' address" "for that list.")
self.AddError("Usage: unsubscribe <password> [<email-address>]\n" "To unsubscribe from a particular list, " "send your request\n" "to the '-request' address for that list.")
def ProcessUnsubscribeCmd(self, args, cmd, mail):
self.AddError("%s is not subscribed to this list." % mail.GetSender())
self.AddError("%s is not subscribed to this list." % addr, trunc=0)
def ProcessUnsubscribeCmd(self, args, cmd, mail):
password = "%s%s" % (Utils.GetRandomSeed(), Utils.GetRandomSeed())
password = Utils.MakeRandomPassword()
def ProcessSubscribeCmd(self, args, cmd, mail): """Parse subscription request and send confirmation request."""
"[digest|nodigest] [address=<email-address>]")
"[digest|nodigest] [address=<email-address>]", trunc=0)
def ProcessSubscribeCmd(self, args, cmd, mail): """Parse subscription request and send confirmation request."""
"administrator\nat %s for review.\n" % admin_email)
"administrator\n" "at %s for review." % admin_email, trunc=0)
def ProcessSubscribeCmd(self, args, cmd, mail): """Parse subscription request and send confirmation request."""
"address as a valid address. \n(Does it " "have an @ in it???)")
"address as a valid address.\n" "(Does it have an @ in it???)")
def ProcessSubscribeCmd(self, args, cmd, mail): """Parse subscription request and send confirmation request."""
"can not accept subscription requests.")
"can not accept subscription\n" "requests.")
def ProcessSubscribeCmd(self, args, cmd, mail): """Parse subscription request and send confirmation request."""
" after initial request." "\nPlease check date and number and try again,"
" after initial request.\n" "Please check date and number and try again,"
def ProcessConfirmCmd(self, args, cmd, mail): """Validate confirmation and carry out the subscription.""" if len(args) != 1: self.AddError("Usage: confirm <confirmation number>\n") return try: cookie = string.atoi(args[0]) except: self.AddError("Usage: confirm <confirmation number>\n") return try: self.ProcessConfirmat...
% expiredays)
% expiredays, trunc=0)
def ProcessConfirmCmd(self, args, cmd, mail): """Validate confirmation and carry out the subscription.""" if len(args) != 1: self.AddError("Usage: confirm <confirmation number>\n") return try: cookie = string.atoi(args[0]) except: self.AddError("Usage: confirm <confirmation number>\n") return try: self.ProcessConfirmat...
self.AddToResponse("your request has been forwarded to the list "
self.AddToResponse("Your request has been forwarded to the list "
def ProcessConfirmCmd(self, args, cmd, mail): """Validate confirmation and carry out the subscription.""" if len(args) != 1: self.AddError("Usage: confirm <confirmation number>\n") return try: cookie = string.atoi(args[0]) except: self.AddError("Usage: confirm <confirmation number>\n") return try: self.ProcessConfirmat...
self.AddError(text)
self.AddError(text, trunc=0)
def AddApprovalMsg(self, cmd): text = Utils.maketext( 'approve.txt', {'requestaddr': self.GetRequestEmail(), 'cmd' : cmd, 'adminaddr' : self.GetAdminEmail(), }) self.AddError(text)
language = form['language'].value
language = cgidata['language'].value
def main(): doc = Document() doc.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) 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 = parts[0].lower() try: mlist = MailList.MailList(listn...
self.__sendAdminBounceNotice(member, msg)
if self.bounce_notify_owner_on_disable: self.__sendAdminBounceNotice(member, msg)
def disableBouncingMember(self, member, info, msg): # Disable them syslog('bounce', '%s: %s disabling due to bounce score %s >= %s', self.internal_name(), member, info.score, self.bounce_score_threshold) self.setDeliveryStatus(member, MemberAdaptor.BYBOUNCE) self.sendNextNotification(member) self.__sendAdminBounceNotic...
self.ApprovedDeleteMember(member, 'bouncing address', admin_notif=1, userack=1)
self.ApprovedDeleteMember( member, 'bouncing address', admin_notif=self.bounce_notify_owner_on_removal, userack=1)
def sendNextNotification(self, member): info = self.getBounceInfo(member) if info is None: return if info.noticesleft <= 0: # BAW: Remove them now, with a notification message self.ApprovedDeleteMember(member, 'bouncing address', admin_notif=1, userack=1) # Expunge the pending cookie for the user. We throw away the # ...
ctype, pdict = "text/plain", {}
def __init__(self, fp=None, headers=None, outerboundary="", environ=os.environ, keep_blank_values=0, strict_parsing=0): """Constructor. Read multipart/* until last part.
self.read_single()
self.read_urlencoded()
def __init__(self, fp=None, headers=None, outerboundary="", environ=os.environ, keep_blank_values=0, strict_parsing=0): """Constructor. Read multipart/* until last part.
self.AddToResponse("<<< " + string.join(lines[linecount:], "\n<<< "))
for line in lines[linecount:]: self.AddToResponse("> " + line, trunc=0)
def ParseMailCommands(self):
'Base URL for Mailman web interface (must end in a single "/")', "This is the common root for all mailman URLs concerning this" " list. It is also used in the listinfo overview of mailing" " lists" " to identify whether or not this list resides on the virtual" " host identified by the overview URL - if this value is ...
, """This is the common root for all Mailman URLs referencing this mailing list. It is also used in the listinfo overview of mailing lists to identify whether or not this list resides on the virtual host identified by the overview URL; i.e. if this value is found (anywhere) in the URL, then this list is considered to...
def GetConfigInfo(self):
if self.private_roster:
if self.private_roster == 1:
def FormatSubscriptionMsg(self): "Tailor to approval, roster privacy, and web vetting requirements." msg = "" also = "" if self.subscribe_policy == 1: msg = msg + ("You will be sent email requesting confirmation, " "to prevent others from gratuitously subscribing " "you. ") if self.subscribe_policy == 2: msg = msg + (...
'<mm-owner>' : self.GetAdminEmail()
'<mm-owner>' : self.GetAdminEmail(), '<mm-reminder>' : self.FormatReminder(),
def GetStandardReplacements(self):
def _zapdb(filename): if os.path.exists(filename): db = bsddb.hashopen(filename, 'c') for k in db.keys(): del db[k] db.close()
def _zapdb(filename): if os.path.exists(filename): db = bsddb.hashopen(filename, 'c') for k in db.keys(): del db[k] db.close()
_zapdb(DBFILE) _zapdb(VDBFILE) def addlist(mlist, db, fp):
def _addlist(mlist, fp):
def clear(): _zapfile(TEXTFILE) _zapfile(VTEXTFILE) _zapdb(DBFILE) _zapdb(VDBFILE)
db['YP_LAST_MODIFIED'] = '%010d' % time.time() if not db.has_key('YP_MASTER_NAME'): db['YP_MASTER_NAME'] = socket.getfqdn()
def addlist(mlist, db, fp): # Set up the mailman-loop address loopaddr = Utils.ParseEmail(Utils.get_site_email(extra='loop'))[0] loopmbox = os.path.join(mm_cfg.DATA_DIR, 'owner-bounces.mbox') # Seek to the end of the text file, but if it's empty write the standard # disclaimer, and the loop catch address. fp.seek(0, 2)...
db[loopaddr + '\0'] = loopmbox + '\0'
def addlist(mlist, db, fp): # Set up the mailman-loop address loopaddr = Utils.ParseEmail(Utils.get_site_email(extra='loop'))[0] loopmbox = os.path.join(mm_cfg.DATA_DIR, 'owner-bounces.mbox') # Seek to the end of the text file, but if it's empty write the standard # disclaimer, and the loop catch address. fp.seek(0, 2)...
db[k + '\0'] = v + '\0'
def addlist(mlist, db, fp): # Set up the mailman-loop address loopaddr = Utils.ParseEmail(Utils.get_site_email(extra='loop'))[0] loopmbox = os.path.join(mm_cfg.DATA_DIR, 'owner-bounces.mbox') # Seek to the end of the text file, but if it's empty write the standard # disclaimer, and the loop catch address. fp.seek(0, 2)...
def addvirtual(mlist, db, fp):
def _addvirtual(mlist, fp):
def addvirtual(mlist, db, fp): listname = mlist.internal_name() fieldsz = len(listname) + len('request') hostname = mlist.host_name # Set up the mailman-loop address loopaddr = Utils.get_site_email(mlist.host_name, extra='loop') loopdest = Utils.ParseEmail(loopaddr)[0] # Seek to the end of the text file, but if it's em...
db[loopaddr + '\0'] = loopdest + '\0'
def addvirtual(mlist, db, fp): listname = mlist.internal_name() fieldsz = len(listname) + len('request') hostname = mlist.host_name # Set up the mailman-loop address loopaddr = Utils.get_site_email(mlist.host_name, extra='loop') loopdest = Utils.ParseEmail(loopaddr)[0] # Seek to the end of the text file, but if it's em...
db[fqdnaddr + '\0'] = k + '\0'
def addvirtual(mlist, db, fp): listname = mlist.internal_name() fieldsz = len(listname) + len('request') hostname = mlist.host_name # Set up the mailman-loop address loopaddr = Utils.get_site_email(mlist.host_name, extra='loop') loopdest = Utils.ParseEmail(loopaddr)[0] # Seek to the end of the text file, but if it's em...
def check_for_virtual_loopaddr(mlist, db, filename):
def _check_for_virtual_loopaddr(mlist, filename):
def check_for_virtual_loopaddr(mlist, db, filename): loopaddr = Utils.get_site_email(mlist.host_name, extra='loop') loopdest = Utils.ParseEmail(loopaddr)[0] # If the loop address is already in the database, we don't need to add it # to the plain text file, but if it isn't, then we do! if db.has_key(loopaddr + '\0'): # ...
if db.has_key(loopaddr + '\0'): return
def check_for_virtual_loopaddr(mlist, db, filename): loopaddr = Utils.get_site_email(mlist.host_name, extra='loop') loopdest = Utils.ParseEmail(loopaddr)[0] # If the loop address is already in the database, we don't need to add it # to the plain text file, but if it isn't, then we do! if db.has_key(loopaddr + '\0'): # ...
db[loopaddr + '\0'] = loopdest + '\0' def do_create(mlist, dbfile, textfile, func): lockfp = None try: db = bsddb.hashopen(dbfile, 'c') lockfp = open(dbfile) fcntl.flock(lockfp.fileno(), fcntl.LOCK_EX)
def _do_create(mlist, textfile, func): try: fp = open(textfile, 'r+') except IOError, e: if e.errno <> errno.ENOENT: raise omask = os.umask(007)
def check_for_virtual_loopaddr(mlist, db, filename): loopaddr = Utils.get_site_email(mlist.host_name, extra='loop') loopdest = Utils.ParseEmail(loopaddr)[0] # If the loop address is already in the database, we don't need to add it # to the plain text file, but if it isn't, then we do! if db.has_key(loopaddr + '\0'): # ...
fp = open(textfile, 'r+') except IOError, e: if e.errno <> errno.ENOENT: raise omask = os.umask(007) try: fp = open(textfile, 'w+') finally: os.umask(omask) func(mlist, db, fp)
fp = open(textfile, 'w+') finally: os.umask(omask) try: func(mlist, fp) if func is _addvirtual: _check_for_virtual_loopaddr(mlist, textfile) finally:
def do_create(mlist, dbfile, textfile, func): 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() db = bsddb.hashopen(dbfile, 'c') lockfp = open(dbfil...
if func is addvirtual: check_for_virtual_loopaddr(mlist, db, textfile) db.sync() db.close() finally: if lockfp: fcntl.flock(lockfp.fileno(), fcntl.LOCK_UN) lockfp.close()
def do_create(mlist, dbfile, textfile, func): 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() db = bsddb.hashopen(dbfile, 'c') lockfp = open(dbfil...
do_create(mlist, DBFILE, TEXTFILE, addlist)
_do_create(mlist, ALIASFILE, _addlist)
def create(mlist, cgi=0, nolock=0): # Acquire the global list database lock lock = None if not nolock: lock = makelock() lock.lock() # Do the aliases file, which need to be done in any case try: do_create(mlist, DBFILE, TEXTFILE, addlist) if mlist and mlist.host_name in mm_cfg.POSTFIX_STYLE_VIRTUAL_DOMAINS: do_create(m...
do_create(mlist, VDBFILE, VTEXTFILE, addvirtual)
_do_create(mlist, VIRTFILE, _addvirtual) _update_maps()
def create(mlist, cgi=0, nolock=0): # Acquire the global list database lock lock = None if not nolock: lock = makelock() lock.lock() # Do the aliases file, which need to be done in any case try: do_create(mlist, DBFILE, TEXTFILE, addlist) if mlist and mlist.host_name in mm_cfg.POSTFIX_STYLE_VIRTUAL_DOMAINS: do_create(m...
def do_remove(mlist, dbfile, textfile, virtualp): lockfp = None try: listname = mlist.internal_name() lockfp = open(dbfile) fcntl.flock(lockfp.fileno(), fcntl.LOCK_EX) db = bsddb.hashopen(dbfile, 'c') for k, v in makealiases(listname): try: del db[k + '\0'] except KeyError: pass if not virtualp: db['YP_LAST_MODIFIED...
def _do_remove(mlist, textfile, virtualp): listname = mlist.internal_name() outfp = None try: infp = open(textfile) except IOError, e: if e.errno <> errno.ENOENT: raise return try:
def do_remove(mlist, dbfile, textfile, virtualp): 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) fcntl.flock(lockfp.fileno(), fcntl.LOCK_EX) db = bsddb.hashope...
finally:
def do_remove(mlist, dbfile, textfile, virtualp): 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) fcntl.flock(lockfp.fileno(), fcntl.LOCK_EX) db = bsddb.hashope...
os.rename(textfile+'.tmp', textfile) finally: if lockfp: fcntl.flock(lockfp.fileno(), fcntl.LOCK_UN) lockfp.close()
os.rename(textfile+'.tmp', textfile)
def do_remove(mlist, dbfile, textfile, virtualp): 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) fcntl.flock(lockfp.fileno(), fcntl.LOCK_EX) db = bsddb.hashope...
do_remove(mlist, DBFILE, TEXTFILE, 0)
_do_remove(mlist, ALIASFILE, 0)
def remove(mlist, cgi=0): # Acquire the global list database lock lock = makelock() lock.lock() try: do_remove(mlist, DBFILE, TEXTFILE, 0) if mlist.host_name in mm_cfg.POSTFIX_STYLE_VIRTUAL_DOMAINS: do_remove(mlist, VDBFILE, VTEXTFILE, 1) finally: lock.unlock(unconditionally=1)
do_remove(mlist, VDBFILE, VTEXTFILE, 1)
_do_remove(mlist, VIRTFILE, 1) _update_maps()
def remove(mlist, cgi=0): # Acquire the global list database lock lock = makelock() lock.lock() try: do_remove(mlist, DBFILE, TEXTFILE, 0) if mlist.host_name in mm_cfg.POSTFIX_STYLE_VIRTUAL_DOMAINS: do_remove(mlist, VDBFILE, VTEXTFILE, 1) finally: lock.unlock(unconditionally=1)
userdesc.invitation = 1
userdesc.invitation = self.internal_name()
def InviteNewMember(self, userdesc, text=''): """Invite a new member to the list.
invitation = getattr(userdesc, 'invitation', 0)
invitation = getattr(userdesc, 'invitation', False)
def ProcessConfirmation(self, cookie, context=None): data = Pending.confirm(cookie) if data is None: raise Errors.MMBadConfirmation, 'data is None' try: op = data[0] data = data[1:] except ValueError: raise Errors.MMBadConfirmation, 'op-less data %s' % (data,) if op == Pending.SUBSCRIPTION: try: userdesc = data[0] # If...
if not invitation and self.subscribe_policy in (2, 3):
if invitation: if invitation <> self.internal_name(): self.SendHostileSubscriptionNotice(invitation, addr) raise Errors.HostileSubscriptionError elif self.subscribe_policy in (2, 3):
def ProcessConfirmation(self, cookie, context=None): data = Pending.confirm(cookie) if data is None: raise Errors.MMBadConfirmation, 'data is None' try: op = data[0] data = data[1:] except ValueError: raise Errors.MMBadConfirmation, 'op-less data %s' % (data,) if op == Pending.SUBSCRIPTION: try: userdesc = data[0] # If...
'confirm %(cookie)s',
'confirm %s' % cookie,
def AddMember(self, userdesc, remote=None): """Front end to member subscription.
'confirm %(cookie)s',
'confirm %s' % cookie,
def ChangeMemberAddress(self, oldaddr, newaddr, globally): # Changing a member address consists of verifying the new address, # making sure the new address isn't already a member, and optionally # going through the confirmation process. # # Most of these checks are copied from AddMember newaddr = Utils.LCDomain(newaddr...
'confirm %(cookie)s',
'confirm %s' % cookie,
def ConfirmUnsubscription(self, addr, lang=None, remote=None): if lang is None: lang = self.getMemberLanguage(addr) cookie = Pending.new(Pending.UNSUBSCRIPTION, addr) confirmurl = '%s/%s' % (self.GetScriptURL('confirm', absolute=1), cookie) realname = self.real_name if remote is not None: by = " " + remote remote = _("...
copy, lang)
lang=lang)
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...
return self._dopipeline(mlist, msg, msgdata, pipeline)
status = self._dopipeline(mlist, msg, msgdata, pipeline) if status: msgdata['pipeline'] = pipeline return status
def _dispose(self, mlist, msg, msgdata): # Try to get the list lock. try: mlist.Lock(timeout=mm_cfg.LIST_LOCK_TIMEOUT) except LockFile.TimeOutError: # Oh well, try again later return 1 # # Process the message through a handler pipeline. The handler # pipeline can actually come from one of three places: the message # m...
headers = ('from', None, 'reply-to', 'sender')
headers = mm_cfg.SENDER_HEADERS
def get_senders(self, preserve_case=0, headers=None): """Return a list of addresses representing the author of the email.
prefix_subject(mlist, msg)
prefix_subject(mlist, msg, msgdata)
def process(mlist, msg, msgdata): # Set the "X-Ack: no" header if noack flag is set. if msgdata.get('noack'): del msg['x-ack'] msg['X-Ack'] = 'no' # Because we're going to modify various important headers in the email # message, we want to save some of the information in the msgdata # dictionary for later. Specificall...
self.preferred_language = mm_cfg.DEFAULT_SERVER_LANGUAGE
def InitVars(self, name=None, admin='', crypted_password=''): """Assign default values - some will be overriden by stored state."""
('administrivia', mm_cfg.Radio, ('No', 'Yes'), 0,
('administrivia', mm_cfg.Radio, (_('No'), _('Yes')), 0,
def GetConfigInfo(self):
" 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 the " " administrator of the new request, in the proces...
" 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 the " " administrator of the new request, in the proces...
def GetConfigInfo(self):
('advertised', mm_cfg.Radio, ('No', 'Yes'), 0,
('advertised', mm_cfg.Radio, (_('No'), _('Yes')), 0,
def GetConfigInfo(self):
_("""Text prepended to the top of every immediately-delivery message. """) + Utils.maketext('headfoot.html', raw=1)),
_("""Text prepended to the top of every immediately-delivery message. """) + Utils.maketext('headfoot.html', lang=self.preferred_language, raw=1)),
def GetConfigInfo(self):
_("""Text appended to the bottom of every immediately-delivery message. """) + Utils.maketext('headfoot.html', raw=1)),
_("""Text appended to the bottom of every immediately-delivery message. """) + Utils.maketext('headfoot.html', lang=self.preferred_language, raw=1)),
def GetConfigInfo(self):
def AddMember(self, name, password, digest=0, remote=None):
def AddMember(self, name, password, digest=0, remote=None, lang=None):
def AddMember(self, name, password, digest=0, remote=None):
self.ApprovedAddMember(name, password, digest)
self.ApprovedAddMember(name, password, digest, lang)
def AddMember(self, name, password, digest=0, remote=None):
cookie = Pending().new(name, password, digest)
cookie = Pending().new(name, password, digest, lang)
def AddMember(self, name, password, digest=0, remote=None):
})
}, lang)
def AddMember(self, name, password, digest=0, remote=None):
self.HoldSubscription(name, password, digest)
self.HoldSubscription(name, password, digest, lang)
def AddMember(self, name, password, digest=0, remote=None):
(email_addr, password, digest) = got
(email_addr, password, digest, lang) = got
def ProcessConfirmation(self, cookie): from Pending import Pending got = Pending().confirmed(cookie) if not got: raise Errors.MMBadConfirmation else: (email_addr, password, digest) = got try: if self.subscribe_policy == 3: # confirm + approve self.HoldSubscription(email_addr, password, digest) raise Errors.MMNeedApprov...
self.HoldSubscription(email_addr, password, digest)
self.HoldSubscription(email_addr, password, digest, lang)
def ProcessConfirmation(self, cookie): from Pending import Pending got = Pending().confirmed(cookie) if not got: raise Errors.MMBadConfirmation else: (email_addr, password, digest) = got try: if self.subscribe_policy == 3: # confirm + approve self.HoldSubscription(email_addr, password, digest) raise Errors.MMNeedApprov...
self.ApprovedAddMember(email_addr, password, digest)
self.ApprovedAddMember(email_addr, password, digest, lang)
def ProcessConfirmation(self, cookie): from Pending import Pending got = Pending().confirmed(cookie) if not got: raise Errors.MMBadConfirmation else: (email_addr, password, digest) = got try: if self.subscribe_policy == 3: # confirm + approve self.HoldSubscription(email_addr, password, digest) raise Errors.MMNeedApprov...
ack=None, admin_notif=None):
lang=None, ack=None, admin_notif=None):
def ApprovedAddMember(self, name, password, digest, ack=None, admin_notif=None): res = self.ApprovedAddMembers([name], [password], digest, ack, admin_notif) # There should be exactly one (key, value) pair in the returned dict, # extract the possible exception value res = res.values()[0] if res is None: # User was added...
digest, ack, admin_notif)
digest, lang, ack, admin_notif)
def ApprovedAddMember(self, name, password, digest, ack=None, admin_notif=None): res = self.ApprovedAddMembers([name], [password], digest, ack, admin_notif) # There should be exactly one (key, value) pair in the returned dict, # extract the possible exception value res = res.values()[0] if res is None: # User was added...
def ApprovedAddMembers(self, names, passwords, digest,
def ApprovedAddMembers(self, names, passwords, digest, lang=None,
def ApprovedAddMembers(self, names, passwords, digest, ack=None, admin_notif=None): """Subscribe members in list `names'.
})
}, lang)
def ApprovedAddMembers(self, names, passwords, digest, ack=None, admin_notif=None): """Subscribe members in list `names'.
})
}, 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
subject = lheader(msgsubj, lcset)
subject = oneline(msgsubj, lcset)
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...
addresses = getaddresses([lheader(msg.get('from', ''), lcset)])
addresses = getaddresses([oneline(msg.get('from', ''), lcset)])
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...
wrapped = lheader(msgsubj, lcset, continuation_ws='')
wrapped = Utils.wrap('%2d. %s' % (msgcount, subject), 65)
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...