ezmlm-browse-0.10/0000775000076400007640000000000010155172250014660 5ustar bruceguenter00000000000000ezmlm-browse-0.10/NEWS0000664000076400007640000000501710155172250015362 0ustar bruceguenter00000000000000------------------------------------------------------------------------------- Changes in version 0.10 - Added support for generation of syndication feeds. - Added support for reversing the order of the "by Date" message list. - Added support for blocking or allowing for downloading raw messages. - Added CSSPREFIX configuration item, to allow for easy configuration of where CSS files are located. Thanks Roger Merchberger. - Added support for word-wrapping message bodies (defaulting to off). Idea from Roger Merchberger. Development of this version has been sponsored by FutureQuest, Inc. ossi@FutureQuest.net http://www.FutureQuest.net/ ------------------------------------------------------------------------------- Changes in version 0.9 - Two bugfixes in the handling of month numbers from "Central Linux Experts And Newbies" via Gerrit Pape. - Some HTML template bugfixes. ------------------------------------------------------------------------------- Changes in version 0.8 - Rewrote the front-end from scratch, separating content generation from the HTML templates. This means less flexability in the templates, but faster code and easier maintenance and templating. - Now has author indices, paging, more links, time zone management, style configuration, and other features I've forgotten. - The default template is marked up with CSS classes in many places, and three sample style sheets are included. ------------------------------------------------------------------------------- Changes in version 0.6 - Fixed a bug in EzmlmArchive.month. - Added new built-in functions for producing relative links in the templates: relink and cmdlink. - Rewrote the templates to merge all the common header and footer data into a single file. - Added a parse tree optimizer to the template system which removes body elements consisting of a single node. - Pre-compile all template expressions before use to speed up looped execution. ------------------------------------------------------------------------------- Changes in version 0.5 - Totally rebuild the template system, moving most of the actual page-specific code into the template pages themselves. ------------------------------------------------------------------------------- Changes in version 0.2 - Added proper targets to build the compiled Python bytecode files. - Replaced the Python main routine with a C wrapper that is suitable for installations where setuid operation is required. ------------------------------------------------------------------------------- ezmlm-browse-0.10/TODO0000664000076400007640000000155510155172250015356 0ustar bruceguenter00000000000000- Handle time zones. - Make ezmlm also return previous and next message numbers. - Figure out how to determine dates on the messages. - Parse the first Received: line or the Date: line - Make a better front-end for sites that want to have the same installation serve out multiple mailing list archives with different owners. - Improve the install and configuration documentation. - Write template documentation. - Build a proper spec file. - Seperate the generic parts of the CGI front-end into another generic library that uses the template library. - i18n ------------------------------------------------------------------------------- Ideas from other implementations: List of posts by a given author (divided by month) Author index / searching Thread tree display Downloadable attachments "raw" message view Generation of RSS feeds Language customization ezmlm-browse-0.10/html/0000755000076400007640000000000010155172250015622 5ustar bruceguenter00000000000000ezmlm-browse-0.10/html/rthread-head.html0000664000076400007640000000000410155172250021034 0ustar bruceguenter00000000000000ezmlm-browse-0.10/html/atom-tail.xml0000664000076400007640000000001010155172250020224 0ustar bruceguenter00000000000000 ezmlm-browse-0.10/html/msglist-item.html0000664000076400007640000000033610155172250021132 0ustar bruceguenter00000000000000 %(timestr)s %(cmdlink(subject, "subject", "showmsg", msgnum=msgnum))s %(cmdlink(author, "author", "author", authorid=authorid))s ezmlm-browse-0.10/html/msg-text-plain.html0000664000076400007640000000007510155172250021365 0ustar bruceguenter00000000000000
%(mask_email(markup_urls(html(wordwrap(body)))))s
ezmlm-browse-0.10/html/months-tail.html0000664000076400007640000000000010155172250020737 0ustar bruceguenter00000000000000ezmlm-browse-0.10/html/atom-item.xml0000664000076400007640000000073210155172250020244 0ustar bruceguenter00000000000000 %(html(subject))s %(html(absurl(list=list,cmd='showmsg',msgnum=msgnum)))s %(html(author))s %(isogmtime(timestamp))s %(isogmtime(timestamp))s
From: %(html(author))s

