#!/usr/bin/eperl
###
#
# Copyright (c) Ensim Corporation 2000, 2001   All Rights Reserved.
#
# This software is furnished under a license and may be used and copied
# only  in  accordance  with  the  terms  of such  license and with the
# inclusion of the above copyright notice. This software or any other
# copies thereof may not be provided or otherwise made available to any
# other person. No title to and ownership of the software is hereby
# transferred.
#
# The information in this software is subject to change without notice
# and  should  not be  construed  as  a commitment by Ensim Corporation.
# Ensim assumes no responsibility for the use or  reliability  of its
# software on equipment which is not supplied by Ensim.
# --------------------------------------------------------------------------
# $Id: list_mlists,v 1.1.1.1 2008-03-01 00:21:36 aarefyev Exp $
# $Name: not supported by cvs2svn $
# --------------------------------------------------------------------------

# list_lists : It lists all the mailing lists that exist
# on this server.
# -------------------------------------------------------
# Usage: list_mlists 
# -------------------------------------------------------


push @INC, ($ENV{'OCW_SVCPATH'} || "/usr/lib/opcenter")."/cmdline_common";
push @INC, ($ENV{'OCW_SVCPATH'} || "/usr/lib/opcenter")."/sendmail";

require '/usr/lib/opcenter/cmdline_common/CmdLineCoder.pm';
require '/usr/lib/opcenter/majordomo/mymajordomo-lib.pl';
require '/usr/lib/opcenter/majordomo/majordomo.pm';
require '/usr/lib/opcenter/majordomo/ctime.pl';

$conf = &get_config();

local @list = &majordomo::list_lists($conf);

#need to encode this list
local $rv='';
foreach $l (@list) {
	# using & as the delim
	$rv = "$rv" . CmdLineCoder::encode_string("$l") . "&";
}
chop($rv);
print $rv, "\n";
