
Hi all, This patch should let the administrator specify alternative external archivers. All you have to do is set the PUBLIC_EXTERNAL_ARCHIVER and/or PRIVATE_EXTERNAL_ARCHIVER variables to the command line you wish to use. If you put "$LISTNAME" or "${LISTNAME}" in the command line, it is replaced with the name of the list. Mailman will run the command line and pipe each post to it. The main advantage to this is that all post filtering is done without having to subscribe a procmailrc to the list. This prevents list-admins from accidentally unsubscribing the archiver. If the variables given above are set to "" (the default), Mailman will fall back to the built-in Pipermail archiver, so this should not break any existing installations. My apologies for using regsub, but I have not been able to find enough documentation on the re module. Perhaps someone better acquainted with it could migrate this patch to it? -- Paul Hebble <hebble@ncsa.uiuc.edu> -- BEGIN PATCH (Also attached in gzip format) diff -Nru --exclude=CVS --exclude=Makefile --exclude=crontab.in --exclude=mm_cfg.py.dist --exclude=*.pyc --exclude=.*.tmp --exclude=config.* mailman/Mailman/Archiver/Archiver.py mailman-archiving/Mailman/Archiver/Archiver.py --- mailman/Mailman/Archiver/Archiver.py Thu Jul 1 13:59:51 1999 +++ mailman-archiving/Mailman/Archiver/Archiver.py Tue Aug 3 09:46:14 1999 @@ -29,6 +29,7 @@ import sys, os, string import errno from Mailman.Utils import reraise, mkdir +import regsub # # package/project modules @@ -174,6 +175,13 @@ # Resurrect original date setting. post.SetHeader('Date', olddate) + def ExternalArchive(self, ar, txt): + regsub.gsub("\$LISTNAME\>", self.real_name, ar) + regsub.gsub("\${LISTNAME}", self.real_name, ar) + extarch = os.popen(ar, "w") + extarch.write(txt) + extarch.close() + # # archiving in real time this is called from list.post(msg) # @@ -207,6 +215,16 @@ if line and line[:5] == 'From ': line = '>' + line txt = txt + "%s\n" % line + if not self.archive_private \ + and mm_cfg.PUBLIC_EXTERNAL_ARCHIVER is not "" and \ + mm_cfg.PUBLIC_EXTERNAL_ARCHIVER is not "pipermail": + ExternalArchive(mm_cfg.PUBLIC_EXTERNAL_ARCHIVER, txt) + os._exit(0) + if self.archive_private \ + and mm_cfg.PRIVATE_EXTERNAL_ARCHIVER is not "" and \ + mm_cfg.PRIVATE_EXTERNAL_ARCHIVER is not "pipermail": + ExternalArchive(mm_cfg.PRIVATE_EXTERNAL_ARCHIVER, txt) + os._exit(0) f = StringIO(txt) import HyperArch h = HyperArch.HyperArchive(self) diff -Nru --exclude=CVS --exclude=Makefile --exclude=crontab.in --exclude=mm_cfg.py.dist --exclude=*.pyc --exclude=.*.tmp --exclude=config.* mailman/Mailman/Defaults.py mailman-archiving/Mailman/Defaults.py --- mailman/Mailman/Defaults.py Wed Aug 4 10:16:26 1999 +++ mailman-archiving/Mailman/Defaults.py Tue Aug 3 09:14:44 1999 @@ -62,6 +62,8 @@ # DEFAULT_ARCHIVE_VOLUME_FREQUENCY = 1 +PUBLIC_EXTERNAL_ARCHIVER = "" +PRIVATE_EXTERNAL_ARCHIVER = "" HOME_PAGE = 'index.html' MAILMAN_OWNER = 'mailman-owner@%s' % DEFAULT_HOST_NAME diff -Nru --exclude=CVS --exclude=Makefile --exclude=crontab.in --exclude=mm_cfg.py.dist --exclude=*.pyc --exclude=.*.tmp --exclude=config.* mailman/Mailman/Defaults.py.in mailman-archiving/Mailman/Defaults.py.in --- mailman/Mailman/Defaults.py.in Mon Aug 2 11:42:20 1999 +++ mailman-archiving/Mailman/Defaults.py.in Tue Aug 3 09:15:02 1999 @@ -62,6 +62,8 @@ # DEFAULT_ARCHIVE_VOLUME_FREQUENCY = 1 +PUBLIC_EXTERNAL_ARCHIVER = "" +PRIVATE_EXTERNAL_ARCHIVER = "" HOME_PAGE = 'index.html' MAILMAN_OWNER = 'mailman-owner@%s' % DEFAULT_HOST_NAME