%(html(mask_email(body)))s
ezmlm-browse-0.10/html/search-sep.html0000664000076400007640000000000410155172250020536 0ustar bruceguenter00000000000000
ezmlm-browse-0.10/html/rss2-head.xml0000664000076400007640000000045410155172250020141 0ustar bruceguenter00000000000000 %(html(listdesc))s %(html(absurl(list=list)))s %(html(listdesc))s %(rfc822gmtime(timestamp))s %(version.full)s ezmlm-browse-0.10/html/lists-head.html0000664000076400007640000000006410155172250020547 0ustar bruceguenter00000000000000NameDescription ezmlm-browse-0.10/html/msgs-tail.html0000664000076400007640000000000010155172250020400 0ustar bruceguenter00000000000000ezmlm-browse-0.10/conf-cc0000664000076400007640000000013110155172250016106 0ustar bruceguenter00000000000000gcc -W -Wall -Wshadow -O -g -I/usr/local/include This will be used to compile .c files. ezmlm-browse-0.10/conf-ld0000664000076400007640000000012710155172250016125 0ustar bruceguenter00000000000000gcc -s -L/usr/local/lib This will be used to link .o and .a files into an executable. ezmlm-browse-0.10/Makefile0000664000076400007640000000645010155172250016325 0ustar bruceguenter00000000000000# Don't edit Makefile! Use conf-* for configuration. # # Generated by spac see http://untroubled.org/spac/ SHELL=/bin/sh DEFAULT: all all: programs python auto_pwd.c: echo 'const char auto_pwd[] = "'`pwd`'";' >auto_pwd.c auto_python2.c: ( set -e; PATH="/bin:/usr/bin:/usr/local/bin:$$PATH"; export PATH; \ python2=`which python2`; \ echo 'const char auto_python2[] = "'$$python2'";' ) >auto_python2.c clean: TARGETS rm -f `cat TARGETS` clean-spac: clean AUTOFILES rm -f `cat AUTOFILES` commands/author.pyc: commands/author.py python -c '__import__("commands/author")' commands/configure.pyc: commands/configure.py python -c '__import__("commands/configure")' commands/feed.pyc: commands/feed.py python -c '__import__("commands/feed")' commands/lists.pyc: commands/lists.py python -c '__import__("commands/lists")' commands/monthbydate.pyc: commands/monthbydate.py python -c '__import__("commands/monthbydate")' commands/monthbythread.pyc: commands/monthbythread.py python -c '__import__("commands/monthbythread")' commands/months.pyc: commands/months.py python -c '__import__("commands/months")' commands/search.pyc: commands/search.py python -c '__import__("commands/search")' commands/showmsg.pyc: commands/showmsg.py python -c '__import__("commands/showmsg")' commands/showthread.pyc: commands/showthread.py python -c '__import__("commands/showthread")' commands/threadindex.pyc: commands/threadindex.py python -c '__import__("commands/threadindex")' compile: conf-cc conf-bgincs ( bgincs=`head -n 1 conf-bgincs`; \ echo '#!/bin/sh'; \ echo 'source=$$1; shift'; \ echo 'base=`echo "$$source" | sed -e s:\\\\.c$$::`'; \ echo exec `head -n 1 conf-cc` -I. "-I'$${bgincs}'" '-o $${base}.o -c $$source $${1+"$$@"}'; \ ) >compile chmod 755 compile config.pyc: config.py python -c '__import__("config")' context.pyc: context.py python -c '__import__("context")' ezmlm.pyc: ezmlm.py python -c '__import__("ezmlm")' feedgen.pyc: feedgen.py python -c '__import__("feedgen")' globalfns.pyc: globalfns.py python -c '__import__("globalfns")' globals.pyc: globals.py python -c '__import__("globals")' load: conf-ld conf-bglibs ( bglibs=`head -n 1 conf-bglibs`; \ echo '#!/bin/sh';\ echo 'main="$$1"; shift';\ echo exec `head -n 1 conf-ld` -L. "-L'$${bglibs}'" '-o "$$main" "$$main.o" $${1+"$$@"}' -lbg-sysdeps; \ ) >load chmod 755 load main.pyc: main.py python -c '__import__("main")' makedist.pyc: makedist.py python -c '__import__("makedist")' programs: wrapper python: config.pyc ezmlm.pyc globalfns.pyc main.pyc context.pyc makedist.pyc globals.pyc timezones.pyc feedgen.pyc version.pyc commands/lists.pyc commands/months.pyc commands/monthbythread.pyc commands/configure.pyc commands/feed.pyc commands/threadindex.pyc commands/showmsg.pyc commands/author.pyc commands/search.pyc commands/showthread.pyc commands/monthbydate.pyc version.pyc timezones.pyc: timezones.py python -c '__import__("timezones")' version.py: VERSION ( \ echo program = \"`head -n 1 VERSION | cut -d' ' -f1`\"; \ echo version = \"`head -n 1 VERSION | cut -d' ' -f2`\"; \ echo full = \"`head -n 1 VERSION`\"; \ ) >$@ version.pyc: version.py python -c '__import__("version")' wrapper: load wrapper.o ./load wrapper wrapper.o: compile wrapper.c auto_pwd.c auto_python2.c ./compile wrapper.c ezmlm-browse-0.10/FILES0000664000076400007640000000247610155172250015456 0ustar bruceguenter00000000000000ANNOUNCEMENT AUTOFILES COPYING FILES Makefile NEWS README SRCFILES TARGETS TODO VERSION browse.css commands/author.py commands/configure.py commands/feed.py commands/lists.py commands/monthbydate.py commands/monthbythread.py commands/months.py commands/search.py commands/showmsg.py commands/showthread.py commands/threadindex.py conf-bgincs conf-bglibs conf-cc conf-ld config.py context.py ezmlm.py feedgen.py globalfns.py globals.py greenterm.css html/atom-head.xml html/atom-item.xml html/atom-tail.xml html/configure-form.html html/error.html html/footer.html html/header.html html/lists-head.html html/lists-item.html html/lists-tail.html html/menubar.html html/months-head.html html/months-item.html html/months-tail.html html/msg-footer.html html/msg-header.html html/msg-other.html html/msg-pager.html html/msg-sep.html html/msg-text-html.html html/msg-text-plain.html html/msglist-head.html html/msglist-item.html html/msglist-tail.html html/msgs-head.html html/msgs-item.html html/msgs-tail.html html/pager.html html/rss2-head.xml html/rss2-item.xml html/rss2-tail.xml html/rthread-head.html html/rthread-item.html html/rthread-tail.html html/search-form.html html/search-sep.html html/syserror.html html/threadlist-head.html html/threadlist-item.html html/threadlist-tail.html main.py makedist.py purple.css timezones.py wrapper.c ezmlm-browse-0.10/browse.css0000664000076400007640000000274310155172250016701 0ustar bruceguenter00000000000000BODY { background: #efeff7; color: #000000; } H1 { background: #314a63; color: #ffffff; margin-top: 0px; margin-bottom: 0px; } HR { display: none; } TH { background: #adbbd8; } .versioninfo { font-size: small; } .evenrow { background: #dadfef; } .oddrow { background: #c6d0e7; } .author { } .listdesc { } .listlink { } .month { text-align: right; } .msgcount { font-family: monospace; text-align: center; } .msgsitem { border-style: groove; } .msgslink { } .note { } .subject { } .threaditem { border-width: thin; } .threadslink { } .timestamp { } .year { text-align: left; } /* Parts of the pager */ .pager { background: #8598bf; text-align: center; } .pager-first { } .pager-prev { } .pager-curr { } .pager-next { } .pager-last { } /* Parts of the message menu */ .msgmenu { background: #8598bf; width: 100%; } .msgmenu-prevbydate { } .msgmenu-nextbydate { } .msgmenu-prevbythread { } .msgmenu-nextbythread { } .msgmenu-label { text-align: right; white-space: nowrap; } .msgmenu-value { text-align: left; width: 99%; } /* Parts of the menu bar */ .menubar { background: #adbbd8; } .menu-lists { } .menu-config { } .menu-first { } .menu-prev { } .menu-bythread { } .menu-bydate { } .menu-next { } .menu-last { } .menu-months { } .menu-search { } .menu-subscribe { } /* Configuration table */ .config { } .config-label { text-align: right; } .config-value { text-align: left; } /* The list table classes */ .lists { } .months { border: 0px; } .msglist { } .msgs { width: 100%; } .threadlist { } ezmlm-browse-0.10/README0000664000076400007640000000466410155172250015552 0ustar bruceguenter00000000000000ezmlm-browse Web browser for ezmlm-idx archives Bruce Guenter Version 0.10 2004-12-06 This is ezmlm-browse, a web interface for browsing ezmlm-idx (version 0.40 or later) archives. The presentation is modeled from that of the ezmlm-cgi archive browser that is part of ezmlm-idx, but with several additions. However, the output is completely template drive, so you can make it fit into your current web scheme. A mailing list has been set up to discuss this and other packages. To subscribe, send an email to: bgware-subscribe@lists.untroubled.org A mailing list archive is available at: http://lists.untroubled.org/?list=bgware Development versions of ezmlm-browse are available via Subversion at: svn://bruce-guenter.dyndns.org/ezmlm-browse/trunk Requirements: - Python 2 (tested with 2.3, should work with version 2.2 or later) - ezmlm 0.53 + idx 0.40 or later. If you are using an older version of ezmlm-idx, you MUST upgrade and run the "ezmlm-idx" command on all lists you wish to browse. Installation: - Unpack ezmlm-browse into a non-web-visible directory. This is the directory from which ezmlm-browse will execute. - Run "make" to build "wrapper" and precompile the Python bytecode. - Either copy the "wrapper" program or symlink the "index.cgi" script into your web tree as a CGI. - If necessary, make the wrapper setuid to whatever user owns the mailing list archive files. - Copy the .css files into a web-visible directory. Configuration: - Edit config.py to declare which mailing lists are visible to the web, and set the other defaults as appropriate (most notably, the path to the CSS files). Security Notes: - You will need to choose one of the following options: - Make your mailing list archives readable to the UID that the web server operates under. This will likely allow anybody on your system to read the contents of the mailing lists, including the unfiltered header lines (which include full email addresses, etc.) - Make the wrapper CGI program owned by the mailing list archive owner and setuid. If I have not been adequately careful, this may allow an attacker to execute code as that user. - Use the Apache su-exec module. This program is Copyright(C) 2004 Bruce Guenter, and may be copied according to the GNU GENERAL PUBLIC LICENSE (GPL) Version 2 or a later version. A copy of this license is included with this package. This package comes with no warranty of any kind. ezmlm-browse-0.10/TARGETS0000664000076400007640000000072210155172250015715 0ustar bruceguenter00000000000000all auto_pwd.c auto_python2.c clean clean-spac commands/author.pyc commands/configure.pyc commands/feed.pyc commands/lists.pyc commands/monthbydate.pyc commands/monthbythread.pyc commands/months.pyc commands/search.pyc commands/showmsg.pyc commands/showthread.pyc commands/threadindex.pyc compile config.pyc context.pyc ezmlm.pyc feedgen.pyc globalfns.pyc globals.pyc load main.pyc makedist.pyc programs python timezones.pyc version.py version.pyc wrapper wrapper.o ezmlm-browse-0.10/config.py0000664000076400007640000000536410155172250016507 0ustar bruceguenter00000000000000from globals import * # Set this to non-zero to allow the raw message bodies to be downloaded, # complete with all attachments and email addresses intact. allowraw = 0 # Values are looked up in the following order: # 1. CGI environment variables # 2. Hard-coded defaults # 3. Configured defaults (below) # 4. Cookies # 5. Form/URL items # 6. List configuration (below) # Values set later in the list override earlier values. styles = ( 'None', ('browse.css', 'Default'), ('purple.css', 'Purple'), ('greenterm.css', 'Terminal'), ) # The following list itemizes default values. Most of these can be # omitted if desired. defaults = { # The default style sheet. STYLE: 'browse.css', # The number of items per page. PERPAGE: 20, # The number of messages per page. MSGSPERPAGE: 10, # The default stylesheet prefix. Note: The stylesheets cannot reside # in your cgi-bin directory, they must be placed your normal htdocs # directory. If the stylesheets are placed in your root htdocs dir, # CSSPREFIX should be '/'. If you specify a subdirectory, make sure # you place the trailing '/' (slash) character. CSSPREFIX: '', # The default maximum line length to allow when doing word wrapping. WRAPWIDTH: 0, # The default type of syndication feed to produce. # This may be set to 'atom', 'rss2', or 'rss' (an alias for 'rss2'). FEEDTYPE: 'atom', # The number of messages to put into a feed. FEEDMSGS: 10, # The order in which messages are normally sorted. # 'ascending' means oldest to newest # 'descending' means newest to oldest DATESORT: 'ascending', } # The base directory under which all of the mailing lists can be found. basedir = '/home/bruce/lists' # The base hostname for mailing list and subscribe addresses. basehost = 'lists.untroubled.org' # For each mailing list you want to have visible to the web, add an # entry to this table. Each entry consists of a dictionary # containing: # # LISTDESC: The description to show for this list when producing the index # LISTDIR: The directory in which the "archive" directory can be found. # LISTEMAIL: The email address to use to send messages to the list. # LISTSUB: The email address to use to subscribe to the list. # # If they are not present, the LISTDIR, LISTEMAIL, and LISTSUB values # are automatically generated from the list name and the base directory # or host above. # # This is the place to override any of the defaults above. # Note that any setting you put here will override any cookie or URL/form # value as well. archives = { 'bgware': { LISTDESC: 'Software by Bruce Guenter' }, 'vmailmgr': { LISTDESC: 'VMailMgr announcements, development, and users' }, 'nullmailer': { LISTDESC: 'The NullMailer MTA' }, 'rpms': { LISTDESC: 'RPMs Built by Bruce Guenter' }, 'test-idx': { LISTDESC: 'Test list' }, } ezmlm-browse-0.10/purple.css0000664000076400007640000000300010155172250016672 0ustar bruceguenter00000000000000BODY { background: #dedede; color: #000000; } H1 { background: #44385c; color: #ffffff; margin-top: 0px; margin-bottom: 0px; } HR { display: none; } TH { background: #9189a0; } .versioninfo { font-size: small; } .evenrow { background: #c8c2d3; } .oddrow { background: #a9a3b4; } .author { } .listdesc { } .listlink { } .month { text-align: right; } .msgcount { font-family: monospace; text-align: center; } .msgsitem { border-style: groove; } .msgslink { } .note { } .subject { } .threaditem { border-width: thin; } .threadslink { } .timestamp { } .year { text-align: left; } .msg HR { display: block; } /* Parts of the pager */ .pager { background: #6d667c; text-align: center; } .pager-first { } .pager-prev { } .pager-curr { } .pager-next { } .pager-last { } /* Parts of the message menu */ .msgmenu { background: #9189a0; width: 100%; } .msgmenu-prevbydate { } .msgmenu-nextbydate { } .msgmenu-prevbythread { } .msgmenu-nextbythread { } .msgmenu-label { text-align: right; white-space: nowrap; } .msgmenu-value { text-align: left; width: 99%; } /* Parts of the menu bar */ .menubar { background: #6d667c; } .menu-lists { } .menu-config { } .menu-first { } .menu-prev { } .menu-bythread { } .menu-bydate { } .menu-next { } .menu-last { } .menu-months { } .menu-search { } .menu-subscribe { } /* Configuration table */ .config { } .config-label { text-align: right; } .config-value { text-align: left; } /* The list table classes */ .lists { } .months { border: 0px; } .msglist { } .msgs { width: 100%; } .threadlist { } ezmlm-browse-0.10/ezmlm.py0000664000076400007640000002144310155172250016362 0ustar bruceguenter00000000000000import email import operator import os import re import rfc822 import string import time from globals import * _rx_author = re.compile(r'^(\S+) (.+)$') _rx_thread = re.compile(r'^(\d+):(\S+) \[(\d+)\] (.+)$') _rx_subject = re.compile(r'^(\S+) (.+)$') _rx_message = re.compile(r'^(\d+):(\d+):(\S+) (.+)$') _rx_references = re.compile(r'\nReferences:[^\n]+(\n\s[^\n]+)*\n', re.IGNORECASE) _rx_inreplyto = re.compile(r'\nIn-Reply-To:\s*<([^>]+)>', re.IGNORECASE) _rx_endofhdr = re.compile(r'^\s*$') _rx_messageid = re.compile(r'\nMessage-ID:\s*<([^>]+)>', re.IGNORECASE) _rx_id = re.compile(r'<([^>]+)>') _rx_ws = re.compile(r'\s+') _rx_header = re.compile(r'^(\S+):\s*(.*)$') _rx_index1 = re.compile(r'^(\d+): (\S{20}) (.*)$') _rx_index2 = re.compile(r'^\s*([^;]+);(\S{20})\s?(.*)$') def _in(a, min, max): if a > max: return max if a < min: return min return a month_names = { 1: 'January', 2: 'February', 3: 'March', 4: 'April', 5: 'May', 6: 'June', 7: 'July', 8: 'August', 9: 'September', 10: 'October', 11: 'November', 12: 'December' } def _parse_references(str): list = [ ] match = _rx_id.search(str) while match: list.append(match.group(1)) match = _rx_id.search(str, match.end()) return list #def _thread_message(id, idmap, nummap, irtmap, replymap, refmap): def _thread_message(id, idmap, nummap, replymap): # result: {replies} #try: irt = nummap[irtmap[id]] #except KeyError: irt = None replies = { } for i in replymap[id]: num = nummap[i] replies[num] = _thread_message(i, idmap, nummap, replymap) idmap[num] = None #references = [ ] #if refmap[id]: # for i in refmap[id]: # if i <> irtmap[id] and nummap.has_key(i): # references.append(nummap[i]) #followups = [ ] #for i in replymap[id]: # if not replymap.has_key(i): # followups.append(nummap[i]) #return (irt, replies, references, followups) return replies def _process_thread(thread, map): list = [ ] nums = thread.keys() nums.sort() for num in nums: msg = map[num] msg['threads'] = _process_thread(thread[num], map) list.append(msg) return list class EzmlmIndex: def __init__(self, listdir): self.archdir = os.path.join(listdir, 'archive') self.msgs = { } def __getitem__(self, key): key = int(key) try: return self.msgs[key] except KeyError: self.populate(key/100) return self.msgs[key] def populate(self, sub): file = open(os.path.join(self.archdir, str(sub), 'index')) l1 = file.readline() l2 = file.readline() while l1 and l2: l1 = _rx_index1.match(l1.rstrip()) l2 = _rx_index2.match(l2.rstrip()) if l1 and l2: g1 = l1.groups() g2 = l2.groups() msgnum = int(g1[0]) timestamp = rfc822.mktime_tz(rfc822.parsedate_tz(g2[0])) localtime = time.localtime(timestamp) self.msgs[msgnum] = { MSGNUM: msgnum, THREADID: g1[1], SUBJECT: g1[2], DATE: g2[0], TIMESTAMP: timestamp, AUTHORID: g2[1], AUTHOR: g2[2], MONTH: localtime[0] * 100 + localtime[1], } l1 = file.readline() l2 = file.readline() file.close() class EzmlmArchive: def __init__(self, listdir): self.headermax = 4096 self.listdir = listdir self.archdir = os.path.join(listdir, 'archive') self.months = map(int, os.listdir(os.path.join(self.archdir, 'threads'))) self.months.sort() self.months.reverse() self.index = EzmlmIndex(listdir) try: prefix = open(os.path.join(listdir, 'prefix')).readline() except IOError: prefix = '' self.prefix = prefix.strip() try: num = open(os.path.join(listdir, 'num')).readline() except IOError: num = '0:0' num = map(int, num.split(':')) self.num = num[0] self.kb = num[1] / 4 def make_reply_subject(self, subject): if self.prefix: try: i = subject.index(self.prefix) subject = subject[i + len(self.prefix):].strip() except ValueError: pass while subject[:3].lower() == 're:': subject = subject[3:].strip() return 'Re: ' + subject def set_months(self, form): if not form.has_key(MONTH): firstmonth = prevmonth = month = nextmonth = lastmonth = int(self.months[0]) else: firstmonth = int(self.months[-1]) lastmonth = int(self.months[0]) month = int(form[MONTH]) if month > lastmonth or month < firstmonth: raise ValueError, "Month value is out of range." if month >= lastmonth: nextmonth = lastmonth else: nextmonth = self.months[self.months.index(month)-1] if month <= firstmonth: prevmonth = firstmonth else: prevmonth = self.months[self.months.index(month)+1] form[FIRSTMONTH] = firstmonth form[PREVMONTH] = prevmonth form[MONTH] = month form[NEXTMONTH] = nextmonth form[LASTMONTH] = lastmonth def open(self, num): num = '%03d' % int(num) return open(os.path.join(self.archdir, num[:-2], num[-2:])) def month(self, month): messages = { } for thread in self.threads(month): tid = thread[THREADID] thread = self.thread(tid) subject = thread[SUBJECT] for message in thread[MESSAGES]: if message[MONTH] == month: n = message[MSGNUM] message.update(self.index[n]) messages[n] = message numbers = messages.keys() numbers.sort() return map(operator.getitem, [messages]*len(numbers), numbers) def thread(self, threadid): if '.' in threadid or '/' in threadid: raise ValueError, "Thread ID contains invalid characters" path = os.path.join(self.archdir, 'subjects', threadid[:2], threadid[2:]) lines = map(string.strip, open(path).readlines()) subject = _rx_subject.match(lines[0]).group(2) list = [ ] for line in lines[1:]: match = _rx_message.match(line) if match: groups = match.groups() n = int(groups[0]) m = self.index[int(groups[0])] m[MONTH] = int(groups[1]) list.append(m) return { SUBJECT: subject, THREADID: threadid, MESSAGES: list } def threads(self, month): list = [ ] path = os.path.join(self.archdir, 'threads', str(month)) for line in open(path).readlines(): match = _rx_thread.match(line.strip()) if match: groups = match.groups() list.append({ MSGNUM: int(groups[0]), THREADID: groups[1], MSGCOUNT: int(groups[2]), SUBJECT: groups[3] }) return list def search(self, terms): terms = _rx_ws.split(terms) terms = map(string.lower, terms) dir = os.path.join(self.archdir, 'threads') threads = [ ] for month in self.months: month = str(month) for line in open(os.path.join(dir, month)).readlines(): line = line.strip() match = _rx_thread.match(line) if match: groups = match.groups() subject = groups[3].lower() for term in terms: if subject.find(term) < 0: subject = ''; break if not subject: continue groups = match.groups() m = self.index[int(groups[0])] m[MSGCOUNT] = int(groups[2]) m[MONTH] = int(month) threads.append(m) return threads def _parse_message(self, num): # Result: message-id, in-reply-to, references headers = self.open(num).read(self.headermax) eoh = _rx_endofhdr.search(headers) if eoh: headers = headers[:eoh.start()] messageid = _rx_messageid.search(headers) if messageid: messageid = messageid.group(1) inreplyto = _rx_inreplyto.search(headers) if inreplyto: inreplyto = inreplyto.group(1) refs = _rx_references.search(headers) if refs: refs = _parse_references(refs.group(0)) return (messageid, inreplyto, refs) def thread_messages(self, messages): messageids = { } messagenums = { } replies = { } inreplytos = { } references = { } for message in messages: msgnum = message[MSGNUM] ( messageid,inreplyto,refs ) = self._parse_message(msgnum) messageids[msgnum] = messageid messagenums[messageid] = msgnum replies[messageid] = [ ] references[messageid] = refs if refs and not inreplyto: inreplyto = refs[-1] if inreplyto: if replies.has_key(inreplyto): replies[inreplyto].append(messageid) inreplytos[messageid] = inreplyto #print 'messageids:', messageids #print 'messagenums:', messagenums #print 'replies:', replies #print 'references:', references num2msg = { } for message in messages: num2msg[message[MSGNUM]] = message list = { } for message in messages: msgnum = message[MSGNUM] if messageids[msgnum] is not None: tmp = _thread_message(messageids[msgnum], messageids, messagenums, replies) #inreplytos, replies, references) list[msgnum] = tmp return _process_thread(list, num2msg) def author(self, authorid): path = os.path.join(self.archdir, 'authors', authorid[:2], authorid[2:]) file = open(path) header = file.readline().strip() name = None m = _rx_author.match(header) if m: name = m.group(2) msgs = [ ] file = file.readlines() file.reverse() for line in file: m = _rx_message.match(line.strip()) if m: groups = m.groups() m = self.index[int(groups[0])] m[MONTH] = int(groups[1]) msgs.append(m) return { AUTHORID: authorid, AUTHOR: name, MESSAGES: msgs } ezmlm-browse-0.10/globalfns.py0000664000076400007640000001317410155172250017207 0ustar bruceguenter00000000000000import email import os import re import sys import time from globals import * write = sys.stdout.write ############################################################################### # Template fetching _template_cache = { } _template_path = sys.path[:2] _rx_percent = re.compile('%([^(])') def template(filename): global _template_cache global _template_path try: f = _template_cache[filename] except KeyError: n = os.path.join('html', filename.replace('/', ':')) f = '' for dir in _template_path: try: f = open(os.path.join(dir, n)).read() break except IOError: pass _template_cache[filename] = f return f def html(name): return template(name + '.html') def xml(name): return template(name + '.xml') ############################################################################### def _build_base(): try: base = os.environ['SCRIPT_URI'] except KeyError: port = int(os.environ['SERVER_PORT']) script = os.environ['SCRIPT_NAME'] if port == 443: base = 'https://' else: base = 'http://' base += os.environ['SERVER_NAME'] if port <> 443 and port <> 80: base += ':%d' % port base += script return base def _make_menubar(ctxt): if not ctxt[LIST]: return '' if ctxt[COMMAND] == 'monthbydate': ctxt['idxcmd'] = 'monthbydate' else: ctxt['idxcmd'] = 'monthbythread' return html('menubar') % ctxt ############################################################################### def header(ctxt, title, classbase): write('Content-Type: text/html\r\n\r\n') ctxt[BASE] = _build_base() ctxt[TITLE] = title ctxt[CLASS] = classbase if ctxt.has_key(LIST): ctxt[MENUBAR] = _make_menubar(ctxt) else: ctxt[MENUBAR] = '' write(html('header') % ctxt) def footer(ctxt): write(html('footer') % ctxt) #print "" sys.exit(0) ############################################################################### def die(ctxt, msg): ctxt['message'] = msg header(ctxt, 'Error', 'error') write(html('error') % ctxt) footer(ctxt) def diesys(ctxt, a, b): ctxt['message'] = a ctxt['error'] = b header(ctxt, 'System Error', 'error') write(html('syserror') % ctxt) footer(ctxt) ############################################################################### # Output commands def do_list(ctxt, name, perpage, values, peritem=None): perpage = int(perpage) ctxt.push() ctxt[ROW] = 0 write('' % name) if perpage > 0: page = int(ctxt.get(PAGE, 1)) - 1 pages = (len(values) + perpage - 1) / perpage page = max(0, min(pages, page)) start = page * perpage ctxt[PAGE] = page + 1 ctxt[PAGES] = pages write(html('pager') % ctxt) values = values[start:start+perpage] write(html(name+'-head') % ctxt) template = html(name+'-item') for value in values: ctxt.update(value) write(template % ctxt) if peritem: peritem() ctxt[ROW] += 1 write(html(name+'-tail') % ctxt) if perpage > 0: write(html('pager') % ctxt) write('
') ctxt.pop() ############################################################################### # Subcommands ############################################################################### def rec_thread(ctxt): ctxt.push() write(html('rthread-head') % ctxt) item = html('rthread-item') format_timestamps(ctxt, ctxt[THREADS]) for t in ctxt[THREADS]: ctxt.update(t) write(item % ctxt) rec_thread(ctxt) write(html('rthread-tail') % ctxt) ctxt.pop() def sub_showpart(ctxt, part): ctxt[BODY] = part.get_payload(decode=1) type = ctxt[TYPE] = part.get_type('text/plain') ctxt[FILENAME] = part.get_filename() template = html('msg-' + type.replace('/', '-')) if not template: template = html('msg-other') write(template % ctxt) def rec_noshowpart(ctxt, part, partnum): ctxt[PART] = partnum ctxt[TYPE] = part.get_type('text/plain') # FIXME: show something here if part.is_multipart(): for p in part.get_payload(): partnum = rec_noshowpart(ctxt, p, partnum+1) else: return partnum + 1 return partnum def rec_showpart(ctxt, part, partnum): ctxt[PART] = partnum ctxt[TYPE] = part.get_type('text/plain') if part.is_multipart(): # handle alternative parts differently if part.get_subtype() == 'alternative': m = { } for p in part.get_payload(): m[p.get_type('text/plain')] = p try: altpart = m[ctxt[ALTPART]] except KeyError: try: altpart = m['text/plain'] except KeyError: altpart = part.get_payload()[0] for p in part.get_payload(): if p is altpart: partnum = rec_showpart(ctxt, p, partnum+1) else: partnum = rec_noshowpart(ctxt, p, partnum+1) else: for p in part.get_payload(): partnum = rec_showpart(ctxt, p, partnum+1) else: write(html('msg-sep') % ctxt) sub_showpart(ctxt, part) return partnum + 1 return partnum def sub_showmsg(ctxt, msgnum): ezmlm = ctxt[EZMLM] ctxt.push() ctxt.update(ezmlm.index[msgnum]) msg = email.message_from_file(ezmlm.open(msgnum)) ctxt[MESSAGE] = msg format_timestamp(ctxt, ctxt) write(html('msg-header') % ctxt) rec_showpart(ctxt, msg, 0) write(html('msg-footer') % ctxt) ctxt.pop() def format_timestamp(ctxt, msg): if ctxt[TZ] and ctxt[TZ] <> 'None' and \ ctxt[FORMATTIME] and ctxt[FORMATTIME] <> 'None': msg[TIMESTR] = time.strftime(ctxt[FORMATTIME], time.localtime(msg[TIMESTAMP])) else: msg[TIMESTR] = ctxt[DATE] return msg[TIMESTR] def format_timestamps(ctxt, list): if ctxt[TZ] and ctxt[TZ] <> 'None' and \ ctxt[FORMATTIME] and ctxt[FORMATTIME] <> 'None': format = ctxt[FORMATTIME] for item in list: item[TIMESTR] = time.strftime(format, time.localtime(item[TIMESTAMP])) else: for item in list: item[TIMESTR] = item[DATE] return list ezmlm-browse-0.10/main.py0000664000076400007640000002206210155172250016160 0ustar bruceguenter00000000000000import cgitb cgitb.enable() import cgi import email import os import re import sys import time import types import Cookie import ezmlm from globals import * from globalfns import * import context import config ctxt = None form = None ############################################################################### # Fixup configuration values def fixup_config(): for name in config.archives.keys(): l = config.archives[name] if l.has_key(LISTDIR): l[LISTDIR] = os.path.join(config.basedir, l[LISTDIR]) else: l[LISTDIR] = os.path.join(config.basedir, name) if not l.has_key(LISTEMAIL): l[LISTEMAIL] = '%s@%s' % (name, config.basehost) if not l.has_key(LISTSUB): l[LISTSUB] = '%s-subscribe@%s' % (name, config.basehost) ############################################################################### # Context functions def iif(cond, truestr, falsestr=''): global ctxt if cond: return truestr % ctxt return falsestr % ctxt def defined(name): global ctxt return ctxt.has_key(name) def escape(str, escapes): for (needle, replacement) in escapes: str = str.replace(needle, replacement) return str _html_escapes = ( ('&', '&'), ('<', '<'), ('>', '>'), ('"', '"') ) def escape_html(str): return escape(str, _html_escapes) _url_escapes = ( ('%', '%25'), (' ', '%20'), ('&', '%26'), ('?', '%3f'), (':', '%3a'), (';', '%3b'), ('+', '%2b') ) def escape_url(str): return escape(str, _url_escapes) def nl2br(str): return str.replace('\n', '
') rx_url = re.compile(r'([^\s\"]+://[^\s\"]+)') def markup_urls(str): return rx_url.sub(r'\1', str) #rx_addr = re.compile(r'<[^>@]+@[^>]+>') rx_addr = re.compile(r'\S+@\S+\.\S+') def mask_email(str): return rx_addr.sub('####@####.####', str) def wordwrap(str): try: width = int(ctxt.get(WRAPWIDTH, 0)) except: return str if not width: return str out = [] for line in str.split('\n'): while len(line) > width: # Try to break the line on the first space before the width. space = line.rfind(' ', 0, width) if space == -1: # None found, now fall back to the first space on the line. space = line.find(' ') if space == -1: # No spaces found, no word-wrapping can be done. break # If the remainder of the line is empty, don't do anything. nextline = line[space+1:].lstrip() if not nextline: break out.append(line[:space]) line = nextline out.append(line) return '\n'.join(out) def relurl(**kw): # Put certain keywords in a fixed order pre = [] for key in (LIST, COMMAND): try: pre.append((key,kw[key])) del kw[key] except KeyError: pass kw = kw.items() kw.sort() kw = pre + kw kw = map(lambda val:"%s=%s"%(val[0],escape_url(str(val[1]))), kw) return '?%s' % ('&'.join(kw)) def absurl(**kw): global ctxt return ''.join(('http://', ctxt['SERVER_NAME'], ctxt['SCRIPT_NAME'], apply(relurl, (), kw))) def relink(text, classname, **kw): return '%s' % ( classname, apply(relurl, (), kw), text) def cmdlink(text, classname, command, **kw): global ctxt kw[COMMAND] = command kw[LIST] = ctxt[LIST] return apply(relink, (text, classname), kw) def optlink(text, classname, dolink, command, **kw): if dolink: return apply(cmdlink, (text, classname, command), kw) else: return '%s' % (classname, text) def pagelink(text, classname, index): global ctxt index = max(1, min(ctxt[PAGES], index)) if index == ctxt[PAGE]: return '%s' % (classname, text) kw = form.copy() kw[PAGE] = index return apply(relink, (text, classname), kw) def msgsubjlink(msg, **kw): global ctxt if type(msg) is types.IntType: kw[MSGNUM] = msg msg = ctxt[EZMLM].index[msg] else: kw[MSGNUM] = msg[MSGNUM] return apply(cmdlink, (msg[SUBJECT], 'subject', 'showmsg'), kw) def msgauthlink(msg, **kw): global ctxt if type(msg) is types.IntType: msg = ctxt[EZMLM].index[msg] kw[AUTHORID] = msg[AUTHORID] return apply(cmdlink, (msg[AUTHOR], 'author', 'author'), kw) def threadlink(text, classname, index): global ctxt index = max(1, min(ctxt['threadlen'], index)) if index == ctxt[PAGE]: return '%s' % (classname, text) kw = form.copy() kw[MSGNUM] = ctxt[MESSAGES][index-1][MSGNUM] return apply(relink, (text, classname), kw) def selectlist(name, list, value=None, options=''): s = ['') return '\n'.join(s) def monthname(number): if number >= 100000: number %= 100 return ezmlm.month_names[number] def isogmtime(ts): return time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime(float(ts))) def rfc822gmtime(ts): return time.strftime('%a, %d %b %Y %H:%M:%S GMT', time.gmtime(float(ts))) def update_global_context(): context.global_context.update({ 'absurl': absurl, 'cmdlink': cmdlink, 'config': config, 'defined': defined, 'format_timestamp': lambda msg:format_timestamp(ctxt, msg), 'iif': iif, 'isogmtime': isogmtime, 'html': escape_html, 'markup_urls': markup_urls, 'mask_email': mask_email, 'wordwrap': wordwrap, 'msgauthlink': msgauthlink, 'msgsubjlink': msgsubjlink, 'monthname': monthname, 'nl2br': nl2br, 'optlink': optlink, 'pagelink': pagelink, 'relink': relink, 'relurl': relurl, 'rfc822gmtime': rfc822gmtime, 'selectlist': selectlist, 'threadlink': threadlink, 'url': escape_url, }) ############################################################################### # Main routine ############################################################################### def load_form(): #if not os.environ['QUERY_STRING']: # return { } cgi.maxlen = 64*1024 cgiform = cgi.FieldStorage() form = { } for key in cgiform.keys(): item = cgiform[key] if type(item) is not type([]) and \ not item.file: form[key] = item.value return form def setup_list(): global ctxt list = ctxt[LIST] if list: try: base = config.archives[list] except KeyError: die(ctxt, 'Unknown list: ' + list) ctxt.update(base) eza = ctxt[EZMLM] = ezmlm.EzmlmArchive(ctxt[LISTDIR]) if ctxt.has_key(MSGNUM): ctxt.update(eza.index[ctxt[MSGNUM]]) if ctxt.has_key(THREADID): ctxt.update(eza.thread(ctxt[THREADID])) eza.set_months(ctxt) if ctxt[TZ] and ctxt[TZ] <> 'None': os.environ['TZ'] = ctxt[TZ] def main_path(pathstr): # FIXME: handle ?part=#.#.#&filename=string # and then convert sub_showmsg et al to use the same notation global ctxt if not config.allowraw: die(ctxt, "Downloading raw messages is administratively prohibited.") while pathstr[0] == '/': pathstr = pathstr[1:] path = pathstr.split('/') ctxt[LIST] = path[0] setup_list() try: msgnum = int(path[1]) except: die(ctxt, "Invalid path: " + pathstr) msg = ctxt[EZMLM].open(msgnum) if ctxt.has_key(PART): parts = map(int, ctxt[PART].split('.')) part = email.message_from_file(msg) # FIXME: What the heck am I supposed to be doing with these numbers?!? if parts[0] != 1: raise ValueError parts = parts[1:] while parts: part = part.get_payload()[parts[0]] parts = parts[1:] write('Content-Type: %s\r\n\r\n' % part.get_type('text/plain')) write(part.get_payload(decode=1)) else: try: partnum = int(path[2]) msg = email.message_from_file(msg) for part in msg.walk(): if partnum <= 0: break partnum -= 1 write('Content-Type: %s\r\n\r\n' % part.get_type('text/plain')) write(part.get_payload(decode=1)) except: write('Content-Type: message/rfc822\r\n\r\n') buf = msg.read(8192) while buf: write(buf) buf = msg.read(8192) sys.exit(0) def main_form(): global ctxt setup_list() if ctxt.has_key('command'): ctxt[COMMAND] = ctxt['command'] if '/' in ctxt[COMMAND]: die(ctxt, "Invalid command") if not ctxt[LIST]: ctxt[COMMAND] = 'lists' try: module = __import__('commands/' + ctxt[COMMAND]) except ImportError: die(ctxt, "Invalid command") module.do(ctxt) def main(): update_global_context() global ctxt ctxt = context.Context() # Insert the environment (CGI) variables ctxt.update(os.environ) # Set up hard-coded defaults ctxt[ALTPART] = 'text/plain' ctxt[COMMAND] = 'months' ctxt[CSSPREFIX] = '' ctxt[DATESORT] = 'ascending' ctxt[FEEDMSGS] = 10 ctxt[FEEDTYPE] = 'atom' ctxt[FORMATTIME] = '' ctxt[LIST] = '' ctxt[MSGSPERPAGE] = 10 ctxt[PERPAGE] = 20 ctxt[STYLE] = '' ctxt[WRAPWIDTH] = 0 ctxt[TERMS] = '' ctxt[TZ] = '' # Update with defaults from the config ctxt.update(config.defaults) ctxt[ALLOWRAW] = config.allowraw # Update with all cookies for c in Cookie.SimpleCookie(os.environ.get('HTTP_COOKIE', '')).values(): ctxt[c.key] = c.value fixup_config() global form form = load_form() ctxt.update(form) try: path = os.environ['PATH_INFO'] main_path(path) except KeyError: pass main_form() ezmlm-browse-0.10/context.py0000664000076400007640000000415510155172250016723 0ustar bruceguenter00000000000000# Copyright (C) 2003 Bruce Guenter # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import sys ############################################################################### # Context management global_context = { 'math': __import__('math'), 'random': __import__('random'), 're': __import__('re'), 'time': __import__('time'), 'version': __import__('version'), } class Context: def __init__(self): global global_context self.stack = [ {} ] self.globals = global_context.copy() self.pop() def pop(self): self.dict = self.stack.pop() self.get = self.dict.get self.has_key = self.dict.has_key self.items = self.dict.items self.iteritems = self.dict.iteritems self.iterkeys = self.dict.iterkeys self.itervalues = self.dict.itervalues self.keys = self.dict.keys self.setdefault = self.dict.setdefault self.values = self.dict.values self.update = self.dict.update self.__str__ = self.dict.__str__ self.__repr__ = self.dict.__repr__ # These need to be special cased :/ self.globals['defined'] = self.dict.has_key def copy(self): return Context(self.dict.copy(), self.globals) def push(self): self.stack.append(self.dict.copy()) def eval(self, body): return eval(body, self.globals, self.dict) def execute(self, body): exec(body, self.globals, self.dict) def __getitem__(self, key): try: return self.dict[key] except KeyError: return self.eval(key) def __setitem__(self, key, val): self.dict[key] = val ezmlm-browse-0.10/commands/0000755000076400007640000000000010155172250016457 5ustar bruceguenter00000000000000ezmlm-browse-0.10/commands/lists.py0000664000076400007640000000077310155172250020200 0ustar bruceguenter00000000000000from globals import * from globalfns import * import config ############################################################################### # Command: Lists menu ############################################################################### def do(ctxt): for name in config.archives.keys(): config.archives[name][LIST] = name lists = config.archives.values() lists.sort(lambda a,b:cmp(a[LIST],b[LIST])) header(ctxt, 'Lists Menu', 'lists') do_list(ctxt, 'lists', ctxt[PERPAGE], lists) footer(ctxt) ezmlm-browse-0.10/commands/months.py0000664000076400007640000000103510155172250020342 0ustar bruceguenter00000000000000from globals import * from globalfns import * import config ############################################################################### # Command: Month Index ############################################################################### def do(ctxt): ezmlm = ctxt[EZMLM] header(ctxt, 'Month Index', 'months') do_list(ctxt, 'months', ctxt[PERPAGE], [ {MONTH: month, MSGCOUNT: reduce(lambda a,b:a+b, [ t[MSGCOUNT] for t in ezmlm.threads(month) ])} for month in map(int, ezmlm.months) ]) footer(ctxt) ezmlm-browse-0.10/commands/monthbythread.py0000664000076400007640000000071610155172250021707 0ustar bruceguenter00000000000000from globals import * from globalfns import * ############################################################################### # Command: Month by thread ############################################################################### def do(ctxt): ctxt[MONTH] = int(ctxt[MONTH]) header(ctxt, 'Threads for %(monthname(month))s %(month/100)s' % ctxt, 'threads') do_list(ctxt, 'threadlist', ctxt[PERPAGE], ctxt[EZMLM].threads(ctxt[MONTH])) footer(ctxt) ezmlm-browse-0.10/commands/configure.py0000664000076400007640000000262110155172250021015 0ustar bruceguenter00000000000000import Cookie from globals import * from globalfns import * import timezones ############################################################################### # Command: Configure interface ############################################################################### def do(ctxt): cookie = Cookie.SimpleCookie() if ctxt.has_key('_tz'): cookie[TZ] = ctxt[TZ] = ctxt['_tz'] if ctxt.has_key('_format_time'): cookie[FORMATTIME] = ctxt[FORMATTIME] = ctxt['_format_time'] if ctxt.has_key('_style'): cookie[STYLE] = ctxt[STYLE] = ctxt['_style'] if ctxt.has_key('_perpage'): try: cookie[PERPAGE] = ctxt[PERPAGE] = int(ctxt['_perpage']) except ValueError: pass if ctxt.has_key('_msgsperpage'): try: cookie[MSGSPERPAGE] = ctxt[MSGSPERPAGE] = int(ctxt['_msgsperpage']) except ValueError: pass if ctxt.has_key('_wrapwidth'): try: cookie[WRAPWIDTH] = ctxt[WRAPWIDTH] = int(ctxt['_wrapwidth']) except ValueError: pass if ctxt.has_key('_alt_part'): cookie[ALTPART] = ctxt[ALTPART] = ctxt['_alt_part'] if ctxt.has_key('_date_sort'): cookie[DATESORT] = ctxt[DATESORT] = ctxt['_date_sort'] if cookie: for key in cookie.keys(): cookie[key]['expires'] = 60*60*24*365*2 write(cookie.output(sep='\r\n')) write('\r\n') timezones.zones.insert(0, ('None','None')) ctxt['timezones'] = timezones.zones header(ctxt, 'Configure', 'configure') write(html('configure-form') % ctxt) footer(ctxt) ezmlm-browse-0.10/commands/feed.py0000664000076400007640000000167710155172250017751 0ustar bruceguenter00000000000000from globals import * from globalfns import * import email import feedgen def rec_gettext(part): if part.is_multipart(): return '\n'.join([ rec_gettext(p) for p in part.get_payload() ]) if part.get_type('text/plain') == 'text/plain': return part.get_payload(decode=1) return '' ############################################################################### # Command: Generate news feed ############################################################################### def do(ctxt): feedtype = feedgen.types[ctxt[FEEDTYPE]] # Set a hard maximum on the number of messages to reduce DoS attacks count = min(int(ctxt[FEEDMSGS]), 100) num = ctxt[EZMLM].num msgs = [] while len(msgs) < count and num > 0: try: msgs.append(ctxt[EZMLM].index[num]) except KeyError: pass num -= 1 for msg in msgs: e = email.message_from_file(ctxt[EZMLM].open(int(msg[MSGNUM]))) msg[BODY] = rec_gettext(e).strip() feedtype.generate(ctxt, msgs) ezmlm-browse-0.10/commands/threadindex.py0000664000076400007640000000070310155172250021332 0ustar bruceguenter00000000000000from globals import * from globalfns import * ############################################################################### # Command: Thread index ############################################################################### def do(ctxt): ezmlm = ctxt[EZMLM] ctxt.update(ezmlm.thread(ctxt[THREADID])) header(ctxt, 'Thread: ' + ctxt[SUBJECT], 'threadidx') ctxt[THREADS] = ezmlm.thread_messages(ctxt[MESSAGES]) rec_thread(ctxt) footer(ctxt) ezmlm-browse-0.10/commands/showmsg.py0000664000076400007640000000125610155172250020526 0ustar bruceguenter00000000000000from globals import * from globalfns import * ############################################################################### # Command: Show message ############################################################################### def do(ctxt): format_timestamp(ctxt, ctxt) header(ctxt, ctxt[SUBJECT], 'msg') ctxt['threadnum'] = 0 for i in range(len(ctxt[MESSAGES])): if int(ctxt[MESSAGES][i][MSGNUM]) == ctxt[MSGNUM]: ctxt['threadidx'] = i break ctxt['threadlen'] = len(ctxt[MESSAGES]) write('
') write(html('msg-pager') % ctxt) write('
') sub_showmsg(ctxt, ctxt[MSGNUM]) write('
') write(html('msg-pager') % ctxt) write('
') footer(ctxt) ezmlm-browse-0.10/commands/author.py0000664000076400007640000000072010155172250020334 0ustar bruceguenter00000000000000from globals import * from globalfns import * ############################################################################### # Command: Author post listing ############################################################################### def do(ctxt): ctxt.update(ctxt[EZMLM].author(ctxt[AUTHORID])) format_timestamps(ctxt, ctxt[MESSAGES]) header(ctxt, 'Author: ' + ctxt[AUTHOR], 'author') do_list(ctxt, 'msglist', ctxt[PERPAGE], ctxt[MESSAGES]) footer(ctxt) ezmlm-browse-0.10/commands/search.py0000664000076400007640000000104310155172250020276 0ustar bruceguenter00000000000000from globals import * from globalfns import * ############################################################################### # Command: Search form / results ############################################################################### def do(ctxt): terms = ctxt[TERMS] if terms: header(ctxt, 'Search for: ' + ctxt['html(terms)'], 'search') do_list(ctxt, 'threadlist', ctxt[PERPAGE], ctxt[EZMLM].search(terms)) write(html('search-sep') % ctxt) else: header(ctxt, 'Search', 'search') write(html('search-form') % ctxt) footer(ctxt) ezmlm-browse-0.10/commands/showthread.py0000664000076400007640000000073710155172250021212 0ustar bruceguenter00000000000000from globals import * from globalfns import * ############################################################################### # Command: Show thread ############################################################################### def do(ctxt): ezmlm = ctxt[EZMLM] ctxt.update(ezmlm.thread(ctxt[THREADID])) header(ctxt, 'Thread: ' + ctxt[SUBJECT], 'showthread') do_list(ctxt, 'msgs', ctxt[MSGSPERPAGE], ctxt[MESSAGES], lambda:sub_showmsg(ctxt, ctxt[MSGNUM])) footer(ctxt) ezmlm-browse-0.10/commands/monthbydate.py0000664000076400007640000000103710155172250021352 0ustar bruceguenter00000000000000from globals import * from globalfns import * ############################################################################### # Command: Month by date ############################################################################### def do(ctxt): ctxt[MONTH] = int(ctxt[MONTH]) header(ctxt, 'Messages for %(monthname(month))s %(month/100)s' % ctxt, 'bydate') month = ctxt[EZMLM].month(ctxt[MONTH]) if ctxt[DATESORT][0] == 'd': month.reverse() do_list(ctxt, 'msglist', ctxt[PERPAGE], format_timestamps(ctxt, month)) footer(ctxt) ezmlm-browse-0.10/makedist.py0000664000076400007640000000166410155172250017042 0ustar bruceguenter00000000000000# Template makedist.py file # Set WEBSITE to the name of the web site that this package will be # deposited in. The URL will always be: # http://$WEBSITE/$PACKAGE/ WEBSITE = 'untroubled.org' # If LISTSUB is set, makedist will add a note regarding mailing list # subscription. LISTSUB = 'bgware-subscribe@lists.untroubled.org' LISTURL = 'http://lists.untroubled.org/?list=bgware' # Set EXTRAS to a list of any extra files that should go into the # base directory in the destination site. EXTRAS = [ 'ANNOUNCEMENT', 'NEWS', 'README', 'TODO', ] # Set RPMUPLOAD to a list of additional hostname/path destinations to # which to upload the source and binary RPMs. RPMUPLOAD = [ #( 'incoming.redhat.com', 'libc6' ), ] # Set LISTS to the mailing list(s) to send the announcement to LISTS = [ 'bgware@lists.untroubled.org', 'ezmlm@list.cr.yp.to', ] # Run any extra commands to prepare the source tree (such as making # documentation) here. ezmlm-browse-0.10/VERSION0000664000076400007640000000002210155172250015722 0ustar bruceguenter00000000000000ezmlm-browse 0.10 ezmlm-browse-0.10/globals.py0000664000076400007640000000302610155172250016656 0ustar bruceguenter00000000000000ALLOWPOST = intern('allowpost') ALLOWRAW = intern('allowraw') ALTPART = intern('alt_part') AUTHORID = intern('authorid') AUTHOR = intern('author') BASE = intern('base') BODY = intern('body') CLASS = intern('class') COMMAND = intern('cmd') COOKIES = intern('cookies') CSSPREFIX = intern('cssprefix') DATE = intern('date') DATESORT = intern('date_sort') ERROR = intern('error') EZMLM = intern('ezmlm') FEEDMSGS = intern('feedmsgs') FEEDTYPE = intern('feedtype') FILENAME = intern('filename') FIRSTMONTH = intern('first_month') FORMATTIME = intern('format_time') HEADERS = intern('headers') ITEM = intern('item') LASTMONTH = intern('last_month') LISTDESC = intern('listdesc') LISTDIR = intern('listdir') LISTEMAIL = intern('listemail') LIST = intern('list') LISTSUB = intern('listsub') WRAPWIDTH = intern('wrapwidth') MENUBAR = intern('menubar') MESSAGE = intern('message') MESSAGES = intern('messages') MONTH = intern('month') MONTHNAME = intern('month_name') MSGCOUNT = intern('msgcount') MSGNUM = intern('msgnum') MSGSPERPAGE = intern('msgsperpage') NAME = intern('name') NEXTMONTH = intern('next_month') PAGE = intern('page') PAGES = intern('pages') PART = intern('part') PERPAGE = intern('perpage') PREVMONTH = intern('prev_month') ROW = intern('row') STYLE = intern('style') SUBJECT = intern('subject') TERMS = intern('terms') THREADID = intern('threadid') THREADS = intern('threads') TIMESTAMP = intern('timestamp') TIMESTR = intern('timestr') TITLE = intern('title') TYPE = intern('type') TZ = intern('tz') VALUE = intern('value') YEAR = intern('year') ezmlm-browse-0.10/ANNOUNCEMENT0000664000076400007640000000635110155172250016502 0ustar bruceguenter00000000000000Version 0.10 of ezmlm-browse is now available at: http://untroubled.org/ezmlm-browse/ ------------------------------------------------------------------------------ Changes in version 0.10 - Added support for generation of syndication feeds. - Added support for reversing the order of the "by Date" message list. - Added support for blocking or allowing for downloading raw messages. - Added CSSPREFIX configuration item, to allow for easy configuration of where CSS files are located. Thanks Roger Merchberger. - Added support for word-wrapping message bodies (defaulting to off). Idea from Roger Merchberger. Development of this version has been sponsored by FutureQuest, Inc. ossi@FutureQuest.net http://www.FutureQuest.net/ ------------------------------------------------------------------------------- ezmlm-browse Web browser for ezmlm-idx archives Bruce Guenter Version 0.10 2004-12-06 This is ezmlm-browse, a web interface for browsing ezmlm-idx (version 0.40 or later) archives. The presentation is modeled from that of the ezmlm-cgi archive browser that is part of ezmlm-idx, but with several additions. However, the output is completely template drive, so you can make it fit into your current web scheme. A mailing list has been set up to discuss this and other packages. To subscribe, send an email to: bgware-subscribe@lists.untroubled.org A mailing list archive is available at: http://lists.untroubled.org/?list=bgware Development versions of ezmlm-browse are available via Subversion at: svn://bruce-guenter.dyndns.org/ezmlm-browse/trunk Requirements: - Python 2 (tested with 2.3, should work with version 2.2 or later) - ezmlm 0.53 + idx 0.40 or later. If you are using an older version of ezmlm-idx, you MUST upgrade and run the "ezmlm-idx" command on all lists you wish to browse. Installation: - Unpack ezmlm-browse into a non-web-visible directory. This is the directory from which ezmlm-browse will execute. - Run "make" to build "wrapper" and precompile the Python bytecode. - Either copy the "wrapper" program or symlink the "index.cgi" script into your web tree as a CGI. - If necessary, make the wrapper setuid to whatever user owns the mailing list archive files. - Copy the .css files into a web-visible directory. Configuration: - Edit config.py to declare which mailing lists are visible to the web, and set the other defaults as appropriate (most notably, the path to the CSS files). Security Notes: - You will need to choose one of the following options: - Make your mailing list archives readable to the UID that the web server operates under. This will likely allow anybody on your system to read the contents of the mailing lists, including the unfiltered header lines (which include full email addresses, etc.) - Make the wrapper CGI program owned by the mailing list archive owner and setuid. If I have not been adequately careful, this may allow an attacker to execute code as that user. - Use the Apache su-exec module. This program is Copyright(C) 2004 Bruce Guenter, and may be copied according to the GNU GENERAL PUBLIC LICENSE (GPL) Version 2 or a later version. A copy of this license is included with this package. This package comes with no warranty of any kind. ezmlm-browse-0.10/greenterm.css0000664000076400007640000000244010155172250017362 0ustar bruceguenter00000000000000BODY { background: #000000; color: #00ff00; font-family: monospace; } H1 { #background: #314a63; #color: #ffffff; margin-top: 0px; margin-bottom: 0px; } HR { border-style: dashed; } TH { } .evenrow { } .oddrow { } .author { } .listdesc { } .listlink { } .month { text-align: right; } .msgcount { text-align: center; } .msgsitem { border-style: dotted; } .msgslink { } .note { } .subject { } .threaditem { border-width: thin; } .threadslink { } .timestamp { } .year { text-align: left; } /* Parts of the pager */ .pager { text-align: center; } .pager-first { } .pager-prev { } .pager-curr { } .pager-next { } .pager-last { } /* Parts of the message menu */ .msgmenu { } .msgmenu-prevbydate { } .msgmenu-nextbydate { } .msgmenu-prevbythread { } .msgmenu-nextbythread { } .msgmenu-label { text-align: right; } .msgmenu-value { text-align: left; } /* Parts of the menu bar */ .menubar { } .menu-lists { } .menu-config { } .menu-first { } .menu-prev { } .menu-bythread { } .menu-bydate { } .menu-next { } .menu-last { } .menu-months { } .menu-search { } .menu-subscribe { } /* Configuration table */ .config { } .config-label { text-align: right; } .config-value { text-align: left; } /* The list table classes */ .lists { } .months { border: 0px; } .msglist { } .msgs { width: 100%; } .threadlist { } ezmlm-browse-0.10/timezones.py0000664000076400007640000000076410155172250017256 0ustar bruceguenter00000000000000import os def _rlistdir(base, sub): path = os.path.join(base, sub) result = [] list = os.listdir(path) for entry in os.listdir(path): if entry == 'right': continue if entry[-4:] == '.tab': continue if entry[:5] == 'posix': continue fullpath = os.path.join(path, entry) subpath = os.path.join(sub, entry) if os.path.isdir(fullpath): result.extend(_rlistdir(base, subpath)) else: result.append(subpath) return result zones = _rlistdir('/usr/share/zoneinfo', '') zones.sort() ezmlm-browse-0.10/feedgen.py0000664000076400007640000000123510155172250016630 0ustar bruceguenter00000000000000from globals import * from globalfns import * import time class Feed: def __init__(self, prefix, ctype): self.ctype = ctype self.prefix = prefix def generate(self, ctxt, msgs): header = xml(self.prefix + '-head') entry = xml(self.prefix + '-item') footer = xml(self.prefix + '-tail') ctxt['timestamp'] = msgs[0][TIMESTAMP] write("Content-Type: %s\r\n\r\n" % self.ctype) write(header % ctxt) ctxt.push() for msg in msgs: ctxt.update(msg) write(entry % ctxt) ctxt.pop() write(footer % ctxt) atom = Feed('atom', 'application/atom+xml') rss2 = Feed('rss2', 'application/rss+xml') types = { 'atom': atom, 'rss': rss2, 'rss2': rss2, } ezmlm-browse-0.10/wrapper.c0000664000076400007640000000047710155172250016514 0ustar bruceguenter00000000000000#include #include "auto_pwd.c" #include "auto_python2.c" int main(void) { const char* args[] = { auto_python2, "-c", "import sys; " "sys.path[0]=sys.argv[1]; " "import main; " "main.main()", auto_pwd, 0 }; if (chdir(auto_pwd) == 0) execv(auto_python2, (char**)args); return 111; } ezmlm-browse-0.10/conf-bgincs0000664000076400007640000000003210155172250016766 0ustar bruceguenter00000000000000/usr/local/bglibs/include ezmlm-browse-0.10/conf-bglibs0000664000076400007640000000002610155172250016766 0ustar bruceguenter00000000000000/usr/local/bglibs/lib ezmlm-browse-0.10/COPYING0000664000076400007640000004311010155172250015712 0ustar bruceguenter00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ezmlm-browse-0.10/AUTOFILES0000664000076400007640000000011410155172250016132 0ustar bruceguenter00000000000000AUTOFILES Makefile SRCFILES TARGETS conf-bgincs conf-bglibs conf-cc conf-ld ezmlm-browse-0.10/SRCFILES0000664000076400007640000000053310155172250016016 0ustar bruceguenter00000000000000VERSION commands/author.py commands/configure.py commands/feed.py commands/lists.py commands/monthbydate.py commands/monthbythread.py commands/months.py commands/search.py commands/showmsg.py commands/showthread.py commands/threadindex.py config.py context.py ezmlm.py feedgen.py globalfns.py globals.py main.py makedist.py timezones.py wrapper.c