1# Copyright (C) 2006-2020 by the Free Software Foundation, Inc.
2#
3# This file is part of GNU Mailman.
4#
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.
9#
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.
14#
15# You should have received a copy of the GNU General Public License along with
16# GNU Mailman.  If not, see <https://www.gnu.org/licenses/>.
17
18"""Various constants and enumerations."""
19
20from mailman.config import config
21from mailman.interfaces.languages import ILanguageManager
22from mailman.interfaces.member import DeliveryMode, DeliveryStatus
23from mailman.interfaces.preferences import IPreferences
24from public import public
25from zope.component import getUtility
26from zope.interface import implementer
27
28
29@implementer(IPreferences)
30class SystemDefaultPreferences:
31    """The default system preferences."""
32
33    acknowledge_posts = False
34    hide_address = True
35    receive_list_copy = True
36    receive_own_postings = True
37    delivery_mode = DeliveryMode.regular
38    delivery_status = DeliveryStatus.enabled
39
40    @property
41    def preferred_language(self):
42        """Return the system preferred language."""
43        return getUtility(ILanguageManager)[config.mailman.default_language]
44
45
46public(system_preferences=SystemDefaultPreferences())
47