summaryrefslogtreecommitdiff
path: root/Mailman/inject.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/inject.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/inject.py')
-rw-r--r--Mailman/inject.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/Mailman/inject.py b/Mailman/inject.py
new file mode 100644
index 000000000..a17f8c7d1
--- /dev/null
+++ b/Mailman/inject.py
@@ -0,0 +1,34 @@
+# Copyright (C) 2001-2008 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.
+
+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 = dict(
+ listname=listname,
+ tolist=True,
+ _plaintext=True,
+ )
+ if recips is not None:
+ kws['recips'] = recips
+ queue.enqueue(msg, **kws)