diff options
Diffstat (limited to '')
| -rw-r--r-- | mailman/docs/domains.txt | 62 | ||||
| -rw-r--r-- | mailman/docs/registration.txt | 17 | ||||
| -rw-r--r-- | mailman/docs/requests.txt | 5 |
3 files changed, 31 insertions, 53 deletions
diff --git a/mailman/docs/domains.txt b/mailman/docs/domains.txt index d2980cd05..b71689520 100644 --- a/mailman/docs/domains.txt +++ b/mailman/docs/domains.txt @@ -2,54 +2,16 @@ Domains ======= Domains are how Mailman interacts with email host names and web host names. -Generally, new domains are registered in the mailman.cfg configuration file by -calling the add_domain() method. +Generally, new domains are registered in the mailman.cfg configuration file. +We simulate that here by pushing new configurations. -At a minimum, the email host name must be specified. - - >>> config.add_domain('example.net') - -The domain object can be looked up by email host name. - - >>> from zope.interface.verify import verifyObject - >>> from mailman.interfaces.domain import IDomain - >>> domain = config.domains['example.net'] - >>> verifyObject(IDomain, domain) - True - - >>> print domain.email_host - example.net - -The base url is calculated by default if not given. - - >>> print domain.base_url - http://example.net - -There is no description by default. - - >>> print domain.description - None - -By default, the contact address is the domain's postmaster. - - >>> print domain.contact_address - postmaster@example.net - -And the url_host is by default the same as the email host. - - >>> print domain.url_host - example.net - - -Full specification ------------------- - -The domain can also be much more fully defined. - - >>> config.add_domain( - ... 'example.org', 'https://mail.example.org', - ... 'The example domain', - ... 'postmaster@mail.example.org') + >>> config.push('example.org', """ + ... [domain.example_dot_org] + ... email_host: example.org + ... base_url: https://mail.example.org + ... description: The example domain + ... contact_address: postmaster@mail.example.org + ... """) >>> domain = config.domains['example.org'] >>> print domain.email_host @@ -76,3 +38,9 @@ Confirmation tokens can be added to either the email confirmation address... >>> print domain.confirm_url('abc') https://mail.example.org/confirm/abc + + +Clean up +-------- + + >>> config.pop('example.org') diff --git a/mailman/docs/registration.txt b/mailman/docs/registration.txt index 752f49672..a91980e0c 100644 --- a/mailman/docs/registration.txt +++ b/mailman/docs/registration.txt @@ -18,7 +18,13 @@ stuff. Add a domain, which will provide the context for the verification email message. - >>> config.add_domain('mail.example.com', 'http://mail.example.com') + >>> config.push('mail', """ + ... [domain.mail_example_dot_com] + ... email_host: mail.example.com + ... base_url: http://mail.example.com + ... contact_address: postmaster@mail.example.com + ... """) + >>> domain = config.domains['mail.example.com'] Get a registrar by adapting a context to the interface. @@ -114,8 +120,7 @@ Verification by email There is also a verification email sitting in the virgin queue now. This message is sent to the user in order to verify the registered address. - >>> from mailman.queue import Switchboard - >>> switchboard = Switchboard(config.VIRGINQUEUE_DIR) + >>> switchboard = config.switchboards['virgin'] >>> len(switchboard.files) 1 >>> filebase = switchboard.files[0] @@ -350,3 +355,9 @@ But after confirmation, he is. >>> print mlist.members.get_member(u'fred.person@example.com') <Member: Fred Person <fred.person@example.com> on alpha@example.com as MemberRole.member> + + +Clean up +-------- + + >>> config.pop('mail') diff --git a/mailman/docs/requests.txt b/mailman/docs/requests.txt index 1e1347ed7..c67a7e06e 100644 --- a/mailman/docs/requests.txt +++ b/mailman/docs/requests.txt @@ -16,8 +16,7 @@ Here is a helper function for printing out held requests. And another helper for displaying messages in the virgin queue. - >>> from mailman.queue import Switchboard - >>> virginq = Switchboard(config.VIRGINQUEUE_DIR) + >>> virginq = config.switchboards['virgin'] >>> def dequeue(whichq=None, expected_count=1): ... if whichq is None: ... whichq = virginq @@ -302,7 +301,7 @@ indicates that the message has been approved. >>> id_3 = moderator.hold_message(mlist, msg, msgdata, 'Needs approval') >>> moderator.handle_message(mlist, id_3, Action.accept) - >>> inq = Switchboard(config.INQUEUE_DIR) + >>> inq = config.switchboards['in'] >>> qmsg, qdata = dequeue(inq) >>> print qmsg.as_string() From: aperson@example.org |
