summaryrefslogtreecommitdiff
path: root/Mailman/Post.py
diff options
context:
space:
mode:
authorBarry Warsaw2008-02-02 11:18:22 -0500
committerBarry Warsaw2008-02-02 11:18:22 -0500
commitd865604398932718dab761f3fb4f56c3a18d25b8 (patch)
treecf23973abf75c3cc799382dd6ad3b6d2a3702042 /Mailman/Post.py
parent497bb9b9186fb8e61a4d1893cc706dc297c94511 (diff)
downloadmailman-d865604398932718dab761f3fb4f56c3a18d25b8.tar.gz
mailman-d865604398932718dab761f3fb4f56c3a18d25b8.tar.zst
mailman-d865604398932718dab761f3fb4f56c3a18d25b8.zip
Convert IncomingRunner to use the new chains disposition architecture. move
the big explanatory text at the beginning of incoming.py to a doctest called OVERVIEW.tt (which doesn't actually contain any tests yet -- it's documentation though). Added a doctest for the incoming runner, though this will be fleshed out in more detail next. Mailman.Post renamed to Mailman.inject, and simplified. We don't need its command line script behavior because that is now handled by bin/inject. Add a 'start_chain' attribute to mailing lists. This names the chain that processing of messages for that list begins with. We were inconsistent in the use of the 'no reply' address attribute. It's now always 'no_reply_address'. Update the smtplistener helper with lessons learned about how to suppress bogus asyncore error messages. Also, switch to using a maildir mailbox instead of an mbox mailbox.
Diffstat (limited to 'Mailman/Post.py')
-rw-r--r--Mailman/Post.py62
1 files changed, 0 insertions, 62 deletions
diff --git a/Mailman/Post.py b/Mailman/Post.py
deleted file mode 100644
index 50b9628a0..000000000
--- a/Mailman/Post.py
+++ /dev/null
@@ -1,62 +0,0 @@
-#! /usr/bin/env python
-#
-# Copyright (C) 2001-2007 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.
-
-import sys
-
-from Mailman.configuration import config
-from Mailman.queue import Switchboard
-
-
-
-def inject(listname, msg, recips=None, qdir=None):
- if qdir is None:
- qdir = config.INQUEUE_DIR
- queue = Switchboard(qdir)
- kws = {'listname' : listname,
- 'tolist' : 1,
- '_plaintext': 1,
- }
- if recips:
- kws['recips'] = recips
- queue.enqueue(msg, **kws)
-
-
-
-if __name__ == '__main__':
- # When called as a command line script, standard input is read to get the
- # list that this message is destined to, the list of explicit recipients,
- # and the message to send (in its entirety). stdin must have the
- # following format:
- #
- # line 1: the internal name of the mailing list
- # line 2: the number of explicit recipients to follow. 0 means to use the
- # list's membership to calculate recipients.
- # line 3 - 3+recipnum: explicit recipients, one per line
- # line 4+recipnum - end of file: the message in RFC 822 format (may
- # include an initial Unix-from header)
- listname = sys.stdin.readline().strip()
- numrecips = int(sys.stdin.readline())
- if numrecips == 0:
- recips = None
- else:
- recips = []
- for i in range(numrecips):
- recips.append(sys.stdin.readline().strip())
- # If the message isn't parsable, we won't get an error here
- inject(listname, sys.stdin.read(), recips)