summaryrefslogtreecommitdiff
path: root/src/mailman/commands/docs/aliases.rst
diff options
context:
space:
mode:
authorBarry Warsaw2017-07-22 03:02:05 +0000
committerBarry Warsaw2017-07-22 03:02:05 +0000
commitf00b94f18e1d82d1488cbcee6053f03423bc2f49 (patch)
tree1a8e56dff0eab71e58e5fc9ecc5f3c614d7edca7 /src/mailman/commands/docs/aliases.rst
parentf54c045519300f6f70947d1114f46c2b8ae0d368 (diff)
downloadmailman-f00b94f18e1d82d1488cbcee6053f03423bc2f49.tar.gz
mailman-f00b94f18e1d82d1488cbcee6053f03423bc2f49.tar.zst
mailman-f00b94f18e1d82d1488cbcee6053f03423bc2f49.zip
Diffstat (limited to 'src/mailman/commands/docs/aliases.rst')
-rw-r--r--src/mailman/commands/docs/aliases.rst38
1 files changed, 17 insertions, 21 deletions
diff --git a/src/mailman/commands/docs/aliases.rst b/src/mailman/commands/docs/aliases.rst
index 31fda21e4..bea1e311a 100644
--- a/src/mailman/commands/docs/aliases.rst
+++ b/src/mailman/commands/docs/aliases.rst
@@ -8,10 +8,7 @@ server. Generally these files are automatically kept up-to-date when mailing
lists are created or removed, but you might occasionally need to manually
regenerate the file. The ``mailman aliases`` command does this.
- >>> class FakeArgs:
- ... directory = None
- >>> from mailman.commands.cli_aliases import Aliases
- >>> command = Aliases()
+ >>> command = cli('mailman.commands.cli_aliases.aliases')
For example, connecting Mailman to Postfix is generally done through the LMTP
protocol. Mailman starts an LMTP server and Postfix delivers messages to
@@ -28,17 +25,20 @@ generation.
... lmtp_port: 24
... """)
+..
+ Clean up.
+ >>> ignore = cleanups.callback(config.pop, 'postfix')
+
Let's create a mailing list and then display the transport map for it. We'll
write the appropriate files to a temporary directory.
::
+ >>> mlist = create_list('ant@example.com')
+
>>> import os, shutil, tempfile
>>> output_directory = tempfile.mkdtemp()
>>> ignore = cleanups.callback(shutil.rmtree, output_directory)
-
- >>> FakeArgs.directory = output_directory
- >>> mlist = create_list('test@example.com')
- >>> command.process(FakeArgs)
+ >>> command('mailman aliases --directory ' + output_directory)
For Postfix, there are two files in the output directory.
@@ -54,15 +54,15 @@ The transport map file contains all the aliases for the mailing list.
... print(fp.read())
# AUTOMATICALLY GENERATED BY MAILMAN ON ...
...
- test@example.com lmtp:[lmtp.example.com]:24
- test-bounces@example.com lmtp:[lmtp.example.com]:24
- test-confirm@example.com lmtp:[lmtp.example.com]:24
- test-join@example.com lmtp:[lmtp.example.com]:24
- test-leave@example.com lmtp:[lmtp.example.com]:24
- test-owner@example.com lmtp:[lmtp.example.com]:24
- test-request@example.com lmtp:[lmtp.example.com]:24
- test-subscribe@example.com lmtp:[lmtp.example.com]:24
- test-unsubscribe@example.com lmtp:[lmtp.example.com]:24
+ ant@example.com lmtp:[lmtp.example.com]:24
+ ant-bounces@example.com lmtp:[lmtp.example.com]:24
+ ant-confirm@example.com lmtp:[lmtp.example.com]:24
+ ant-join@example.com lmtp:[lmtp.example.com]:24
+ ant-leave@example.com lmtp:[lmtp.example.com]:24
+ ant-owner@example.com lmtp:[lmtp.example.com]:24
+ ant-request@example.com lmtp:[lmtp.example.com]:24
+ ant-subscribe@example.com lmtp:[lmtp.example.com]:24
+ ant-unsubscribe@example.com lmtp:[lmtp.example.com]:24
<BLANKLINE>
The relay domains file contains a list of all the domains.
@@ -72,7 +72,3 @@ The relay domains file contains a list of all the domains.
# AUTOMATICALLY GENERATED BY MAILMAN ON ...
...
example.com example.com
-
-..
- Clean up.
- >>> config.pop('postfix')