"PH" == Paul Hebble <hebble@ncsa.uiuc.edu> writes:
PH> This patch should let the administrator specify alternative
PH> external archivers. All you have to do is set the
PH> PUBLIC_EXTERNAL_ARCHIVER and/or PRIVATE_EXTERNAL_ARCHIVER
PH> variables to the command line you wish to use. If you put
PH> "$LISTNAME" or "${LISTNAME}" in the command line, it is
PH> replaced with the name of the list. Mailman will run the
PH> command line and pipe each post to it.
PH> The main advantage to this is that all post filtering is done
PH> without having to subscribe a procmailrc to the list. This
PH> prevents list-admins from accidentally unsubscribing the
PH> archiver.
PH> If the variables given above are set to "" (the default),
PH> Mailman will fall back to the built-in Pipermail archiver, so
PH> this should not break any existing installations.
Paul, I'd like to install this patch but have a couple of suggestions. First (and I apologize for not looking at it closer), I'd like to use any false value -- None or 0 would be preferrable -- to indicate use-the-internal-archiver. Maybe your patch already supports that.
Second...
PH> My apologies for using regsub, but I have not been able to
PH> find enough documentation on the re module. Perhaps someone
PH> better acquainted with it could migrate this patch to it?
I'm sorry I don't have the time to port to re module. Do you think you'd be able to do it? I'd rather not include new dependencies on regsub, which is deprecated and may someday go away.
Here's documentation on re:
http://www.python.org/doc/current/lib/module-re.html
If you do port to re, please resubmit the patch against the CVS snapshot and I'd be very happy to install it.
Thanks, -Barry

"PH" == Paul Hebble <hebble@ncsa.uiuc.edu> writes:
PH> This patch should let the administrator specify alternative
PH> external archivers. All you have to do is set the
PH> PUBLIC_EXTERNAL_ARCHIVER and/or PRIVATE_EXTERNAL_ARCHIVER
PH> variables to the command line you wish to use. If you put
PH> "$LISTNAME" or "${LISTNAME}" in the command line, it is
PH> replaced with the name of the list. Mailman will run the
PH> command line and pipe each post to it.
PH> The main advantage to this is that all post filtering is done
PH> without having to subscribe a procmailrc to the list. This
PH> prevents list-admins from accidentally unsubscribing the
PH> archiver.
PH> If the variables given above are set to "" (the default),
PH> Mailman will fall back to the built-in Pipermail archiver, so
PH> this should not break any existing installations.
Paul, I'd like to install this patch but have a couple of suggestions. First (and I apologize for not looking at it closer), I'd like to use any false value -- None or 0 would be preferrable -- to indicate use-the-internal-archiver. Maybe your patch already supports that.
Second...
PH> My apologies for using regsub, but I have not been able to
PH> find enough documentation on the re module. Perhaps someone
PH> better acquainted with it could migrate this patch to it?
I'm sorry I don't have the time to port to re module. Do you think you'd be able to do it? I'd rather not include new dependencies on regsub, which is deprecated and may someday go away.
Here's documentation on re:
http://www.python.org/doc/current/lib/module-re.html
If you do port to re, please resubmit the patch against the CVS snapshot and I'd be very happy to install it.
Thanks, -Barry
participants (2)
-
Barry A. Warsaw
-
Paul Hebble