~sakuag333/mailman/lmtp-duplicate-id

« back to all changes in this revision

Viewing changes to src/mailman/rest/docs/configuration.rst

  • Committer: Barry Warsaw
  • Date: 2012-12-30 19:39:10 UTC
  • mfrom: (7191.1.15 lp1065447)
  • Revision ID: barry@list.org-20121230193910-nx0qqml1w816zuw6
 * List styles are supported through the REST API.  Get the list of available
   styles (by name) via `.../lists/styles`.  Create a list in a specific style
   by using POST data `style_name=<style>`.  (LP: #975692)

 * The default list style is renamed to `legacy-default` and a new
   `legacy-announce` style is added.  This is similar to the `legacy-default`
   except set up for announce-only lists.

 * The following columns were unused and have been removed:

   - `mailinglist.new_member_options`
   - `mailinglist.send_reminders`
   - `mailinglist.subscribe_policy`
   - `mailinglist.unsubscribe_policy`
   - `mailinglist.subscribe_auto_approval`
   - `mailinglist.private_roster`
   - `mailinglist.admin_member_chunksize`

Also:
 * List styles no longer have a priority, nor is there any style matching any
   more.  Now, exactly one named style (either explicitly through the
   `create_list()` function, or by default from the configuration file) is
   applied to a list at list creation time.
 * The huge old DefaultStyle is now decomposed into smaller units.  An
   announce-like style is added.
 * `find_components()` and `scan_module()` moved from `app/finder.py` to
   `utilities/modules.py`.
 * Lots of doctest rewriting for better documentation.  Bad-path tests moved
   to unittests.
 * `create_list()` now takes an optional `style_name` parameter.  If not
   given, `[styles]default` is used.
 * `create_list()` doesn't set the `personalize` or `display_name` attributes
   any more.  These are already set in styles.
 * Removed an unnecessary `tearDown()`.
 * Added some improvements on displaying lists in JSON responses.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
Mailing lists can be configured via the REST API.
6
6
 
7
 
    >>> mlist = create_list('test-one@example.com')
 
7
    >>> mlist = create_list('ant@example.com')
8
8
    >>> transaction.commit()
9
9
 
10
10
 
13
13
 
14
14
All readable attributes for a list are available on a sub-resource.
15
15
 
16
 
    >>> dump_json('http://localhost:9001/3.0/lists/'
17
 
    ...           'test-one@example.com/config')
 
16
    >>> dump_json('http://localhost:9001/3.0/lists/ant@example.com/config')
18
17
    acceptable_aliases: []
19
18
    admin_immed_notify: True
20
19
    admin_notify_mchanges: False
30
29
    autoresponse_owner_text:
31
30
    autoresponse_postings_text:
32
31
    autoresponse_request_text:
33
 
    bounces_address: test-one-bounces@example.com
 
32
    bounces_address: ant-bounces@example.com
34
33
    collapse_alternatives: True
35
34
    convert_html_to_plaintext: False
36
35
    created_at: 20...T...
39
38
    description:
40
39
    digest_last_sent_at: None
41
40
    digest_size_threshold: 30.0
42
 
    display_name: Test-one
 
41
    display_name: Ant
43
42
    filter_content: False
44
 
    fqdn_listname: test-one@example.com
 
43
    fqdn_listname: ant@example.com
45
44
    http_etag: "..."
46
45
    include_rfc2369_headers: True
47
 
    join_address: test-one-join@example.com
 
46
    join_address: ant-join@example.com
48
47
    last_post_at: None
49
 
    leave_address: test-one-leave@example.com
50
 
    list_name: test-one
 
48
    leave_address: ant-leave@example.com
 
49
    list_name: ant
51
50
    mail_host: example.com
52
51
    next_digest_number: 1
53
52
    no_reply_address: noreply@example.com
54
 
    owner_address: test-one-owner@example.com
 
53
    owner_address: ant-owner@example.com
55
54
    post_id: 1
56
 
    posting_address: test-one@example.com
 
55
    posting_address: ant@example.com
57
56
    posting_pipeline: default-posting-pipeline
58
57
    reply_goes_to_list: no_munging
59
 
    request_address: test-one-request@example.com
 
58
    request_address: ant-request@example.com
60
59
    scheme: http
61
60
    send_welcome_message: True
62
 
    subject_prefix: [Test-one]
 
61
    subject_prefix: [Ant]
63
62
    volume: 1
64
63
    web_host: lists.example.com
65
64
    welcome_message_uri: mailman:///welcome.txt
74
73
 
75
74
    >>> from mailman.interfaces.action import Action
76
75
    >>> dump_json('http://localhost:9001/3.0/lists/'
77
 
    ...           'test-one@example.com/config',
 
76
    ...           'ant@example.com/config',
78
77
    ...           dict(
79
78
    ...             acceptable_aliases=['one@example.com', 'two@example.com'],
80
79
    ...             admin_immed_notify=False,
101
100
    ...             collapse_alternatives=False,
102
101
    ...             reply_goes_to_list='point_to_list',
103
102
    ...             send_welcome_message=False,
104
 
    ...             subject_prefix='[test-one]',
 
103
    ...             subject_prefix='[ant]',
105
104
    ...             welcome_message_uri='mailman:///welcome.txt',
106
105
    ...             default_member_action='hold',
107
106
    ...             default_nonmember_action='discard',
115
114
These values are changed permanently.
116
115
 
117
116
    >>> dump_json('http://localhost:9001/3.0/lists/'
118
 
    ...           'test-one@example.com/config')
119
 
    acceptable_aliases: [u'one@example.com', u'two@example.com']
 
117
    ...           'ant@example.com/config')
 
118
    acceptable_aliases: ['one@example.com', 'two@example.com']
120
119
    admin_immed_notify: False
121
120
    admin_notify_mchanges: True
122
121
    administrivia: False
149
148
    reply_goes_to_list: point_to_list
150
149
    ...
151
150
    send_welcome_message: False
152
 
    subject_prefix: [test-one]
 
151
    subject_prefix: [ant]
153
152
    ...
154
153
    welcome_message_uri: mailman:///welcome.txt
155
154
 
157
156
must be included.  It is an error to leave one or more out...
158
157
 
159
158
    >>> dump_json('http://localhost:9001/3.0/lists/'
160
 
    ...           'test-one@example.com/config',
 
159
    ...           'ant@example.com/config',
161
160
    ...           dict(
162
161
    ...             #acceptable_aliases=['one', 'two'],
163
162
    ...             admin_immed_notify=False,
184
183
    ...             collapse_alternatives=False,
185
184
    ...             reply_goes_to_list='point_to_list',
186
185
    ...             send_welcome_message=True,
187
 
    ...             subject_prefix='[test-one]',
 
186
    ...             subject_prefix='[ant]',
188
187
    ...             welcome_message_uri='welcome message',
189
188
    ...             default_member_action='accept',
190
189
    ...             default_nonmember_action='accept',
197
196
...or to add an unknown one.
198
197
 
199
198
    >>> dump_json('http://localhost:9001/3.0/lists/'
200
 
    ...           'test-one@example.com/config',
 
199
    ...           'ant@example.com/config',
201
200
    ...           dict(
202
201
    ...             a_mailing_list_attribute=False,
203
202
    ...             acceptable_aliases=['one', 'two'],
220
219
    ...             allow_list_posts=False,
221
220
    ...             digest_size_threshold=10.5,
222
221
    ...             posting_pipeline='virgin',
223
 
    ...             subject_prefix='[test-one]',
 
222
    ...             subject_prefix='[ant]',
224
223
    ...             filter_content=True,
225
224
    ...             convert_html_to_plaintext=True,
226
225
    ...             collapse_alternatives=False,
233
232
It is also an error to spell an attribute value incorrectly...
234
233
 
235
234
    >>> dump_json('http://localhost:9001/3.0/lists/'
236
 
    ...           'test-one@example.com/config',
 
235
    ...           'ant@example.com/config',
237
236
    ...           dict(
238
237
    ...             admin_immed_notify='Nope',
239
238
    ...             acceptable_aliases=['one', 'two'],
254
253
    ...             allow_list_posts=False,
255
254
    ...             digest_size_threshold=10.5,
256
255
    ...             posting_pipeline='virgin',
257
 
    ...             subject_prefix='[test-one]',
 
256
    ...             subject_prefix='[ant]',
258
257
    ...             filter_content=True,
259
258
    ...             convert_html_to_plaintext=True,
260
259
    ...             collapse_alternatives=False,
267
266
...or to name a pipeline that doesn't exist...
268
267
 
269
268
    >>> dump_json('http://localhost:9001/3.0/lists/'
270
 
    ...           'test-one@example.com/config',
 
269
    ...           'ant@example.com/config',
271
270
    ...           dict(
272
271
    ...             acceptable_aliases=['one', 'two'],
273
272
    ...             admin_immed_notify=False,
288
287
    ...             allow_list_posts=False,
289
288
    ...             digest_size_threshold=10.5,
290
289
    ...             posting_pipeline='dummy',
291
 
    ...             subject_prefix='[test-one]',
 
290
    ...             subject_prefix='[ant]',
292
291
    ...             filter_content=True,
293
292
    ...             convert_html_to_plaintext=True,
294
293
    ...             collapse_alternatives=False,
301
300
...or to name an invalid auto-response enumeration value.
302
301
 
303
302
    >>> dump_json('http://localhost:9001/3.0/lists/'
304
 
    ...           'test-one@example.com/config',
 
303
    ...           'ant@example.com/config',
305
304
    ...           dict(
306
305
    ...             acceptable_aliases=['one', 'two'],
307
306
    ...             admin_immed_notify=False,
321
320
    ...             allow_list_posts=False,
322
321
    ...             digest_size_threshold=10.5,
323
322
    ...             posting_pipeline='virgin',
324
 
    ...             subject_prefix='[test-one]',
 
323
    ...             subject_prefix='[ant]',
325
324
    ...             filter_content=True,
326
325
    ...             convert_html_to_plaintext=True,
327
326
    ...             collapse_alternatives=False,
338
337
Using ``PATCH``, you can change just one attribute.
339
338
 
340
339
    >>> dump_json('http://localhost:9001/3.0/lists/'
341
 
    ...           'test-one@example.com/config',
 
340
    ...           'ant@example.com/config',
342
341
    ...           dict(display_name='My List'),
343
342
    ...           'PATCH')
344
343
    content-length: 0
372
371
    >>> IAcceptableAliasSet(mlist).clear()
373
372
    >>> transaction.commit()
374
373
    >>> dump_json('http://localhost:9001/3.0/lists/'
375
 
    ...           'test-one@example.com/config/acceptable_aliases')
 
374
    ...           'ant@example.com/config/acceptable_aliases')
376
375
    acceptable_aliases: []
377
376
    http_etag: "..."
378
377
 
380
379
dictionary are ignored.
381
380
 
382
381
    >>> dump_json('http://localhost:9001/3.0/lists/'
383
 
    ...           'test-one@example.com/config/acceptable_aliases',
 
382
    ...           'ant@example.com/config/acceptable_aliases',
384
383
    ...           dict(acceptable_aliases=['foo@example.com',
385
384
    ...                                    'bar@example.net']),
386
385
    ...           'PUT')
393
392
 
394
393
    >>> response = call_http(
395
394
    ...     'http://localhost:9001/3.0/lists/'
396
 
    ...     'test-one@example.com/config/acceptable_aliases')
 
395
    ...     'ant@example.com/config/acceptable_aliases')
397
396
    >>> for alias in response['acceptable_aliases']:
398
397
    ...     print alias
399
398
    bar@example.net