Clean up the mta directory.
[mailman.git] / src / mailman / runners / pipeline.py
blobb7ea7fa342b69343ccf300e61c450789de2813eb
1 # Copyright (C) 2008-2016 by the Free Software Foundation, Inc.
3 # This file is part of GNU Mailman.
5 # GNU Mailman is free software: you can redistribute it and/or modify it under
6 # the terms of the GNU General Public License as published by the Free
7 # Software Foundation, either version 3 of the License, or (at your option)
8 # any later version.
10 # GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 # more details.
15 # You should have received a copy of the GNU General Public License along with
16 # GNU Mailman. If not, see <http://www.gnu.org/licenses/>.
18 """The pipeline runner.
20 This runner's purpose is to take messages that have been approved for posting
21 through the 'preparation pipeline'. This pipeline adds, deletes and modifies
22 headers, calculates message recipients, and more.
23 """
25 __all__ = [
26 'PipelineRunner',
30 from mailman.core.pipelines import process
31 from mailman.core.runner import Runner
35 class PipelineRunner(Runner):
36 def _dispose(self, mlist, msg, msgdata):
37 # Process the message through the mailing list's pipeline.
38 pipeline = (mlist.owner_pipeline
39 if msgdata.get('to_owner', False)
40 else mlist.posting_pipeline)
41 process(mlist, msg, msgdata, pipeline)
42 # Do not keep this message queued.
43 return False