class MailManager::Base

The MailManager::Base class is the root class for working with a Mailman installation. You get an instance of it by calling MailManager.init('/mailman/root').

Public Instance Methods

create_list(params) click to toggle source

Create a new list. Returns an instance of MailManager::List. Params are:

  • :name => 'new_list_name'

  • :admin_email => 'admin@domain.com'

  • :admin_password => 'supersecret'

# File lib/mailmanager.rb, line 100
def create_list(params)
  MailManager::List.create(params)
end
delete_list(list_name) click to toggle source
# File lib/mailmanager.rb, line 110
def delete_list(list_name)
  MailManager::List.delete(list_name)
end
find_member(regex) click to toggle source

Retrieves all lists for one or multiple list members selected by a regexp Returns something like { “member@example.com” => [ “first_list”, “second_list” ] } Takes a String or a Regexp

# File lib/mailmanager.rb, line 92
def find_member(regex)
  @lib.find_member(regex)
end
get_list(list_name) click to toggle source

Get an existing list as a MailManager::List instance. Raises an exception if the list doesn't exist.

# File lib/mailmanager.rb, line 106
def get_list(list_name)
  @lib.get_list(list_name)
end
list_names() click to toggle source

Only retrieves the list names, doesn't wrap them in MailManager::List instances.

# File lib/mailmanager.rb, line 84
def list_names
  @lib.list_names
end
lists() click to toggle source

Returns an array of MailManager::List instances of the lists in your Mailman installation.

# File lib/mailmanager.rb, line 78
def lists
  @lib.lists
end
python=(python) click to toggle source

If you want to use a non-default python executable to run the Python portions of this gem, set its full path here. Since we require Python 2.6+ and some distros don't ship with that version, you can point this at a newer Python you have installed. Defaults to /usr/bin/env python.

# File lib/mailmanager.rb, line 64
def python=(python)
  MailManager.python = python
end