Hello All,
I've installed mailman on SLES 9 with running web-cyradm installation.
I wrote a little step-by-step manual (so I won't forget it next time I need to
do it) and want to share it with you.
You may use it on another distributions with a little adjusments, appropriate
for your distr.
If you make step 11 after step 4 you may skip step 12.
You should always create and delete your lists via the scripts attached here
(they also deal with entrys in the mail db).
You only need to edit the variable section of these scripts to include your DB
connection details.
Any suggestions/comments are welcomed.
After installing mailman via YaST or with .rpm package (with all the
dependencies) we go to -
CONFIGURING MAILMAN:
1) To check if the permissions on mailman files are right, run
/usr/lib/mailman/bin/check_perms -f
2)
a) In the Apache:
vi /etc/apache2/default-server.conf (add these lines):
##################
##
## mailman
##
ScriptAlias /mailman/ "/usr/lib/mailman/cgi-bin/"
<Directory "/usr/lib/mailman/cgi-bin/">
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
Alias /pipermail/ "/var/lib/mailman/archives/public/"
<Directory "/var/lib/mailman/archives/public">
AddDefaultCharset Off
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
# Redirect queries to /mailman to the listinfo page (recommended)
RedirectMatch /mailman[/]*$ http://myserver.haifa.ac.il/mailman/listinfo
##
## end mailman
##
##################
b) cp /usr/lib/mailman/icons/* /usr/share/apache2/icons/
c) vi /usr/lib/mailman/Mailman/mm_cfg.py (make sure this line is like this):
IMAGE_LOGOS = '/icons/'
3) copy mailman-newlist.pl to /usr/lib/mailman/bin and run
# /usr/lib/mailman/bin # chmod 755 mailman-newlist.pl
# /usr/lib/mailman/bin # chmod 755 mailman-dellist.pl
4) vi /usr/lib/mailman/Mailman/mm_cfg.py (add this line, it is sitewide list):
MAILMAN_SITE_LIST = 'mailman'
5)
a) vi /etc/postfix/main.cf (make sure this line looks like this):
alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
Note:
you may also add thes lines to main.cf (I've added):
# Mailman stuff #
owner_request_special = no
recipient_delimiter = +
# End of Mailman stuff
b)Initialize aliases file:
/usr/lib/mailman/bin/genaliases
c) chown mailman:mailman /var/lib/mailman/data/aliases*
6) install python-xml to solve cgi-script "low level failure" (this is SuSE
specific problem):
Note:
What seems to be common here is the occurance on SUSE. In my search for a
solution I found that this occurs with on auto-update on Suse - patch 10
for mailman 2.1.4 to be exact. See:
http://www.novell.com/linux/download/updates/91_i386.html
What's interesting is that this patch can be installed without a
dependency: python-xml.
So, if you are encoutering this problem, the likely problem is that you
are missing a dependency, and the solution is drop-dead easy: Just
install python-xml
7) Now create widesite list
# /usr/lib/mailman/bin/mailman-newlist.pl [EMAIL PROTECTED] [EMAIL PROTECTED]
8) Configure widesite list:
# /usr/lib/mailman/bin/config_list -i /var/lib/mailman/data/sitelist.cfg mailman
9) Set up cron:
# /usr/lib/mailman/cron/crontab -u mailman crontab.in
10) Now start it and go to the web interface to check it:
# insserv mailman
# /etc/init.d/mailman start
11) # vi /usr/lib/mailman/Mailman/mm_cfg.py (Edit the following line to
correspond with your mail domain):
DEFAULT_EMAIL_HOST = 'myserver.haifa.ac.il'
12) To fix the URL of any existing list run (for example for mailman list):
# /usr/lib/mailman/bin/withlist -l -r fix_url mailman
13) Create 'site password':
# /usr/lib/mailman/bin/mmsitepass secret
14) Create 'list creator' password:
# /usr/lib/mailman/bin/mmsitepass -c secret2
15) Create your first mailing list, and enjoy.
Best Regards,
Leon Kolchinsky
#!/usr/bin/perl
# Entfernt eine Mailingliste.
#
# By Martin Müller, 11.12.2002
# v.1.1, 19.04.2003
# Updated by Leon Kolchinsky
# This script is used to delete integrated mailman mailinglists
# into the web-cyradm setup.
# The following is done:
# - delete the list using the mailman rmlist -a command
# - delete the needed entrys in the mail db
# check/correct the following variables
$mailmanbins='/usr/lib/mailman/bin';
$postfixconf='/var/lib/mailman/data';
$postfixalias='aliases';
$dbname='mail';
$dbuser='mailadmin';
$dbpass='secret';
# no changes from here necessary -----------------------------
if (@ARGV != 1)
{
print "usage: mailman-dellist [EMAIL PROTECTED]>\n";
print "Ex.: mailman-dellist [EMAIL PROTECTED]";
exit 1;
}
$listname=$ARGV[0];
($list,$domain)=split(/\@/,$listname);
# $mmlistname="$domain-$list"; # use this option instead of the following line
in case you want to implement really compatible (politically) list to web-cyradm
$mmlistname="$list";
print "Deleting entrys from $postfixconf/$postfixalias.\n";
$result=`$mailmanbins/rmlist -a $mmlistname`;
if ($?)
{
print "Problems deleting list:\n";
print "$result \n";
print "\n";
exit 1;
}
else
{
print "List deleted.\n\n";
print "\n\n";
#$result=`cp $postfixconf/$postfixalias $postfixconf/$postfixalias.bak`;
#$result=`grep -v $mmlistname $postfixconf/$postfixalias
>/tmp/$postfixalias`;
#$result=`cp -f /tmp/$postfixalias $postfixconf/$postfixalias`;
#$result=`cd $postfixconf; postalias $postfixalias`;
open(SQL,">/tmp/$mmlistname-delete.sql");
print SQL "DELETE FROM virtual WHERE alias = '[EMAIL PROTECTED]' LIMIT
1;\n";
print SQL "DELETE FROM virtual WHERE alias = '[EMAIL PROTECTED]' LIMIT
1;\n";
print SQL "DELETE FROM virtual WHERE alias = '[EMAIL PROTECTED]' LIMIT
1;\n";
print SQL "DELETE FROM virtual WHERE alias = '[EMAIL PROTECTED]' LIMIT
1;\n";
print SQL "DELETE FROM virtual WHERE alias = '[EMAIL
PROTECTED]' LIMIT 1;\n";
print SQL "DELETE FROM virtual WHERE alias = '[EMAIL
PROTECTED]' LIMIT 1;\n";
print SQL "DELETE FROM virtual WHERE alias = '[EMAIL
PROTECTED]' LIMIT 1;\n";
print SQL "DELETE FROM virtual WHERE alias = '[EMAIL
PROTECTED]' LIMIT 1;\n";
print SQL "DELETE FROM virtual WHERE alias = '[EMAIL
PROTECTED]' LIMIT 1;\n";
print SQL "DELETE FROM virtual WHERE alias = '[EMAIL
PROTECTED]' LIMIT 1;\n";
close(SQL);
$result=`mysql $dbname -u $dbuser -p$dbpass
</tmp/$mmlistname-delete.sql`;
if ($?)
{
print "Problems deleting SQL entys:\n";
print $result;
print "\n";
print "Check the SQL file /tmp/$mmlistname-delete.sql too.\n";
print "Maybe you have to delete/check the following entrys in
the Mail DB, Table
Virtual:\n-------------------------------------------------------------------------\n";
print "alias: \tdest:\n";
print "[EMAIL PROTECTED] \t$mmlistname\n";
print "[EMAIL PROTECTED] \t$mmlistname-admin\n";
print "[EMAIL PROTECTED] \t$mmlistname-request\n";
print "[EMAIL PROTECTED] \t$mmlistname-owner\n";
print
"----------------------------------------------------------------\n";
}
else
{
print "Sucessfully deleted the entrys in the Mail DB, Table
Virtual.\n-------------------------------------------------------------------------\n";
}
}
$result=`rm -f /tmp/$mmlistname-delete.sql`;#!/usr/bin/perl
# Erstellt eine neue Mailingliste.
#
# By Martin Müller, 11.12.2002
# v.1.1
# Updated by Leon Kolchinsky
# This script is used to create and integrate mailman mailinglists
# into the web-cyradm setup.
# The following is done:
# - create the list using the mailman newlist command
# - insert the needed entrys in the mail db
# check/correct the following variables
$mailmanbins='/usr/lib/mailman/bin';
$postfixconf='/var/lib/mailman/data';
$postfixalias='aliases';
$dbname='mail';
$dbuser='mailadmin';
$dbpass='secret';
# the following setting is not critical. It's only for showing the
# mailinglist admin URLs. The Webserver configuration for mailman
# is another job (only once).
$myurl='http://myserver.haifa.ac.il/mailman';
# no changes from here necessary -----------------------------
if (@ARGV < 1)
{
print "usage: mailman-newlist <[EMAIL PROTECTED]> [admin-mail:[EMAIL
PROTECTED]";
print "Ex.: mailman-newlist [EMAIL PROTECTED] [EMAIL PROTECTED]";
exit 1;
}
$listname=$ARGV[0];
$admin=$ARGV[1];
$password=$ARGV[0];
($list,$domain)=split(/\@/,$listname);
if ($admin eq "")
{
$admin="[EMAIL PROTECTED]"; # if no admin mail indicated while list
creation, change here to default admin mail to be the the administrator of
newly created list
print "No admin-mail defined. Assuming $admin\n";
}
# $mmlistname="$domain-$list"; # use this option instead of the following line
in case you want to implement really compatible (politically) list to web-cyradm
$mmlistname="$list";
$result=`$mailmanbins/newlist -q $mmlistname $admin $password`; # add -q after
newlist command if you don't want to notify list owner
if ($?)
{
print "Problems creating new List:\n";
print `tail -n 2 /var/lib/mailman/data/aliases`;
print "\n";
}
else
{
print "Created new list. The entrys in $postfixconf/$postfixalias will
be:\n";
print `tail -n 12 /var/lib/mailman/data/aliases`;
print "\n\n";
# $result=`tail -n 5 /tmp/new-mailman-list
>>$postfixconf/$postfixalias`;
# $result=`cd $postfixconf; postalias $postfixalias`;
open(SQL,">/tmp/$mmlistname-create.sql");
print SQL "INSERT INTO virtual (alias, dest, username, status) VALUES
('[EMAIL PROTECTED]', '$mmlistname', '','1');\n";
print SQL "INSERT INTO virtual (alias, dest, username, status) VALUES
('[EMAIL PROTECTED]', '$mmlistname-admin', '','1');\n";
print SQL "INSERT INTO virtual (alias, dest, username, status) VALUES
('[EMAIL PROTECTED]', '$mmlistname-bounces', '','1');\n";
print SQL "INSERT INTO virtual (alias, dest, username, status) VALUES
('[EMAIL PROTECTED]', '$mmlistname-confirm', '','1');\n";
print SQL "INSERT INTO virtual (alias, dest, username, status)
VALUES ('[EMAIL PROTECTED]', '$mmlistname-join', '','1');\n";
print SQL "INSERT INTO virtual (alias, dest, username, status)
VALUES ('[EMAIL PROTECTED]', '$mmlistname-leave', '','1');\n";
print SQL "INSERT INTO virtual (alias, dest, username, status)
VALUES ('[EMAIL PROTECTED]', '$mmlistname-owner', '','1');\n";
print SQL "INSERT INTO virtual (alias, dest, username, status)
VALUES ('[EMAIL PROTECTED]', '$mmlistname-request', '','1');\n";
print SQL "INSERT INTO virtual (alias, dest, username, status)
VALUES ('[EMAIL PROTECTED]', '$mmlistname-subscribe', '','1');\n";
print SQL "INSERT INTO virtual (alias, dest, username, status)
VALUES ('[EMAIL PROTECTED]', '$mmlistname-unsubscribe', '','1');\n";
close(SQL);
$result=`mysql $dbname -u $dbuser -p$dbpass
</tmp/$mmlistname-create.sql`;
if ($?)
{
print "Problems creating SQL entys:\n";
print $result;
print "\n";
print "Check the SQL file /tmp/$mmlistname-create.sql too.\n";
print "Maybe you have to insert/check the following entrys in
the Mail DB, Table
Virtual:\n-------------------------------------------------------------------------\n";
print "alias: \tdest:\n";
print "[EMAIL PROTECTED] \t$mmlistname\n";
print "[EMAIL PROTECTED] \t$mmlistname-admin\n";
print "[EMAIL PROTECTED] \t$mmlistname-request\n";
print "[EMAIL PROTECTED] \t$mmlistname-owner\n";
print
"----------------------------------------------------------------\n";
}
else
{
print "Sucessfully created the entrys in the Mail DB, Table
Virtual.\n-------------------------------------------------------------------------\n";
}
print "The list data:\n";
print "Admin: \t$admin\n";
print "Password: \t$password\n";
print "Web: \t$myurl/listinfo/$mmlistname\n";
print "Admin: \t$myurl/admin/$mmlistname\n";
print "\nOr if Apache Virtual Host is configured for this domain: \n";
print "Web: \thttp://www.$domain/mailman/listinfo/$mmlistname\n";
print "Admin: \thttp://www.$domain/mailman/admin/$mmlistname\n";
print
"----------------------------------------------------------------\n";
print "\n";
}
# $result=`rm -f /tmp/new-mailman-list`;
$result=`rm -f /tmp/$mmlistname-create.sql`;_______________________________________________
This mailing list is hosted and supported
by bit-heads GmbH | http://www.bit-heads.ch
_______________________________________________
Web-cyradm mailing list
[email protected]
http://www.web-cyradm.org/mailman/listinfo/web-cyradm