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 ( 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


Setting up a new Ezmlm object:

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

Changing which list the Ezmlm object points at:


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. An optional second argument specifies the part of the list to display (mod, digest, allow, deny). If the part is specified, then the FILEHANDLE must be specified.
   $list->list(\*STDERR, 'deny');
The second method returns an array containing the subscribers. The optional argument specifies which part of the list to display (mod, digest, allow, deny).
   @subscribers = $list->subscribers;
   @subscribers = $list->subscribers('allow');

Testing for subscription:

   $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).

Subscribing to a list:

   $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).

Unsubscribing from a list:

   $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).

Creating a new list:


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, -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:


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.


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.

Updating the configuration of the current list:


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.

Manage language dependent text files

   $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.

Change the list's settings (for ezmlm-idx >= 5.0)


These function access the file 'conf-etc' in the mailing list's directory. The static function always returns the default configuration directory of ezmlm-idx (/etc/ezmlm).


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.

Get the installed version of ezmlm


The result is one of the following: 0 - unknown 3 - ezmlm 0.53 4 - ezmlm-idx 0.4xx 5 - ezmlm-idx 5.x

Creating MySQL tables:


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.

Checking the Mail::Ezmlm and ezmlm version numbers

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 <>
 Lars Kruse <>


 There are no known bugs.

 Please report bugs to the author or use the bug tracking system at


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

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 961:

'=item' outside of any '=over'

Around line 978:

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