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 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
# File lib/mailmanager.rb, line 110 def delete_list(list_name) MailManager::List.delete(list_name) end
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 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
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
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
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