API Reference

class mailmanclient.Client(baseurl, name=None, password=None)

Access the Mailman REST API root.

bans
chains
create_domain(mail_host, base_url=<object object>, description=None, owner=None)
create_user(email, password, display_name=u'')
delete_domain(mail_host)
delete_list(fqdn_listname)
domains
get_address(address)
get_bans_page(count=50, page=1)
get_domain(mail_host, web_host=<object object>)

Get domain by its mail_host or its web_host.

get_list(fqdn_listname)
get_list_page(count=50, page=1, advertised=None)
get_lists(advertised=None)
get_member(fqdn_listname, subscriber_address)
get_member_page(count=50, page=1)
get_user(address)
get_user_page(count=50, page=1)
lists
members
pipelines
preferences
queues
system
users
class mailmanclient._client.Domain(connection, url, data=None)
add_owner(owner)
base_url
create_list(list_name)
get_list_page(count=50, page=1, advertised=None)
get_lists(advertised=None)
lists
owners
remove_all_owners()
web_host
class mailmanclient._client.MailingList(connection, url, data=None)
accept_message(request_id)

Shortcut for moderate_message.

accept_request(request_id)

Shortcut to accept a subscription request.

add_moderator(address)
add_owner(address)
add_role(role, address)
archivers
bans
defer_message(request_id)

Shortcut for moderate_message.

defer_request(request_id)

Shortcut to defer a subscription request.

discard_message(request_id)

Shortcut for moderate_message.

discard_request(request_id)

Shortcut to discard a subscription request.

find_members(address, role=u'member', page=None, count=50)
get_bans_page(count=50, page=1)
get_held_message(held_id)
get_held_page(count=50, page=1)
get_member(email)

Get a membership.

Parameters:address – The email address of the member for this list.
Returns:A member proxy object.
get_member_page(count=50, page=1)
header_matches
held

Return a list of dicts with held message information.

manage_request(token, action)

Alias for moderate_request, kept for compatibility

members
moderate_message(request_id, action)

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)

Moderate a subscription request.

Parameters:action (str.) – accept|reject|discard|defer
moderators
nonmembers
owners
reject_message(request_id)

Shortcut for moderate_message.

reject_request(request_id)

Shortcut to reject a subscription request.

remove_moderator(address)
remove_owner(address)
remove_role(role, address)
requests

Return a list of dicts with subscription requests.

settings
subscribe(address, display_name=None, pre_verified=False, pre_confirmed=False, pre_approved=False)

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.

unsubscribe(email)

Unsubscribe an email address from a mailing list.

Parameters:address – The address to unsubscribe.
class mailmanclient._client.ListArchivers(connection, url, mlist)

Represents the activation status for each site-wide available archiver for a given list.

class mailmanclient._client.Bans(connection, url, data=None, mlist=None)

The list of banned addresses from a mailing-list or from the whole site.

add(email)
find_by_email(email)
remove(email)
class mailmanclient._client.BannedAddress(connection, url, data=None)
mailinglist
class mailmanclient._client.HeaderMatches(connection, url, mlist)

The list of header matches for a mailing-list.

add(header, pattern, action=None)
Parameters:
  • header (str) – The header to consider.
  • pattern (str) – The regular expression to use for filtering.
  • action (str) – The action to take when the header matches the pattern. This can be ‘accept’, ‘discard’, ‘reject’, or ‘hold’.
class mailmanclient._client.HeaderMatch(connection, url, data=None)
class mailmanclient._client.Member(connection, url, data=None)
address
unsubscribe()

Unsubscribe the member from a mailing list.

user
class mailmanclient._client.User(connection, url, data=None)
add_address(email, absorb_existing=False)

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
class mailmanclient._client.Addresses(connection, url, data=None)
find_by_email(email)
remove(email)
class mailmanclient._client.Address(connection, url, data=None)
unverify()
user
verified
verify()
class mailmanclient._client.HeldMessage(connection, url, data=None)
accept()

Shortcut for moderate.

defer()

Shortcut for moderate.

discard()

Shortcut for moderate.

moderate(action)

Moderate a held message.

Parameters:action (String.) – Action to perform on held message.
reject()

Shortcut for moderate.

class mailmanclient._client.Preferences(connection, url, data=None)
delete()
class mailmanclient._client.Settings(connection, url, data=None)
class mailmanclient._client.Queue(connection, url, data=None)
files
inject(list_id, text)