3
# Copyright (C) 2002 by the Free Software Foundation, Inc.
3
# Copyright (C) 2002-2007 by the Free Software Foundation, Inc.
5
5
# This program is free software; you can redistribute it and/or
6
6
# modify it under the terms of the GNU General Public License
7
7
# as published by the Free Software Foundation; either version 2
8
8
# of the License, or (at your option) any later version.
10
10
# This program is distributed in the hope that it will be useful,
11
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
13
# GNU General Public License for more details.
15
15
# You should have received a copy of the GNU General Public License
16
# along with this program; if not, write to the Free Software
17
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16
# along with this program; if not, write to the Free Software
17
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19
20
"""Inject a message from a file into Mailman's incoming queue.
82
83
if not os.path.isdir(qdir):
83
84
usage(1, _('Bad queue directory: %(qdir)s'))
84
85
elif opt in ('-l', '--listname'):
86
listname = arg.lower()
87
88
if listname is None:
88
89
usage(1, _('A list name is required'))
89
90
elif not Utils.list_exists(listname):
90
91
usage(1, _('No such list: %(listname)s'))
93
94
# Use standard input
94
95
msgtext = sys.stdin.read()