Ezmlm - Object Methods for Ezmlm Mailing Lists
use Mail::Ezmlm; $list = new Mail::Ezmlm;
The rest is a bit complicated for a Synopsis, see the description.
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.
This version of the module is designed to work with ezmlm version 0.53. It is fully compatible with ezmlm's IDX extensions (version 0.40). Both of these can be obtained via anon ftp from ftp://ftp.ezmlm.org/pub/patches/
use Mail::Ezmlm; $list = new Mail::Ezmlm; $list = new Mail::Ezmlm('/home/user/lists/moolist');
$list->list; $list->list(\*STDERR); $list->list(\*STDERR, 'deny');
@subscribers = $list->subscribers; @subscribers = $list->subscribers('allow');
$list->issub('email@example.com'); $list->issub(@addresses); $list->issub(@addresses, 'mod');
issub() returns 1 if all the addresses supplied are found as subscribers of the current mailing list, otherwise it returns undefined. The optional argument specifies which part of the list to check (mod, digest, allow, deny).
$list->sub('firstname.lastname@example.org'); $list->sub(@addresses); $list->sub(@addresses, 'digest');
sub() takes a LIST of addresses and subscribes them to the current mailing list. The optional argument specifies which part of the list to subscribe to (mod, digest, allow, deny).
$list->unsub('email@example.com'); $list->unsub(@addresses); $list->unsub(@addresses, 'mod');
unsub() takes a LIST of addresses and unsubscribes them (if they exist) from the current mailing list. The optional argument specifies which part of the list to unsubscribe from (mod, digest, allow, deny).
$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.
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
$whichlist = $list->thislist; print $list->thislist;
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.
$list->ismodpost; $list->ismodsub; $list->isremote; $list->isdeny; $list->isallow;
The above five functions test various features of the list, and return a 1 if the list has that feature, or a 0 if it doesn't.
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.
@part = $list->getpart('headeradd'); $part = $list->getpart('headeradd'); $list->setpart('headerremove', @part);
getpart() and setpart() can be used to retrieve and set the contents of various text files such as headeradd, headerremove, mimeremove, etc.
Currently only works for MySQL.
createsql() will attempt to create the table specified in the SQL connect options of the current mailing list. It will return an error if the current mailing list was not configured to use SQL, or is Ezmlm was not compiled with MySQL support. See the MySQL info pages for more information.
The version number of the Mail::Ezmlm module is stored in the variable $Mail::Ezmlm::VERSION. The compatibility of this version of Mail::Ezmlm with your system installed version of ezmlm can be checked with
This returns 0 for compatible, or the version string of ezmlm-make(2) if the module is incompatible with your set up.
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.
If an error is encountered, the functions
can be used to determine what the error was.
errno() returns; 0 or undef if there was no error. -1 for an error relating to this module. >0 exit value of the last system() call.
errmsg() returns a string containing a description of the error ($! if it was from a system() call). If there is no error, it returns undef.
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 :)
Guy Antony Halse <firstname.lastname@example.org>
May have problems with newer versions of Perl. Please report bugs to the author.
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/