API Reference¶
-
class
mailmanclient.
Client
(baseurl, name=None, password=None)[source]¶ Access the Mailman REST API root.
Parameters: - baseurl – The base url to access the Mailman 3 REST API.
- name – The Basic Auth user name. If given, the password must also be given.
- password – The Basic Auth password. If given the name must also be given.
-
bans
¶ Get a list of all the bans.
-
chains
¶ Get a list of all the Chains.
-
configuration
¶ Get the system configuration.
-
create_domain
(mail_host, base_url=<object object>, description=None, owner=None, alias_domain=None)[source]¶ Create a new Domain.
Parameters: - mail_host – The Mail host for the new domain. If you want “foo@bar.com” as the address for your MailingList, use “bar.com” here.
- description – A brief description for this Domain.
- owner – Email address for the owner of this list.
- alias_domain – Alias domain.
-
create_user
(email, password, display_name='')[source]¶ Create a new User.
Parameters: - email – Email address for the new user.
- password – Password for the new user.
- display_name – An optional name for the new user.
-
delete_domain
(mail_host)[source]¶ Delete a Domain.
Parameters: mail_host – The Mail host for the domain you want to delete.
-
delete_list
(fqdn_listname)[source]¶ Delete a MailingList.
Parameters: fqdn_listname – Fully qualified name of the MailingList.
-
domains
¶ Get a list of all Domains.
-
find_lists
(subscriber, role=None, count=50, page=1)[source]¶ Given a subscriber and a role, return all the list they are subscribed to with given role.
If no role is specified all the related mailing lists are returned without duplicates, even though there can potentially be multiple memberships of a user in a single mailing list.
Parameters: - subscriber (str) – The address of the subscriber.
- role (str) – owner, moderator or subscriber
-
get_address
(address)[source]¶ Given an Email Address, return the Address object.
Parameters: address – Email address.
-
get_bans_page
(count=50, page=1)[source]¶ Get a list of all the bans with pagination.
Parameters: - count – Number of entries per-page (defaults to 50).
- page – The page number to return (defaults to 1).
-
get_list
(fqdn_listname)[source]¶ Get a MailingList object.
Parameters: fqdn_listname – Fully qualified name of the MailingList.
-
get_list_page
(count=50, page=1, advertised=None)[source]¶ Get a list of all MailingList with pagination.
Parameters: - count – Number of entries per-page (defaults to 50).
- page – The page number to return (defaults to 1).
- advertised – If marked True, returns all MailingLists including the ones that aren’t advertised.
-
get_lists
(advertised=None)[source]¶ Get a list of all the MailingLists.
Parameters: advertised (Bool) – If marked True, returns all MailingLists including the ones that aren’t advertised.
-
get_member
(fqdn_listname, subscriber_address)[source]¶ Get the Member object for a given MailingList and Subsciber’s Email Address.
Parameters: - fqdn_listname – Fully qualified address for the MailingList.
- subscriber_address – Email Address for the subscriber.
-
get_user
(address)[source]¶ Given an Email Address, return the User it belongs to.
Parameters: address – Email Address of the User.
-
get_user_page
(count=50, page=1)[source]¶ Get all the users with pagination.
Parameters: - count – Number of entries per-page (defaults to 50).
- page – The page number to return (defaults to 1).
-
lists
¶ Get a list of all MailingLists.
-
members
¶ Get a list of all the Members.
-
pipelines
¶ Get a list of all Pipelines.
-
preferences
¶ Get all default system Preferences.
-
queues
¶ Get a list of all Queues.
-
set_template
(template_name, url, username=None, password=None)[source]¶ Set template in site-context.
-
styles
¶
-
system
¶ Get the basic system information.
-
templates
¶ Get all site-context templates.
-
users
¶ Get all the users.
-
class
mailmanclient.
Domain
(connection, url, data=None)[source]¶ -
-
base_url
¶
-
lists
¶
-
owners
¶
-
templates
¶
-
web_host
¶
-
-
class
mailmanclient.
MailingList
(connection, url, data=None)[source]¶ -
-
archivers
¶
-
bans
¶
-
get_member
(email)[source]¶ Get a membership.
Parameters: address – The email address of the member for this list. Returns: A member proxy object.
-
header_matches
¶
-
held
¶ Return a list of dicts with held message information.
-
is_member
(address)[source]¶ Given an address, checks if the given address is subscribed to this mailing list.
-
is_moderator
(address)[source]¶ Given an address, checks if the given address is a moderator of this mailing list.
-
is_owner
(address)[source]¶ Given an address, checks if the given address is an owner of this mailing list.
-
is_owner_or_mod
(address)[source]¶ Given an address, checks if the given address is either a owner or a moderator of this list.
It is possible for them to be both owner and moderator.
-
members
¶
-
moderate_message
(request_id, action)[source]¶ Moderate a held message.
Parameters: - request_id (Int.) – Id of the held message.
- action (String.) – Action to perform on held message.
-
moderate_request
(request_id, action)[source]¶ Moderate a subscription request.
Parameters: action (str.) – accept|reject|discard|defer
-
moderators
¶
-
nonmembers
¶
-
owners
¶
-
requests
¶ Return a list of dicts with subscription requests.
-
settings
¶
-
subscribe
(address, display_name=None, pre_verified=False, pre_confirmed=False, pre_approved=False)[source]¶ Subscribe an email address to a mailing list.
Parameters: - address (str) – Email address to subscribe to the list.
- display_name (str) – The real name of the new member.
- pre_verified (bool) – True if the address has been verified.
- pre_confirmed (bool) – True if membership has been approved by the user.
- pre_approved (bool) – True if membership is moderator-approved.
Returns: A member proxy object.
-
templates
¶
-
-
class
mailmanclient.
ListArchivers
(connection, url, mlist)[source]¶ Represents the activation status for each site-wide available archiver for a given list.
-
class
mailmanclient.
Bans
(connection, url, data=None, mlist=None)[source]¶ The list of banned addresses from a mailing-list or from the whole site.
-
class
mailmanclient.
HeaderMatches
(connection, url, mlist)[source]¶ The list of header matches for a mailing-list.
-
class
mailmanclient.
User
(connection, url, data=None)[source]¶ -
add_address
(email, absorb_existing=False)[source]¶ Adds another email adress to the user record and returns an _Address object.
Parameters: - email (str.) – The address to add
- absorb_existing (bool.) – set this to True if you want to add the address even if it already exists. It will import the existing user into the current one, not overwriting any previously set value.
-
addresses
¶
-
subscription_list_ids
¶
-
subscriptions
¶
-