summaryrefslogtreecommitdiff
path: root/src/mailman/commands/docs/echo.rst
blob: 32399ebfc8eae04a5d04fc28a18e4b07719392a0 (plain)
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
==================
The 'echo' command
==================

The mail command 'echo' simply replies with the original command and arguments
to the sender.

    >>> command = config.commands['echo']
    >>> print(command.name)
    echo
    >>> print(command.argument_description)
    [args]
    >>> print(command.description)
    Echo back your arguments.

The original message is ignored, but the results receive the echoed command.
::

    >>> mlist = create_list('test@example.com')

    >>> from mailman.runners.command import Results
    >>> results = Results()

    >>> from mailman.email.message import Message
    >>> print(command.process(mlist, Message(), {}, ('foo', 'bar'), results))
    ContinueProcessing.yes
    >>> print(unicode(results))
    The results of your email command are provided below.
    <BLANKLINE>
    echo foo bar
    <BLANKLINE>