summaryrefslogtreecommitdiff
path: root/src/mailman/commands/docs/mailmanconf.rst
blob: 061883bdf7ddc0c6cede1395512bb7410227e455 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
==================
Display configuration values
==================

Just like the postfix command postconf(1), mailmanconf lets you dump
one or more mailman configuration variables. Internally, these can be
retrieved by using the mailman.config.config object. Their structure
is based on the schema given by src/mailman/config/schema.cfg.
For more information on how the values are actually set, see
src/mailman/docs/START.rst

Basically, the configuration is divided in multiple sections which
contain multiple key-value pairs. The ``bin/mailman mailmanconf``
command allows you to display a specific or several key-value pairs.

    >>> class FakeArgs:
    ...     key = None
    ...     section = None
    ...     output = None
    >>> from mailman.commands.cli_mailmanconf import Mailmanconf
    >>> command = Mailmanconf()

To get a list of all key-value pairs of any section, you need to call
the command without any options.

    >>> command.process(FakeArgs)
    ... [logging.archiver] path: mailman.log
    ... [logging.archiver] level: info
    ... [logging.locks] propagate: no
    ... [logging.locks] level: info
    ... [passwords] configuration: python:mailman.config.passlib
    ... etc.
    
You can list all the key-value pairs of a specific section.

    >>> FakeArgs.section = 'mailman'
    >>> command.process(FakeArgs)
    ... [mailman] filtered_messages_are_preservable: no
    ... [mailman] post_hook: 
    ... [mailman] pending_request_life: 3d
    ... etc.
    
You can also pass a key and display all key-value pairs matching
the given key, along with the names of the corresponding sections.

    >>> FakeArgs.section = 'None'
    >>> FakeArgs.key = 'path'
    >>> command.process(FakeArgs)
    ... [logging.archiver] path: mailman.log
    ... [logging.mischief] path: mailman.log
    ... [logging.error] path: mailman.log
    ... [logging.smtp] path: smtp.log
    ... etc.
    
If you specify both a section and a key, you will get the corresponding value.

    >>> FakeArgs.section = 'mailman'
    >>> FakeArgs.key = 'site_owner'
    >>> command.process(FakeArgs)
    ... changeme@example.com