summaryrefslogtreecommitdiff
path: root/src/mailman/rest
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/rest')
-rw-r--r--src/mailman/rest/docs/listconf.rst17
-rw-r--r--src/mailman/rest/docs/systemconf.rst3
-rw-r--r--src/mailman/rest/listconf.py18
-rw-r--r--src/mailman/rest/tests/test_listconf.py6
-rw-r--r--src/mailman/rest/tests/test_systemconf.py4
5 files changed, 43 insertions, 5 deletions
diff --git a/src/mailman/rest/docs/listconf.rst b/src/mailman/rest/docs/listconf.rst
index 3434f2a3d..da9f1e299 100644
--- a/src/mailman/rest/docs/listconf.rst
+++ b/src/mailman/rest/docs/listconf.rst
@@ -44,10 +44,16 @@ All readable attributes for a list are available on a sub-resource.
digest_volume_frequency: monthly
digests_enabled: True
display_name: Ant
+ dmarc_moderation_action: none
+ dmarc_moderation_notice:
+ dmarc_none_moderation_action: False
+ dmarc_quarantine_moderation_action: True
+ dmarc_wrapped_message_text:
filter_content: False
first_strip_reply_to: False
footer_uri:
fqdn_listname: ant@example.com
+ from_is_list: none
goodbye_message_uri:
header_uri:
http_etag: "..."
@@ -110,9 +116,15 @@ When using ``PUT``, all writable attributes must be included.
... digest_size_threshold=10.5,
... digest_volume_frequency='yearly',
... digests_enabled=False,
+ ... dmarc_moderation_action='munge_from',
+ ... dmarc_moderation_notice='Some moderation notice',
+ ... dmarc_none_moderation_action=True,
+ ... dmarc_quarantine_moderation_action=False,
+ ... dmarc_wrapped_message_text='some message text',
... posting_pipeline='virgin',
... filter_content=True,
... first_strip_reply_to=True,
+ ... from_is_list='none',
... convert_html_to_plaintext=True,
... collapse_alternatives=False,
... reply_goes_to_list='point_to_list',
@@ -162,6 +174,11 @@ These values are changed permanently.
digest_volume_frequency: yearly
digests_enabled: False
display_name: Fnords
+ dmarc_moderation_action: munge_from
+ dmarc_moderation_notice: Some moderation notice
+ dmarc_none_moderation_action: True
+ dmarc_quarantine_moderation_action: False
+ dmarc_wrapped_message_text: some message text
filter_content: True
first_strip_reply_to: True
footer_uri:
diff --git a/src/mailman/rest/docs/systemconf.rst b/src/mailman/rest/docs/systemconf.rst
index 385588077..24c6bef4a 100644
--- a/src/mailman/rest/docs/systemconf.rst
+++ b/src/mailman/rest/docs/systemconf.rst
@@ -14,6 +14,9 @@ You can also get all the values for a particular section.
>>> dump_json('http://localhost:9001/3.0/system/configuration/mailman')
cache_life: 7d
default_language: en
+ dmarc_org_domain_data: https://publicsuffix.org/list/public_suffix_list.dat
+ dmarc_resolver_lifetime: 5s
+ dmarc_resolver_timeout: 3s
email_commands_max_lines: 10
filtered_messages_are_preservable: no
html_to_plain_text_command: /usr/bin/lynx -dump $filename
diff --git a/src/mailman/rest/listconf.py b/src/mailman/rest/listconf.py
index 94598b0ab..416336142 100644
--- a/src/mailman/rest/listconf.py
+++ b/src/mailman/rest/listconf.py
@@ -24,7 +24,8 @@ from mailman.interfaces.archiver import ArchivePolicy
from mailman.interfaces.autorespond import ResponseAction
from mailman.interfaces.digests import DigestFrequency
from mailman.interfaces.mailinglist import (
- IAcceptableAliasSet, IMailingList, ReplyToMunging, SubscriptionPolicy)
+ DMARCModerationAction, FromIsList, IAcceptableAliasSet, IMailingList,
+ ReplyToMunging, SubscriptionPolicy)
from mailman.interfaces.template import ITemplateManager
from mailman.rest.helpers import (
GetterSetter, bad_request, etag, no_content, not_found, okay)
@@ -128,7 +129,9 @@ ATTRIBUTES = dict(
admin_notify_mchanges=GetterSetter(as_boolean),
administrivia=GetterSetter(as_boolean),
advertised=GetterSetter(as_boolean),
+ allow_list_posts=GetterSetter(as_boolean),
anonymous_list=GetterSetter(as_boolean),
+ archive_policy=GetterSetter(enum_validator(ArchivePolicy)),
autorespond_owner=GetterSetter(enum_validator(ResponseAction)),
autorespond_postings=GetterSetter(enum_validator(ResponseAction)),
autorespond_requests=GetterSetter(enum_validator(ResponseAction)),
@@ -136,7 +139,6 @@ ATTRIBUTES = dict(
autoresponse_owner_text=GetterSetter(str),
autoresponse_postings_text=GetterSetter(str),
autoresponse_request_text=GetterSetter(str),
- archive_policy=GetterSetter(enum_validator(ArchivePolicy)),
bounces_address=GetterSetter(None),
collapse_alternatives=GetterSetter(as_boolean),
convert_html_to_plaintext=GetterSetter(as_boolean),
@@ -144,22 +146,29 @@ ATTRIBUTES = dict(
default_member_action=GetterSetter(enum_validator(Action)),
default_nonmember_action=GetterSetter(enum_validator(Action)),
description=GetterSetter(no_newlines_validator),
+ display_name=GetterSetter(str),
digest_last_sent_at=GetterSetter(None),
digest_send_periodic=GetterSetter(as_boolean),
digest_size_threshold=GetterSetter(float),
digest_volume_frequency=GetterSetter(enum_validator(DigestFrequency)),
digests_enabled=GetterSetter(as_boolean),
+ dmarc_moderation_action=GetterSetter(
+ enum_validator(DMARCModerationAction)),
+ dmarc_moderation_notice=GetterSetter(str),
+ dmarc_none_moderation_action=GetterSetter(as_boolean),
+ dmarc_quarantine_moderation_action=GetterSetter(as_boolean),
+ dmarc_wrapped_message_text=GetterSetter(str),
filter_content=GetterSetter(as_boolean),
first_strip_reply_to=GetterSetter(as_boolean),
fqdn_listname=GetterSetter(None),
- mail_host=GetterSetter(None),
- allow_list_posts=GetterSetter(as_boolean),
+ from_is_list=GetterSetter(enum_validator(FromIsList)),
include_rfc2369_headers=GetterSetter(as_boolean),
info=GetterSetter(str),
join_address=GetterSetter(None),
last_post_at=GetterSetter(None),
leave_address=GetterSetter(None),
list_name=GetterSetter(None),
+ mail_host=GetterSetter(None),
moderator_password=GetterSetter(password_bytes_validator),
next_digest_number=GetterSetter(None),
no_reply_address=GetterSetter(None),
@@ -167,7 +176,6 @@ ATTRIBUTES = dict(
post_id=GetterSetter(None),
posting_address=GetterSetter(None),
posting_pipeline=GetterSetter(pipeline_validator),
- display_name=GetterSetter(str),
reply_goes_to_list=GetterSetter(enum_validator(ReplyToMunging)),
reply_to_address=GetterSetter(str),
request_address=GetterSetter(None),
diff --git a/src/mailman/rest/tests/test_listconf.py b/src/mailman/rest/tests/test_listconf.py
index 3260d6afb..d9eb91c02 100644
--- a/src/mailman/rest/tests/test_listconf.py
+++ b/src/mailman/rest/tests/test_listconf.py
@@ -62,8 +62,14 @@ RESOURCE = dict(
digest_volume_frequency='monthly',
digests_enabled=True,
display_name='Fnords',
+ dmarc_moderation_action='munge_from',
+ dmarc_moderation_notice='Some moderation notice',
+ dmarc_none_moderation_action=True,
+ dmarc_quarantine_moderation_action=False,
+ dmarc_wrapped_message_text='some message text',
filter_content=True,
first_strip_reply_to=True,
+ from_is_list='none',
goodbye_message_uri='mailman:///goodbye.txt',
include_rfc2369_headers=False,
info='This is the mailing list info',
diff --git a/src/mailman/rest/tests/test_systemconf.py b/src/mailman/rest/tests/test_systemconf.py
index e76c082df..28fa315a9 100644
--- a/src/mailman/rest/tests/test_systemconf.py
+++ b/src/mailman/rest/tests/test_systemconf.py
@@ -39,6 +39,10 @@ class TestSystemConfiguration(unittest.TestCase):
self.assertEqual(json, dict(
cache_life='7d',
default_language='en',
+ dmarc_org_domain_data= # noqa E251
+ 'https://publicsuffix.org/list/public_suffix_list.dat',
+ dmarc_resolver_lifetime='5s',
+ dmarc_resolver_timeout='3s',
email_commands_max_lines='10',
filtered_messages_are_preservable='no',
html_to_plain_text_command='/usr/bin/lynx -dump $filename',