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.4xx and 5.0 ). 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 (idx < v5.0) or DIR/flags (idx >= v5.0) if one of them exists. If it can't find these files 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. These functions are considered DEPRECATED as their result is not reliable. Use "getconfig" instead.
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.
$list->get_available_text_files; $list->get_text_content('sub-ok'); $list->set_text_content('sub-ok', @content);
These functions allow you to manipulate the text files, that are used for automatic replies by ezmlm.
These two functions are available if you are using ezmlm-idx v5.0 or higher. is_text_default() checks, if there is a customized text file defined for this list. reset_text() removes the customized text file from this list. Ezmlm-idx will use system-wide default text file, if there is no customized text file for this list.
Mail::Ezmlm->get_config_dir; $list->get_config_dir; $list->set_config_dir('/etc/ezmlm-local');
These functions access the file 'conf-etc' in the mailing list's directory. The static function (first example) always returns the default configuration directory of ezmlm-idx (/etc/ezmlm).
$list->get_available_languages; $list->get_lang; $list->set_lang('de'); $list->get_charset; $list->set_charset('iso-8859-1:Q');
These functions allow you to change the language of the text files, that are used for automatic replies of ezmlm-idx (since v5.0 the configured language is stored in 'conf-lang' within the mailing list's directory). Customized files (in the 'text' directory of a mailing list directory) override the default language files. Empty strings for set_lang() and set_charset() reset the setting to its default value.
The result is one of the following: 0 - unknown 3 - ezmlm 0.53 4 - ezmlm-idx 0.4xx 5 - ezmlm-idx 5.x 5.1 - ezmlm-idx 5.1 6 - ezmlm-idx 6.x 7 - ezmlm-idx 7.x
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> Lars Kruse <email@example.com>
There are no known bugs. Please report bugs to the author or use the bug tracking system at https://systemausfall.org/trac/ezmlm-web.
ezmlm(5), ezmlm-make(2), ezmlm-sub(1), ezmlm-unsub(1), ezmlm-list(1), ezmlm-issub(1) http://rucus.ru.ac.za/~guy/ezmlm/ https://systemausfall.org/toolforge/ezmlm-web http://www.ezmlm.org/ http://www.qmail.org/