1 # Copyright (C) 2009-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)
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
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 """MIME content filtering."""
21 from mailman
import public
22 from zope
.interface
import Attribute
, Interface
26 class FilterAction(Enum
):
27 # Discard a message that matches the content type filter.
29 # Bounce the message back to the original author.
31 # Discard and forward the message on to the list owner.
33 # Discard, but preserve it.
38 class FilterType(Enum
):
43 # Filter file extension.
45 # Pass file extension.
50 class IContentFilter(Interface
):
51 """A single content filter settings for a mailing list."""
53 mailing_list
= Attribute(
54 """The mailing list for this content filter.""")
56 filter_pattern
= Attribute(
57 """The filter/pass content pattern.""")
59 filter_type
= Attribute(
60 """Type of filter.""")