# HG changeset patch # User Michael Schloh von Bennewitz # Date 1229522528 -3600 # Node ID 5443cb9b550a27c127fa86bab4ac4b46a198631d # Parent eab6243607cbe40b483f10515c93e015541a3c9f Import original revisions from the OpenPKG project. diff -r eab6243607cb -r 5443cb9b550a mailman/mailman-apache.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mailman/mailman-apache.conf Wed Dec 17 15:02:08 2008 +0100 @@ -0,0 +1,52 @@ +## +## mailman-apache.conf -- Apache Configuration for Mailman +## + + + # server information + ServerName host.example.com + ServerAdmin hostmaster@host.example.com + ServerSignature on + + # document area + DocumentRoot @l_prefix@/libexec/mailman/htdocs/ + + Options FollowSymLinks + AllowOverride None + Order allow,deny + Allow from all + + + # pipermail area + Alias /mailman/pipermail/ @l_prefix@/var/mailman/archives/public/ + + Options FollowSymLinks + AllowOverride None + Order allow,deny + Allow from all + + + # icon area + Alias /mailman/icons/ @l_prefix@/libexec/mailman/icons/ + + Options FollowSymLinks + AllowOverride None + Order allow,deny + Allow from all + + + # executable area + ScriptAlias /mailman/ @l_prefix@/libexec/mailman/cgi-bin/ + + Options FollowSymLinks ExecCGI + AllowOverride None + Order allow,deny + Allow from all + + + # logging + CustomLog @l_prefix@/var/mailman/logs/http-access.log common + ErrorLog @l_prefix@/var/mailman/logs/http-error.log + LogLevel warn + + diff -r eab6243607cb -r 5443cb9b550a mailman/mailman-sendmail.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mailman/mailman-sendmail.m4 Wed Dec 17 15:02:08 2008 +0100 @@ -0,0 +1,16 @@ +dnl +dnl mailman.m4: Mailman specific local mailer +dnl + +MAILER_DEFINITIONS + +## Special flags! See: +## http://www.sendmail.org/~ca/email/doc8.10/op-sh-5.html#sh-5.4 Note +## especially the absence of the "m" and "n" flags. THIS IS IMPORTANT: +## mailman handler assumes this behavior to avoid having to know too +## much about address parsing and other RFC-2822 mail details. + +Mmailman, P=@l_prefix@/libexec/mailman/mail/mailman-sendmail, F=rDFMhlqSu, U=@l_nusr@:@l_ngrp@, + S=EnvFromL, R=EnvToL/HdrToL, + A=mailman-sendmail $h $u + diff -r eab6243607cb -r 5443cb9b550a mailman/mailman.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mailman/mailman.patch Wed Dec 17 15:02:08 2008 +0100 @@ -0,0 +1,247 @@ +Index: Mailman/Archiver/pipermail.py +--- Mailman/Archiver/pipermail.py.orig 2008-06-30 18:29:46 +0200 ++++ Mailman/Archiver/pipermail.py 2008-07-01 20:48:10 +0200 +@@ -122,9 +122,9 @@ + parentID = article.parentID + if parentID is not None and self.articleIndex.has_key(parentID): + parent = self.getArticle(archive, parentID) +- myThreadKey = parent.threadKey + article.date + '-' ++ myThreadKey = parent.threadKey + article.date + '/' + article.msgid + '-' + else: +- myThreadKey = article.date + '-' ++ myThreadKey = article.date + '/' + article.msgid + '-' + article.threadKey = myThreadKey + key = myThreadKey, article.msgid + self.setThreadKey(archive, key, article.msgid) +@@ -418,7 +418,7 @@ + else: + parent = self.database.getArticle(self.archive, + article.parentID) +- article.threadKey = parent.threadKey+article.date+'-' ++ article.threadKey = parent.threadKey + article.date + '/' + article.msgid + '-' + self.database.setThreadKey(self.archive, + (article.threadKey, article.msgid), + msgid) +@@ -632,9 +632,9 @@ + article.parentID = parentID = self.get_parent_info(arch, article) + if parentID: + parent = self.database.getArticle(arch, parentID) +- article.threadKey = parent.threadKey + article.date + '-' ++ article.threadKey = parent.threadKey + article.date + '/' + article.msgid + '-' + else: +- article.threadKey = article.date + '-' ++ article.threadKey = article.date + '/' + article.msgid + '-' + key = article.threadKey, article.msgid + + self.database.setThreadKey(arch, key, article.msgid) +Index: Mailman/Commands/cmd_subscribe.py +--- Mailman/Commands/cmd_subscribe.py.orig 2008-06-30 18:29:46 +0200 ++++ Mailman/Commands/cmd_subscribe.py 2008-07-01 20:48:10 +0200 +@@ -84,6 +84,7 @@ + if password is None: + password = Utils.MakeRandomPassword() + if address is None: ++ h = None + realname, address = parseaddr(res.msg['from']) + if not address: + # Fall back to the sender address +Index: Mailman/HTMLFormatter.py +--- Mailman/HTMLFormatter.py.orig 2008-06-30 18:29:46 +0200 ++++ Mailman/HTMLFormatter.py 2008-07-01 20:48:10 +0200 +@@ -44,7 +44,7 @@ + realname = self.real_name + hostname = self.host_name + listinfo_link = Link(self.GetScriptURL('listinfo'), realname).Format() +- owner_link = Link('mailto:' + self.GetOwnerEmail(), ownertext).Format() ++ owner_link = Link('mailto:' + self.GetOwnerEmail(), realname + '-owner').Format() + innertext = _('%(listinfo_link)s list run by %(owner_link)s') + return Container( + '
', +Index: Mailman/Handlers/Decorate.py +--- Mailman/Handlers/Decorate.py.orig 2008-06-30 18:29:46 +0200 ++++ Mailman/Handlers/Decorate.py 2008-07-01 20:48:10 +0200 +@@ -197,6 +197,7 @@ + del msg['content-transfer-encoding'] + del msg['content-disposition'] + msg['Content-Type'] = 'multipart/mixed' ++ msg['Mime-version'] = '1.0' + + + +Index: Mailman/Handlers/Scrubber.py +--- Mailman/Handlers/Scrubber.py.orig 2008-06-30 18:29:46 +0200 ++++ Mailman/Handlers/Scrubber.py 2008-07-01 20:48:10 +0200 +@@ -385,6 +385,8 @@ + t = unicode(t, 'ascii', 'replace') + try: + # Should use HTML-Escape, or try generalizing to UTF-8 ++ if len(charset) == 0: ++ charset = 'us-ascii' + t = t.encode(charset, 'replace') + except (UnicodeError, LookupError, ValueError, + AssertionError): +Index: Mailman/Queue/OutgoingRunner.py +--- Mailman/Queue/OutgoingRunner.py.orig 2008-06-30 18:29:46 +0200 ++++ Mailman/Queue/OutgoingRunner.py 2008-07-01 20:48:10 +0200 +@@ -89,6 +89,7 @@ + syslog('error', 'Cannot connect to SMTP server %s on port %s', + mm_cfg.SMTPHOST, port) + self.__logged = True ++ self._snooze(0) + return True + except Errors.SomeRecipientsFailed, e: + # Handle local rejects of probe messages differently. +Index: Mailman/htmlformat.py +--- Mailman/htmlformat.py.orig 2008-06-30 18:29:46 +0200 ++++ Mailman/htmlformat.py 2008-07-01 20:48:10 +0200 +@@ -300,7 +300,8 @@ + charset = 'us-ascii' + if self.language: + charset = Utils.GetCharSet(self.language) +- output = ['Content-Type: text/html; charset=%s\n' % charset] ++ output = ['Content-Type: text/html; charset=%s' % charset] ++ output.append('Cache-control: no-cache\n') + if not self.suppress_head: + kws.setdefault('bgcolor', self.bgcolor) + tab = ' ' * indent +Index: bin/check_perms +--- bin/check_perms.orig 2008-06-30 18:29:46 +0200 ++++ bin/check_perms 2008-07-01 20:48:10 +0200 +@@ -82,7 +82,7 @@ + return os.stat(path)[ST_MODE] + + def statgidmode(path): +- stat = os.stat(path) ++ stat = os.lstat(path) + return stat[ST_MODE], stat[ST_GID] + + seen = {} +Index: bin/config_list +--- bin/config_list.orig 2008-06-30 18:29:46 +0200 ++++ bin/config_list 2008-07-01 20:48:10 +0200 +@@ -307,6 +307,11 @@ + in mm_cfg.OPTINFO.items() + if validval & bitval] + gui._setValue(mlist, k, validval, fakedoc) ++ # Ugly hack, but seems to be needed since ++ # new_member_options isn't really a number in gui. ++ # -- tfheen, 2003-12-06 ++ if k == "new_member_options": ++ mlist.new_member_options = validval + # BAW: when to do gui._postValidate()??? + finally: + if savelist and not checkonly: +Index: bin/mailmanctl +--- bin/mailmanctl.orig 2008-06-30 18:29:46 +0200 ++++ bin/mailmanctl 2008-07-01 20:48:10 +0200 +@@ -417,6 +417,13 @@ + # won't be opening any terminal devices, don't do the ultra-paranoid + # suggestion of doing a second fork after the setsid() call. + os.setsid() ++ ++ # Be sure to close any open std{in,out,err} ++ devnull = os.open('/dev/null', 0) ++ os.dup2(devnull, 0) ++ os.dup2(devnull, 1) ++ os.dup2(devnull, 2) ++ + # Instead of cd'ing to root, cd to the Mailman installation home + os.chdir(mm_cfg.PREFIX) + # Set our file mode creation umask +Index: bin/newlist +--- bin/newlist.orig 2008-06-30 18:29:46 +0200 ++++ bin/newlist 2008-07-01 20:48:10 +0200 +@@ -87,6 +87,9 @@ + defined in your Defaults.py file or overridden by settings in mm_cfg.py). + + Note that listnames are forced to lowercase. ++ ++The list admin address need to be a fully-qualified address, like ++owner@example.com, not just owner. + """ + + import sys +@@ -94,6 +97,7 @@ + import getpass + import getopt + import sha ++import grp + + import paths + from Mailman import mm_cfg +@@ -122,6 +126,9 @@ + + + def main(): ++ gid = grp.getgrnam(mm_cfg.MAILMAN_GROUP)[2] ++ if os.getgid() != mm_cfg.MAILMAN_GROUP: ++ os.setgid(gid) + try: + opts, args = getopt.getopt(sys.argv[1:], 'hql:u:e:', + ['help', 'quiet', 'language=', +@@ -203,7 +210,7 @@ + except Errors.BadListNameError, s: + usage(1, _('Illegal list name: %(s)s')) + except Errors.EmailAddressError, s: +- usage(1, _('Bad owner email address: %(s)s')) ++ usage(1, _('Bad owner email address: %(s)s. Owner addresses need to be fully-qualified names, like "owner@example.com", not just "owner".')) + except Errors.MMListAlreadyExistsError: + usage(1, _('List already exists: %(listname)s')) + +Index: bin/update +--- bin/update.orig 2008-06-30 18:29:46 +0200 ++++ bin/update 2008-07-01 20:48:10 +0200 +@@ -552,9 +552,11 @@ + file20 = os.path.join(mm_cfg.DATA_DIR, 'pending_subscriptions.db') + file214 = os.path.join(mm_cfg.DATA_DIR, 'pending.pck') + db = None ++ ver = None + # Try to load the Mailman 2.0 file + try: + fp = open(file20) ++ ver = "20" + except IOError, e: + if e.errno <> errno.ENOENT: raise + else: +@@ -566,6 +568,7 @@ + # Try to load the Mailman 2.1.x where x < 5, file + try: + fp = open(file214) ++ ver = "214" + except IOError, e: + if e.errno <> errno.ENOENT: raise + else: +@@ -599,8 +602,12 @@ + # data[0] is the address being unsubscribed + addrops_by_address.setdefault(data[0], []).append((key, val)) + elif op == Pending.SUBSCRIPTION: +- # data[0] is a UserDesc object +- addr = data[0].address ++ if ver == "20": ++ # data is tuple (emailaddr, password, digest) ++ addr = data[0] ++ else: ++ # data[0] is a UserDesc object ++ addr = data[0].address + subs_by_address.setdefault(addr, []).append((key, val)) + elif op == Pending.RE_ENABLE: + # data[0] is the mailing list's internal name +Index: scripts/driver +--- scripts/driver.orig 2008-06-30 18:29:46 +0200 ++++ scripts/driver 2008-07-01 20:48:10 +0200 +@@ -95,6 +95,15 @@ + module = getattr(pkg, scriptname) + main = getattr(module, 'main') + try: ++ import os ++ request_method = os.environ.get('REQUEST_METHOD') ++ if not request_method in ['GET', 'POST', 'HEAD']: ++ print "Status: 405 Method not allowed" ++ print "Content-type: text/plain" ++ print ++ print "The method is not allowed" ++ sys.exit() ++ + try: + sys.stderr = logger + sys.stdout = tempstdout diff -r eab6243607cb -r 5443cb9b550a mailman/mailman.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mailman/mailman.spec Wed Dec 17 15:02:08 2008 +0100 @@ -0,0 +1,225 @@ +## +## mailman.spec -- OpenPKG RPM Package Specification +## Copyright (c) 2000-2008 OpenPKG Foundation e.V. +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +# FIXME: rse: is this packaging complete? + +# package information +Name: mailman +Summary: Mailing List Management System +URL: http://www.list.org/ +Vendor: John Viega et al. +Packager: OpenPKG Foundation e.V. +Distribution: OpenPKG Community +Class: EVAL +Group: Mail +License: GPL +Version: 2.1.11 +Release: 20080701 + +# list of sources +Source0: http://switch.dl.sourceforge.net/mailman/mailman-%{version}.tgz +Source1: manpages.tar.gz +Source2: mailman-sendmail.m4 +Source3: mailman-apache.conf +Source4: rc.mailman +Patch0: mailman.patch + +# build information +Prefix: %{l_prefix} +BuildRoot: %{l_buildroot} +BuildPreReq: OpenPKG, openpkg >= 20060823, python +PreReq: OpenPKG, openpkg >= 20060823, python, MTA +AutoReq: no +AutoReqProv: no + +%description + Mailman is software to help manage email discussion lists, much + like Majordomo and Smartmail. Unlike most similar products, Mailman + gives each mailing list a webpage, and allows users to subscribe, + unsubscribe, etc. over the Web. Even the list manager can administer + his or her list entirely from the Web. Mailman also integrates most + things people want to do with mailing lists, including archiving, + mail/news gateways, and so on. + +%track + prog mailman = { + version = %{version} + url = http://prdownloads.sourceforge.net/mailman/ + regex = mailman-(\d+\.\d+\.\d+)\.tgz + } + +%prep + %setup -q + %setup -q -D -T -a 1 + %patch -p0 + +%build + # configure package + CC="%{l_cc}" \ + CFLAGS="%{l_cflags -O}" \ + CPPFLAGS="%{l_cppflags}" \ + LDFLAGS="%{l_ldflags}" \ + ./configure \ + --prefix=%{l_prefix}/libexec/mailman \ + --exec-prefix=%{l_prefix}/libexec/mailman \ + --sysconfdir=%{l_prefix}/etc/mailman \ + --with-var-prefix=%{l_prefix}/var/mailman \ + --with-username=%{l_nusr} \ + --with-groupname=%{l_mgrp} \ + --with-cgi-gid=%{l_ngrp} \ + --with-mail-gid=%{l_mgrp} \ + --with-cgi-ext="" \ + --with-urlhost="localhost" \ + --with-mailhost="localhost" \ + --without-permcheck \ + --enable-static + + # build package + %{l_make} %{l_mflags} + +%install + # install package + rm -rf $RPM_BUILD_ROOT + %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT DIRSETGID=true + + # create additional directories + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ + $RPM_BUILD_ROOT%{l_prefix}/etc/mailman \ + $RPM_BUILD_ROOT%{l_prefix}/man/man8 + + # strip down installation tree + rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/tests + + # install Sendmail mailer handler + %{l_shtool} install -c -m 755 \ + -e 's;#!/usr/local/bin/perl;#!%{l_prefix}/bin/perl;' \ + -e 's;/home/mailman/mail/mailman;%{l_prefix}/libexec/mailman/mail/mailman;' \ + -e 's;/home/mailman/lists;%{l_prefix}/var/mailman/lists;' \ + -e 's;/usr/lib/sendmail;%{l_prefix}/sbin/sendmail;' \ + contrib/mm-handler \ + $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/mail/mailman-sendmail + + # install Apache and Sendmail configurations + %{l_shtool} install -c -m 644 %{l_value -s -a} \ + %{SOURCE mailman-sendmail.m4} %{SOURCE mailman-apache.conf} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/mailman/ + + # install manual pages + %{l_shtool} install -c -m 644 \ + man8/*.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/ + + # post-adjust default configuration + mv $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/Mailman/mm_cfg.py \ + $RPM_BUILD_ROOT%{l_prefix}/etc/mailman/mailman.cfg + ln -s %{l_prefix}/etc/mailman/mailman.cfg \ + $RPM_BUILD_ROOT%{l_prefix}/libexec/mailman/Mailman/mm_cfg.py + ( echo "" + echo "DEFAULT_EMAIL_HOST = 'host.example.com'" + echo "DEFAULT_URL_HOST = 'host.example.com'" + echo "IMAGE_LOGOS = '/mailman/icons/'" + echo "PUBLIC_ARCHIVE_URL = '/mailman/pipermail/%%(listname)s'" + echo "MAILMAN_USER = '%{l_nusr}'" + echo "MAILMAN_GROUP = '%{l_mgrp}'" + echo "DEFAULT_SERVER_LANGUAGE = 'en'" + echo "VERP_PASSWORD_REMINDERS = 1" + echo "VERP_PERSONALIZED_DELIVERIES = 1" + echo "VERP_CONFIRMATIONS = 1" + echo "VERP_DELIVERY_INTERVAL = 1" + echo "" + echo "# For available options and their descriptions see:" + echo "# %{l_prefix}/libexec/mailman/Mailman/Defaults.py" + echo "" + ) >>$RPM_BUILD_ROOT%{l_prefix}/etc/mailman/mailman.cfg + + # install run-command script + %{l_shtool} install -c -m 755 %{l_value -s -a} \ + %{SOURCE rc.mailman} ${RPM_BUILD_ROOT}%{l_prefix}/etc/rc.d/ + + # determine installation files + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ + %{l_files_std} \ + '%dir %attr(2700,%{l_nusr},%{l_mgrp}) %{l_prefix}/libexec/mailman/mail/mailman-sendmail' \ + '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman' \ + '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/logs' \ + '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/spam' \ + '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/qfiles' \ + '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/locks' \ + '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/lists' \ + '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/archives' \ + '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/archives/*' \ + '%dir %attr(2775,%{l_nusr},%{l_mgrp}) %{l_prefix}/var/mailman/data' \ + '%config %attr(0640,%{l_nusr},%{l_mgrp}) %{l_prefix}/etc/mailman/mailman.cfg' \ + '%config %{l_prefix}/etc/mailman/*' + +%files -f files + +%clean + rm -rf $RPM_BUILD_ROOT + +%post + # add hook to MTA configuration + if [ $1 -eq 1 ]; then + aliases_file=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_file` + update_command=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_update` + if [ ".$aliases_file" != . ]; then + ( echo "mailman: postmaster" + echo "mailman-owner: postmaster" + ) |\ + $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \ + -a -i "$RPM_INSTALL_PREFIX:mailman" $aliases_file + fi + if [ ".$update_command" != . ]; then + eval $update_command + fi + fi + + # after upgrade, restart service + [ $1 -eq 2 ] || exit 0 + $RPM_INSTALL_PREFIX/libexec/mailman/bin/update + eval `%{l_rc} mailman status 2>/dev/null` + [ ".$mailman_active" = .yes ] && %{l_rc} mailman restart + exit 0 + +%preun + # before erase, stop service (and remove files) + [ $1 -eq 0 ] || exit 0 + rm -f $RPM_INSTALL_PREFIX/libexec/mailman/bin/paths.pyc >/dev/null 2>&1 || true + rm -f $RPM_INSTALL_PREFIX/libexec/mailman/cron/paths.pyc >/dev/null 2>&1 || true + rm -f $RPM_INSTALL_PREFIX/libexec/mailman/scripts/paths.pyc >/dev/null 2>&1 || true + %{l_rc} mailman stop 2>/dev/null + exit 0 + +%postun + # remove hook from MTA configuration + [ $1 -eq 0 ] || exit 0 + aliases_file=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_file` + update_command=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_update` + if [ ".$aliases_file" != . ]; then + $RPM_INSTALL_PREFIX/lib/openpkg/rpmtool config \ + -r -i "$RPM_INSTALL_PREFIX:mailman" $aliases_file + fi + if [ ".$update_command" != . ]; then + eval $update_command + fi + diff -r eab6243607cb -r 5443cb9b550a mailman/manpages.tar.gz Binary file mailman/manpages.tar.gz has changed diff -r eab6243607cb -r 5443cb9b550a mailman/rc.mailman --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mailman/rc.mailman Wed Dec 17 15:02:08 2008 +0100 @@ -0,0 +1,53 @@ +#!@l_prefix@/bin/openpkg rc +## +## rc.mailman -- Run-Commands +## + +%config + mailman_enable="$openpkg_rc_def" + +%common + mailman_ctl="@l_prefix@/libexec/mailman/bin/mailmanctl" + +%status -u @l_susr@ -o + mailman_usable="unknown" + mailman_active="no" + rcService mailman enable yes && \ + @l_prefix@/bin/python ${mailman_ctl} -q FIXME && \ + mailman_active="yes" + echo "mailman_enable=\"$mailman_enable\"" + echo "mailman_usable=\"$mailman_usable\"" + echo "mailman_active=\"$mailman_active\"" + +%start -u @l_susr@ + rcService mailman enable yes || exit 0 + rcService mailman active yes && exit 0 + @l_prefix@/bin/python ${mailman_ctl} -s -q start + +%stop -u @l_susr@ + rcService mailman enable yes || exit 0 + rcService mailman active no && exit 0 + @l_prefix@/bin/python ${mailman_ctl} -q stop + sleep 2 + +%restart -u @l_susr@ + rcService mailman enable yes || exit 0 + rcService mailman active no && exit 0 + @l_prefix@/bin/python ${mailman_ctl} -q restart + sleep 2 + +%quarterly -u @l_susr@ + rcService mailman enable yes || exit 0 + @l_prefix@/bin/python -S @l_prefix@/libexec/mailman/cron/gate_news + +%daily -u @l_susr@ + rcService mailman enable yes || exit 0 + @l_prefix@/bin/python -S @l_prefix@/libexec/mailman/cron/checkdbs + @l_prefix@/bin/python -S @l_prefix@/libexec/mailman/cron/disabled + @l_prefix@/bin/python -S @l_prefix@/libexec/mailman/cron/senddigests + @l_prefix@/bin/python -S @l_prefix@/libexec/mailman/cron/nightly_gzip + +%monthly -u @l_susr@ + rcService mailman enable yes || exit 0 + @l_prefix@/bin/python -S @l_prefix@/libexec/mailman/cron/mailpasswds +