Abhilash Raj pushed to branch master at GNU Mailman / Mailman Core

Commits:
3027df99 by Mark Sapiro at 2018-05-30T19:47:46Z
Added acceptable_alias and require_explicit_destination attributes
to the IMailingList definition.

- - - - -
16ed7f2f by Mark Sapiro at 2018-05-30T20:34:20Z
Expose require_explicit_destination through REST API.

- - - - -
7c008ea5 by Abhilash Raj at 2018-05-30T21:13:32Z
Merge branch 'explicit' into 'master'

Add attributes to IMailingList and expose in REST

Closes #483 and #484

See merge request mailman/mailman!396
- - - - -


5 changed files:

- src/mailman/docs/NEWS.rst
- src/mailman/interfaces/mailinglist.py
- src/mailman/rest/docs/listconf.rst
- src/mailman/rest/listconf.py
- src/mailman/rest/tests/test_listconf.py


Changes:

=====================================
src/mailman/docs/NEWS.rst
=====================================
--- a/src/mailman/docs/NEWS.rst
+++ b/src/mailman/docs/NEWS.rst
@@ -121,6 +121,8 @@ Interfaces
   accepts the latter and mirrors the already existing ``.get_by_list_id()``.
 * A new template ``list:user:notice:rejected`` has been added for customizing
   the bounce message rejection notice.
+* The ``acceptable_alias`` and ``require_explicit_destination`` attributes
+  have been added to the ``IMailingList`` definition.  (Closes #483)
 
 Other
 -----
@@ -154,6 +156,8 @@ REST
 * Expose ``MailingList.respond_to_post_request`` through REST API. (Closes 
#420)
 * Add a new API ``lists/find`` which returns all the lists related to a
   subscriber. It optionally allows filtering based on a role. (See !388)
+* Expose ``MailingList.require_explicit_destination`` through REST API.
+  (Closes #484)
 
 3.1.0 -- "Between The Wheels"
 =============================


=====================================
src/mailman/interfaces/mailinglist.py
=====================================
--- a/src/mailman/interfaces/mailinglist.py
+++ b/src/mailman/interfaces/mailinglist.py
@@ -534,6 +534,21 @@ class IMailingList(Interface):
         that gets created to accumlate messages for the digest.
         """)
 
+    require_explicit_destination = Attribute(
+        """Flag controlling requiring explisit destination.
+
+        If require_explicit_destination is True, a post must have the list's
+        posting address or an acceptable alias in To: or Cc: or be held for
+        moderator approval.
+        """)
+
+    acceptable_aliases = Attribute(
+        """List of addresses and regexps acceptable as explicit destination.
+
+        This is a list of addresses and regexps matching addresses that are
+        acceptable in To: or Cc: when require_explicit_destination is True.
+        """)
+
     administrivia = Attribute(
         """Flag controlling `administrivia` checks.
 


=====================================
src/mailman/rest/docs/listconf.rst
=====================================
--- a/src/mailman/rest/docs/listconf.rst
+++ b/src/mailman/rest/docs/listconf.rst
@@ -73,6 +73,7 @@ All readable attributes for a list are available on a 
sub-resource.
     reply_goes_to_list: no_munging
     reply_to_address:
     request_address: ant-requ...@example.com
+    require_explicit_destination: True
     respond_to_post_requests: True
                send_welcome_message: True
     subject_prefix: [Ant]
@@ -127,6 +128,7 @@ When using ``PUT``, all writable attributes must be 
included.
     ...             collapse_alternatives=False,
     ...             reply_goes_to_list='point_to_list',
     ...             reply_to_address='b...@example.com',
+    ...             require_explicit_destination=False,
     ...             send_welcome_message=False,
     ...             subject_prefix='[ant]',
     ...             subscription_policy='moderate',
@@ -191,6 +193,8 @@ These values are changed permanently.
     reply_goes_to_list: point_to_list
     reply_to_address: b...@example.com
     ...
+    require_explicit_destination: False
+    respond_to_post_requests: True
     send_welcome_message: False
     subject_prefix: [ant]
     subscription_policy: moderate


=====================================
src/mailman/rest/listconf.py
=====================================
--- a/src/mailman/rest/listconf.py
+++ b/src/mailman/rest/listconf.py
@@ -180,6 +180,7 @@ ATTRIBUTES = dict(
     reply_goes_to_list=GetterSetter(enum_validator(ReplyToMunging)),
     reply_to_address=GetterSetter(str),
     request_address=GetterSetter(None),
+    require_explicit_destination=GetterSetter(as_boolean),
     send_welcome_message=GetterSetter(as_boolean),
     subject_prefix=GetterSetter(str),
     subscription_policy=GetterSetter(enum_validator(SubscriptionPolicy)),


=====================================
src/mailman/rest/tests/test_listconf.py
=====================================
--- a/src/mailman/rest/tests/test_listconf.py
+++ b/src/mailman/rest/tests/test_listconf.py
@@ -76,6 +76,7 @@ RESOURCE = dict(
     posting_pipeline='virgin',
     reply_goes_to_list='point_to_list',
     reply_to_address='b...@example.com',
+    require_explicit_destination=True,
     send_welcome_message=False,
     subject_prefix='[ant]',
     subscription_policy='confirm_then_moderate',



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/73a2d2b9979e23f8bc53bb1f0601c39125ca27db...7c008ea5c5b25b4c52b2bab9a1b5a9b53c8f7beb

-- 
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/73a2d2b9979e23f8bc53bb1f0601c39125ca27db...7c008ea5c5b25b4c52b2bab9a1b5a9b53c8f7beb
You're receiving this email because of your account on gitlab.com.
_______________________________________________
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to