The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Ezmlm - Object Methods for Ezmlm Mailing Lists

SYNOPSIS

 use Ezmlm;
 $list = new Ezmlm;
 

The rest is a bit complicated for a Synopsis, see the description.

ABSTRACT

Ezmlm is a Perl module that is designed to provide an object interface to the ezmlm mailing list manager software. See the ezmlm web page (http://www.ezmlm.org/) for a complete description of the software.

DESCRIPTION

Setting up a new Ezmlm object:

        use Ezmlm;
        $list = new Ezmlm;
        $list = new Ezmlm('/home/user/lists/moolist');

Changing which list the Ezmlm object points at:

        $list->setlist('/home/user/lists/moolist');

Getting a list of current subscribers:

Two methods of listing subscribers is provided. The first prints a list of subscribers, one per line, to the supplied FILEHANDLE. If no filehandle is given, this defaults to STDOUT.
        $list->list;
        $list->list(STDERR);
The second method returns an array containing the subscribers.
        @subscribers = $list->subscribers;
        print $list->subscribers;

Testing for subscription:

        $list->issub('nobody@on.web.za');
        $list->issub(@addresses);

issub() returns 1 if all the addresses supplied are found as subscribers of the current mailing list, otherwise it returns undefined.

Subscribing to a list:

        $list->sub('nobody@on.web.za');
        $list->sub(@addresses);

sub() takes a LIST of addresses and subscribes them to the current mailing list.

Unsubscribing from a list:

        $list->unsub('nobody@on.web.za');
        $list->unsub(@addresses);

unsub() takes a LIST of addresses and unsubscribes them (if they exist) from the current mailing list.

Creating a new list:

        $list->make(-dir=>'/home/user/list/moo',
                        -qmail=>'/home/user/.qmail-moo',
                        -name=>'user-moo',
                        -host=>'on.web.za',
                        -user=>'onwebza',
                        -switches=>'mPz');

make() creates the list as defined and sets it to the current list. There are three variables which must be defined in order for this to occur; -dir, -qmail and -name.

-dir is the full path of the directory in which the mailing list is to be created.
-qmail is the full path and name of the .qmail file to create.
-name is the local part of the mailing list address (eg if your list was user-moo@on.web.za, -name is 'user-moo').
-host is the name of the host that this list is being created on. If this item is omitted, make() will try to determine your hostname. If -host is not the same as your hostname, then make() will attempt to fix DIR/inlocal for a virtual host.
-user is the name of the user who owns this list. This item only needs to be defined for virtual domains. If it exists, it is prepended to -name in DIR/inlocal. If it is not defined, the make() will attempt to work out what it should be from the qmail control files.
-switches is a list of command line switches to pass to ezmlm-make(1). Note that the leading dash ('-') should be ommitted from the string.

make() returns the value of thislist() for success, undefined if there was a problem with the ezmlm-make system call and 0 if there was some other problem.

See the ezmlm-make(1) man page for more details

Determining which list we are currently altering:

        $whichlist = $list->thislist;
        print $list->thislist;

Getting the current configuration of the current list:

        $list->getconfig;

getconfig() returns a string that contains the command line switches that would be necessary to re-create the current list. It does this by reading the DIR/config file if it exists. If it can't find this file it attempts to work things out for itself (with varying degrees of success). If both these methods fail, then getconfig() returns undefined.

Updating the configuration of the current list:

        $list->update('msPd');

update() can be used to rebuild the current mailing list with new command line options. These options can be supplied as a string argument to the procedure. Note that you do not need to supply the '-' or the 'e' command line switch.

RETURN VALUES

All of the routines described above have return values. 0 or undefined are used to indicate that an error of some form has occoured, while anything >0 (including strings, etc) are used to indicate success.

For those who are interested, in those sub routines that have to make system calls to perform their function, an undefined value indicates that the system call failed, while 0 indicates some other error. Things that you would expect to return a string (such as thislist()) return undefined to indicate that they haven't a clue ... as opposed to the empty string which would mean that they know about nothing :)

AUTHOR

Guy Antony Halse <guy-ezmlm@rucus.ru.ac.za>

BUGS

 None known yet. Please report bugs to the author.

SEE ALSO

 ezmlm(5), ezmlm-make(2), ezmlm-sub(1), 
 ezmlm-unsub(1), ezmlm-list(1), ezmlm-issub(1)

 http://rucus.ru.ac.za/~guy/ezmlm/
 http://www.ezmlm.org/
 http://www.qmail.org/

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 344:

'=item' outside of any '=over'

Around line 356:

You forgot a '=back' before '=head2'