diff options
| author | Barry Warsaw | 2009-01-20 20:54:22 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2009-01-20 20:54:22 -0500 |
| commit | f6cfc823e94fdc67114534ffa4e0e058d6ee81b8 (patch) | |
| tree | dae9158dfd05fd92b18d576f57b78e906196a42b /mailman/bin | |
| parent | 0c996b693d1cc68d864acc313ba919197717a413 (diff) | |
| download | mailman-f6cfc823e94fdc67114534ffa4e0e058d6ee81b8.tar.gz mailman-f6cfc823e94fdc67114534ffa4e0e058d6ee81b8.tar.zst mailman-f6cfc823e94fdc67114534ffa4e0e058d6ee81b8.zip | |
More cleanup.
Diffstat (limited to 'mailman/bin')
| -rw-r--r-- | mailman/bin/bounces.py | 61 | ||||
| -rw-r--r-- | mailman/bin/confirm.py | 63 | ||||
| -rw-r--r-- | mailman/bin/join.py | 63 | ||||
| -rw-r--r-- | mailman/bin/leave.py | 62 | ||||
| -rw-r--r-- | mailman/bin/owner.py | 68 | ||||
| -rw-r--r-- | mailman/bin/post.py | 71 | ||||
| -rw-r--r-- | mailman/bin/request.py | 65 | ||||
| -rw-r--r-- | mailman/bin/update.py | 5 |
8 files changed, 3 insertions, 455 deletions
diff --git a/mailman/bin/bounces.py b/mailman/bin/bounces.py deleted file mode 100644 index e5e4e16b6..000000000 --- a/mailman/bin/bounces.py +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright (C) 2001-2009 by the Free Software Foundation, Inc. -# -# This file is part of GNU Mailman. -# -# GNU Mailman 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 3 of the License, or (at your option) -# any later version. -# -# GNU Mailman 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 -# GNU Mailman. If not, see <http://www.gnu.org/licenses/>. - -"""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 - -from mailman import Utils -from mailman import loginit -from mailman.configuration import config -from mailman.i18n import _ -from mailman.queue import Switchboard - - - -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')) - 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 = Switchboard(config.BOUNCEQUEUE_DIR) - bounceq.enqueue(sys.stdin.read(), listname=listname, _plaintext=True) - - - -if __name__ == '__main__': - main() diff --git a/mailman/bin/confirm.py b/mailman/bin/confirm.py deleted file mode 100644 index c3f1d49f6..000000000 --- a/mailman/bin/confirm.py +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright (C) 2002-2009 by the Free Software Foundation, Inc. -# -# This file is part of GNU Mailman. -# -# GNU Mailman 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 3 of the License, or (at your option) -# any later version. -# -# GNU Mailman 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 -# GNU Mailman. If not, see <http://www.gnu.org/licenses/>. - -"""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 - -from mailman import Utils -from mailman import loginit -from mailman.configuration import config -from mailman.i18n import _ -from mailman.queue import Switchboard - - - -def main(): - config.load() - # 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')) - 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 = Switchboard(config.CMDQUEUE_DIR) - cmdq.enqueue(sys.stdin.read(), listname=listname, - toconfirm=True, _plaintext=True) - - - -if __name__ == '__main__': - main() diff --git a/mailman/bin/join.py b/mailman/bin/join.py deleted file mode 100644 index 29ae4c752..000000000 --- a/mailman/bin/join.py +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright (C) 2001-2009 by the Free Software Foundation, Inc. -# -# This file is part of GNU Mailman. -# -# GNU Mailman 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 3 of the License, or (at your option) -# any later version. -# -# GNU Mailman 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 -# GNU Mailman. If not, see <http://www.gnu.org/licenses/>. - -"""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 - -from mailman import Utils -from mailman import loginit -from mailman.configuration import config -from mailman.i18n import _ -from mailman.queue import Switchboard - - - -def main(): - config.load() - # 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')) - 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 = Switchboard(config.CMDQUEUE_DIR) - cmdq.enqueue(sys.stdin.read(), listname=listname, - tojoin=True, _plaintext=True) - - - -if __name__ == '__main__': - main() diff --git a/mailman/bin/leave.py b/mailman/bin/leave.py deleted file mode 100644 index 64f4f01c5..000000000 --- a/mailman/bin/leave.py +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright (C) 2001-2009 by the Free Software Foundation, Inc. -# -# This file is part of GNU Mailman. -# -# GNU Mailman 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 3 of the License, or (at your option) -# any later version. -# -# GNU Mailman 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 -# GNU Mailman. If not, see <http://www.gnu.org/licenses/>. - -"""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 - -from mailman import Utils -from mailman import loginit -from mailman.configuration import config -from mailman.i18n import _ -from mailman.queue import Switchboard - - - -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')) - 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 = Switchboard(config.CMDQUEUE_DIR) - cmdq.enqueue(sys.stdin.read(), listname=listname, - toleave=True, _plaintext=True) - - - -if __name__ == '__main__': - main() diff --git a/mailman/bin/owner.py b/mailman/bin/owner.py deleted file mode 100644 index e7c40b7e5..000000000 --- a/mailman/bin/owner.py +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright (C) 1998-2009 by the Free Software Foundation, Inc. -# -# This file is part of GNU Mailman. -# -# GNU Mailman 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 3 of the License, or (at your option) -# any later version. -# -# GNU Mailman 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 -# GNU Mailman. If not, see <http://www.gnu.org/licenses/>. - -"""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 - -from mailman import Utils -from mailman import loginit -from mailman.configuration import config -from mailman.i18n import _ -from mailman.queue import Switchboard - - - -def main(): - config.load() - # 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(_('owner script got no listname.')) - sys.exit(1) - # Make sure the list exists - if not Utils.list_exists(listname): - log.error(_('owner script, list not found: $listname')) - 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 = Switchboard(config.INQUEUE_DIR) - inq.enqueue(sys.stdin.read(), - listname=listname, - _plaintext=True, - pipeline=config.OWNER_PIPELINE, - toowner=True) - - - -if __name__ == '__main__': - main() diff --git a/mailman/bin/post.py b/mailman/bin/post.py deleted file mode 100644 index 8511d52dc..000000000 --- a/mailman/bin/post.py +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright (C) 1998-2009 by the Free Software Foundation, Inc. -# -# This file is part of GNU Mailman. -# -# GNU Mailman 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 3 of the License, or (at your option) -# any later version. -# -# GNU Mailman 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 -# GNU Mailman. If not, see <http://www.gnu.org/licenses/>. - -"""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 - -from mailman import Utils -from mailman import loginit -from mailman.configuration import config -from mailman.i18n import _ -from mailman.queue import Switchboard - - - -def main(): - config.load() - # 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')) - 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 = Switchboard(config.INQUEUE_DIR) - inq.enqueue(sys.stdin.read(), - listname=listname, - tolist=True, _plaintext=True) - - - -if __name__ == '__main__': - main() diff --git a/mailman/bin/request.py b/mailman/bin/request.py deleted file mode 100644 index af62b4f51..000000000 --- a/mailman/bin/request.py +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright (C) 1998-2009 by the Free Software Foundation, Inc. -# -# This file is part of GNU Mailman. -# -# GNU Mailman 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 3 of the License, or (at your option) -# any later version. -# -# GNU Mailman 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 -# GNU Mailman. If not, see <http://www.gnu.org/licenses/>. - -"""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 - -from mailman import Utils -from mailman import loginit -from mailman.configuration import config -from mailman.i18n import _ -from mailman.queue import Switchboard - - - -def main(): - config.load() - # 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(_('request script got no listname.')) - sys.exit(1) - # Make sure the list exists - if not Utils.list_exists(listname): - log.error(_('request script, list not found: $listname')) - 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 = Switchboard(config.CMDQUEUE_DIR) - cmdq.enqueue(sys.stdin.read(), - listname=listname, - torequest=True, - _plaintext=True) - - - -if __name__ == '__main__': - main() diff --git a/mailman/bin/update.py b/mailman/bin/update.py index d26548aa0..34ea6cda3 100644 --- a/mailman/bin/update.py +++ b/mailman/bin/update.py @@ -39,6 +39,7 @@ from mailman.Queue.Switchboard import Switchboard from mailman.configuration import config from mailman.i18n import _ from mailman.initialize import initialize +from mailman.utilities.filesystem import makedirs FRESH = 0 @@ -251,7 +252,7 @@ def dolist(listname): o_html_dir = makeabs('public_html/archives/%s' % (listname)) # Make the mbox directory if it's not there. if not os.path.exists(mbox_dir): - Utils.makedirs(mbox_dir) + makedirs(mbox_dir) else: # This shouldn't happen, but hey, just in case if not os.path.isdir(mbox_dir): @@ -259,7 +260,7 @@ def dolist(listname): For some reason, $mbox_dir exists as a file. This won't work with b6, so I'm renaming it to ${mbox_dir}.tmp and proceeding.""") os.rename(mbox_dir, "%s.tmp" % (mbox_dir)) - Utils.makedirs(mbox_dir) + makedirs(mbox_dir) # Move any existing mboxes around, but watch out for both a public and a # private one existing if os.path.isfile(o_pri_mbox_file) and os.path.isfile(o_pub_mbox_file): |
