diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/Makefile.in | 66 | ||||
| -rw-r--r-- | scripts/bounces | 64 | ||||
| -rwxr-xr-x | scripts/confirm | 65 | ||||
| -rw-r--r-- | scripts/driver | 2 | ||||
| -rwxr-xr-x | scripts/join | 65 | ||||
| -rwxr-xr-x | scripts/leave | 65 | ||||
| -rwxr-xr-x | scripts/owner | 71 | ||||
| -rwxr-xr-x | scripts/post | 73 | ||||
| -rwxr-xr-x | scripts/request | 67 |
9 files changed, 38 insertions, 500 deletions
diff --git a/scripts/Makefile.in b/scripts/Makefile.in index 49b82ec0e..14692b8e3 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -1,57 +1,57 @@ -# Copyright (C) 1998-2003 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2006 by the Free Software Foundation, Inc. # # 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -# NOTE: Makefile.in is converted into Makefile by the configure script -# in the parent directory. Once configure has run, you can recreate -# the Makefile by running just config.status. +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. # Variables set by configure -VPATH= @srcdir@ -srcdir= @srcdir@ -bindir= @bindir@ -prefix= @prefix@ -exec_prefix= @exec_prefix@ +VPATH= @srcdir@ +srcdir= @srcdir@ +bindir= @bindir@ +prefix= @prefix@ +exec_prefix= @exec_prefix@ DESTDIR= -CC= @CC@ -CHMOD= @CHMOD@ -INSTALL= @INSTALL@ +CC= @CC@ +CHMOD= @CHMOD@ +INSTALL= @INSTALL@ +LN_S= @LN_S@ -DEFS= @DEFS@ +DEFS= @DEFS@ # Customizable but not set by configure -OPT= @OPT@ -CFLAGS= $(OPT) $(DEFS) -SCRIPTSDIR= $(prefix)/scripts +OPT= @OPT@ +CFLAGS= $(OPT) $(DEFS) +SCRIPTSDIR= $(prefix)/scripts +BINDIR= ../bin -SHELL= /bin/sh +SHELL= /bin/sh # Note that `admin' is a backwards compatible alias for `bounces' # 'subscribe' is an alias for join # 'unsubscribe' is an alias for leave -SCRIPTS= bounces confirm driver join leave owner post request +SCRIPTS= driver +LN_SCRIPTS= bounces confirm join leave owner post request # Modes for directories and executables created by the install # process. Default to group-writable directories but # user-only-writable for executables. -DIRMODE= 775 -EXEMODE= 755 -FILEMODE= 644 +DIRMODE= 775 +EXEMODE= 755 +FILEMODE= 644 INSTALL_PROGRAM=$(INSTALL) -m $(EXEMODE) @@ -64,9 +64,17 @@ install: do \ $(INSTALL) -m $(FILEMODE) $(srcdir)/$$f $(DESTDIR)$(SCRIPTSDIR); \ done - $(INSTALL) -m $(FILEMODE) $(srcdir)/bounces $(DESTDIR)$(SCRIPTSDIR)/admin - $(INSTALL) -m $(FILEMODE) $(srcdir)/join $(DESTDIR)$(SCRIPTSDIR)/subscribe - $(INSTALL) -m $(FILEMODE) $(srcdir)/leave $(DESTDIR)$(SCRIPTSDIR)/unsubscribe + for f in $(LN_SCRIPTS); \ + do \ + rm -f $(DESTDIR)$(SCRIPTSDIR)/$$f; \ + (cd $(DESTDIR)$(SCRIPTSDIR); $(LN_S) $(BINDIR)/mmshell $$f); \ + done + rm -f $(DESTDIR)$(SCRIPTSDIR)/admin + (cd $(DESTDIR)$(SCRIPTSDIR); $(LN_S) $(BINDIR)/mmshell admin) + rm -f $(DESTDIR)$(SCRIPTSDIR)/subscribe + (cd $(DESTDIR)$(SCRIPTSDIR); $(LN_S) $(BINDIR)/mmshell subscribe) + rm -f $(DESTDIR)$(SCRIPTSDIR)/unsubscribe + (cd $(DESTDIR)$(SCRIPTSDIR); $(LN_S) $(BINDIR)/mmshell unsubscribe) finish: diff --git a/scripts/bounces b/scripts/bounces deleted file mode 100644 index 6fa0f56b9..000000000 --- a/scripts/bounces +++ /dev/null @@ -1,64 +0,0 @@ -# -*- python -*- -# -# Copyright (C) 2001-2006 by the Free Software Foundation, Inc. -# -# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -# USA. - -"""Process VERP'd bounces. - -Called by the wrapper, stdin is the mail message, and argv[1] is the name -of the target mailing list. - -Errors are redirected to logs/error. -""" - -import sys -import logging - -import paths -from Mailman import Utils -from Mailman import mm_cfg -from Mailman import loginit -from Mailman.Queue.sbcache import get_switchboard -from Mailman.i18n import _ - - - -def main(): - # Setup logging to stderr stream and error log. - loginit.initialize(propagate=True) - log = logging.getLogger('mailman.error') - try: - listname = sys.argv[1] - except IndexError: - log.error(_('bounces script got no listname.')) - sys.exit(1) - # Make sure the list exists - if not Utils.list_exists(listname): - log.error(_('bounces script, list not found: %(listname)s')) - sys.exit(1) - # Immediately queue the message for the bounces qrunner to process. The - # advantage to this approach is that messages should never get lost -- - # some MTAs have a hard limit to the time a filter prog can run. Postfix - # is a good example; if the limit is hit, the proc is SIGKILL'd giving us - # no chance to save the message. - bounceq = get_switchboard(mm_cfg.BOUNCEQUEUE_DIR) - bounceq.enqueue(sys.stdin.read(), listname=listname, _plaintext=True) - - - -if __name__ == '__main__': - main() diff --git a/scripts/confirm b/scripts/confirm deleted file mode 100755 index b5a62dd46..000000000 --- a/scripts/confirm +++ /dev/null @@ -1,65 +0,0 @@ -# -*- python -*- -# -# Copyright (C) 2002-2006 by the Free Software Foundation, Inc. -# -# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -# USA. - -"""Simple confirm via VERP-ish sender. - -Called by the wrapper, stdin is the mail message, and argv[1] is the name -of the target mailing list. - -Errors are redirected to logs/error. -""" - -import sys -import logging - -import paths -from Mailman import Utils -from Mailman import mm_cfg -from Mailman import loginit -from Mailman.Queue.sbcache import get_switchboard -from Mailman.i18n import _ - - - -def main(): - # Setup logging to stderr stream and error log. - loginit.initialize(propagate=True) - log = logging.getLogger('mailman.error') - try: - listname = sys.argv[1] - except IndexError: - log.error(_('confirm script got no listname.')) - sys.exit(1) - # Make sure the list exists - if not Utils.list_exists(listname): - log.error(_('confirm script, list not found: %(listname)s')) - sys.exit(1) - # Immediately queue the message for the bounce/cmd qrunner to process. - # The advantage to this approach is that messages should never get lost -- - # some MTAs have a hard limit to the time a filter prog can run. Postfix - # is a good example; if the limit is hit, the proc is SIGKILL'd giving us - # no chance to save the message. - cmdq = get_switchboard(mm_cfg.CMDQUEUE_DIR) - cmdq.enqueue(sys.stdin.read(), listname=listname, - toconfirm=True, _plaintext=True) - - - -if __name__ == '__main__': - main() diff --git a/scripts/driver b/scripts/driver index 08bee07bd..20cbece10 100644 --- a/scripts/driver +++ b/scripts/driver @@ -29,7 +29,7 @@ import sys # comfortable with. By setting STEALTH_MODE to True, you disable the printing # of this information to the web pages. This information is still, and # always, printed in the error logs. -STEALTH_MODE = True +STEALTH_MODE = False # This will be set to the entity escaper. def websafe(s): diff --git a/scripts/join b/scripts/join deleted file mode 100755 index b378cc316..000000000 --- a/scripts/join +++ /dev/null @@ -1,65 +0,0 @@ -# -*- python -*- -# -# Copyright (C) 2001-2006 by the Free Software Foundation, Inc. -# -# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -# USA. - -"""Simple join-a-list email address. - -Called by the wrapper, stdin is the mail message, and argv[1] is the name -of the target mailing list. - -Errors are redirected to logs/error. -""" - -import sys -import logging - -import paths -from Mailman import Utils -from Mailman import mm_cfg -from Mailman import loginit -from Mailman.Queue.sbcache import get_switchboard -from Mailman.i18n import _ - - - -def main(): - # Setup logging to stderr stream and error log. - loginit.initialize(propagate=True) - log = logging.getLogger('mailman.error') - try: - listname = sys.argv[1] - except IndexError: - log.error(_('join script got no listname.')) - sys.exit(1) - # Make sure the list exists - if not Utils.list_exists(listname): - log.error(_('join script, list not found: %(listname)s')) - sys.exit(1) - # Immediately queue the message for the bounce/cmd qrunner to process. - # The advantage to this approach is that messages should never get lost -- - # some MTAs have a hard limit to the time a filter prog can run. Postfix - # is a good example; if the limit is hit, the proc is SIGKILL'd giving us - # no chance to save the message. - cmdq = get_switchboard(mm_cfg.CMDQUEUE_DIR) - cmdq.enqueue(sys.stdin.read(), listname=listname, - tojoin=True, _plaintext=True) - - - -if __name__ == '__main__': - main() diff --git a/scripts/leave b/scripts/leave deleted file mode 100755 index 627c440df..000000000 --- a/scripts/leave +++ /dev/null @@ -1,65 +0,0 @@ -# -*- python -*- -# -# Copyright (C) 2001-2006 by the Free Software Foundation, Inc. -# -# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -# USA. - -"""Simple leave-a-list email address. - -Called by the wrapper, stdin is the mail message, and argv[1] is the name -of the target mailing list. - -Errors are redirected to logs/error. -""" - -import sys -import logging - -import paths -from Mailman import Utils -from Mailman import mm_cfg -from Mailman import loginit -from Mailman.Queue.sbcache import get_switchboard -from Mailman.i18n import _ - - - -def main(): - # Setup logging to stderr stream and error log. - loginit.initialize(propagate=True) - log = logging.getLogger('mailman.error') - try: - listname = sys.argv[1] - except IndexError: - log.error(_('leave script got no listname.')) - sys.exit(1) - # Make sure the list exists - if not Utils.list_exists(listname): - log.error(_('leave script, list not found: %(listname)s')) - sys.exit(1) - # Immediately queue the message for the bounce/cmd qrunner to process. - # The advantage to this approach is that messages should never get lost -- - # some MTAs have a hard limit to the time a filter prog can run. Postfix - # is a good example; if the limit is hit, the proc is SIGKILL'd giving us - # no chance to save the message. - cmdq = get_switchboard(mm_cfg.CMDQUEUE_DIR) - cmdq.enqueue(sys.stdin.read(), listname=listname, - toleave=True, _plaintext=True) - - - -if __name__ == '__main__': - main() diff --git a/scripts/owner b/scripts/owner deleted file mode 100755 index 82921880e..000000000 --- a/scripts/owner +++ /dev/null @@ -1,71 +0,0 @@ -# -*- python -*- -# -# Copyright (C) 1998-2006 by the Free Software Foundation, Inc. -# -# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -# USA. - -"""Send a message to the mailing list owner. - -All messages to a list's -owner address should be piped through this script. -The -owner address is defined to be delivered directly to the list owners plus -the list moderators, with no intervention for bounce processing. - -Stdin is the mail message, and argv[1] is the name of the target mailing list. - -Errors are redirected to logs/error. -""" - -import sys -import logging - -import paths -from Mailman import Utils -from Mailman import mm_cfg -from Mailman import loginit -from Mailman.Queue.sbcache import get_switchboard -from Mailman.i18n import _ - - - -def main(): - # Setup logging to stderr stream and error log. - loginit.initialize(propagate=True) - log = logging.getLogger('mailman.error') - try: - listname = sys.argv[1] - except IndexError: - log.error(_('mailowner script got no listname.')) - sys.exit(1) - # Make sure the list exists - if not Utils.list_exists(listname): - log.error(_('mailowner script, list not found: %(listname)s')) - sys.exit(1) - # Queue the message for the owners. We will send them through the - # incoming queue because we need some processing done on the message. The - # processing is minimal though, so craft our own pipeline, expressly for - # the purpose of delivering to the list owners. - inq = get_switchboard(mm_cfg.INQUEUE_DIR) - inq.enqueue(sys.stdin.read(), - listname=listname, - _plaintext=True, - envsender=Utils.get_site_email(extra='bounces'), - pipeline=mm_cfg.OWNER_PIPELINE, - toowner=True) - - - -if __name__ == '__main__': - main() diff --git a/scripts/post b/scripts/post deleted file mode 100755 index 0f5b268ec..000000000 --- a/scripts/post +++ /dev/null @@ -1,73 +0,0 @@ -# -*- python -*- -# -# Copyright (C) 1998-2006 by the Free Software Foundation, Inc. -# -# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -# USA. - -"""Accept posts to a list and handle them properly. - -The main advertised address for a list should be filtered to this program, -through the mail wrapper. E.g. for list `test@yourdomain.com', the `test' -alias would deliver to this script. - -Stdin is the mail message, and argv[1] is the name of the target mailing list. - -Errors are redirected to logs/error. -""" - -import sys -import logging - -import paths -from Mailman import Utils -from Mailman import mm_cfg -from Mailman import loginit -from Mailman.Queue.sbcache import get_switchboard -from Mailman.i18n import _ - - - -def main(): - # Setup logging to stderr stream and error log. - loginit.initialize(propagate=True) - log = logging.getLogger('mailman.error') - # XXX If you've configured your list or aliases so poorly as to get either - # of these first two errors, there's little that can be done to save your - # messages. They will be lost. Minimal testing of new lists should avoid - # either of these problems. - try: - listname = sys.argv[1] - except IndexError: - log.error(_('post script got no listname.')) - sys.exit(1) - # Make sure the list exists - if not Utils.list_exists(listname): - log.error(_('post script, list not found: %(listname)s')) - sys.exit(1) - # Immediately queue the message for the incoming qrunner to process. The - # advantage to this approach is that messages should never get lost -- - # some MTAs have a hard limit to the time a filter prog can run. Postfix - # is a good example; if the limit is hit, the proc is SIGKILL'd giving us - # no chance to save the message. - inq = get_switchboard(mm_cfg.INQUEUE_DIR) - inq.enqueue(sys.stdin.read(), - listname=listname, - tolist=True, _plaintext=True) - - - -if __name__ == '__main__': - main() diff --git a/scripts/request b/scripts/request deleted file mode 100755 index 70ee8c7f4..000000000 --- a/scripts/request +++ /dev/null @@ -1,67 +0,0 @@ -# -*- python -*- -# -# Copyright (C) 1998-2006 by the Free Software Foundation, Inc. -# -# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -# USA. - -"""Process emailed commands. - -Called by the wrapper, stdin is the mail message, and argv[1] is the name -of the target mailing list. - -Errors are redirected to logs/error. -""" - -import sys -import logging - -import paths -from Mailman import Utils -from Mailman import mm_cfg -from Mailman import loginit -from Mailman.Queue.sbcache import get_switchboard -from Mailman.i18n import _ - - - -def main(): - # Setup logging to stderr stream and error log. - loginit.initialize(propagate=True) - log = logging.getLogger('mailman.error') - try: - listname = sys.argv[1] - except IndexError: - log.error(_('mailcmd script got no listname.')) - sys.exit(1) - # Make sure the list exists - if not Utils.list_exists(listname): - log.error(_('mailcmd script, list not found: %(listname)s')) - sys.exit(1) - # Immediately queue the message for the bounce/cmd qrunner to process. - # The advantage to this approach is that messages should never get lost -- - # some MTAs have a hard limit to the time a filter prog can run. Postfix - # is a good example; if the limit is hit, the proc is SIGKILL'd giving us - # no chance to save the message. - cmdq = get_switchboard(mm_cfg.CMDQUEUE_DIR) - cmdq.enqueue(sys.stdin.read(), - listname=listname, - torequest=True, - _plaintext=True) - - - -if __name__ == '__main__': - main() |
