MailingList Archiving

From QmailToaster
Jump to navigation Jump to search


If you want to setup Mailinglist Archiving system like, you may want to install MHonArc and mharc. But for simplity I have create a scripts to install them which can be directly run at QMailToaster or QMT-ISO box

Install how to:

# vi
# This script installs MHonArc (,
# Namazu (, Procmail ( 
# then install (
# for web-based mailinglist archiving
# on QMT-ISO or QMailToaster box
# Mailinglist Archiving using MHonArc/mharc for QMT-ISO
# ver 1.0 beta
# 20-Oct-2007
#---------- Main Configuration ------------
# You should edit them to make sure you download the latest version
# all variables are in here
# please make sure they are valid before running this install script

MHONARC_FILE=MHonArc-2.6.16-1.noarch.rpm # Please check the above site for latest version
NAMAZU_VER=namazu-2.0.17 # Please check the above site for latest version
MHARC_VER=mharc-0.7.3 # Please check the above site for latest version
QMTISO="1" # this script should run properly on QMT-ISO
           # if you are not using QMT-ISO but using QMailToaster
           # change it to 0

#---------- Begin Process installation ------------
# Below this line should be edited
# but if you found some bugs or add some feature
# please notify me.

echo "This script installs MHonArc (,"
echo "Namazu (, Procmail (" 
echo "then install ("
echo "for web-based mailinglist archiving"
echo "on QMT-ISO or QMailToaster box"
echo ""
echo "This is not automatic installation script but rather interactive"
echo "So I need you to answer some question"
echo "To make sure you use the latest version of packages,"
echo "you need to edit the variables on this script."
echo ""
echo "mharc requires Perl and Make,"
echo "this install script assume that only be running at qmt-iso box"
echo "which already has them by default."
echo "if not, so make sure perl and make available manually."
echo ""
echo "Press [enter] to continue"
echo "or press [ctrl]-[c] to cancel installation"
read i

#--- check user

if [ ! "$VALID_USER" == "$CURRENT_USER" ]
    echo "You have to root to run this script"
    echo "Installation begin..."
#--- check user

#--- check QMT-ISO
#echo $CWD
if [ "$QMTISO" == "1" ]
   LOAD_LOC=/var/qmt   # Where the package is located
   cd $LOAD_LOC
#--- check QMT-ISO

# create own folder to dump all necessary packages

# install MhonArc - A mail-to-HTML converter
echo "install MhonArc - A mail-to-HTML converter"

# install namazu - a Full-Text Search Engine
echo "install namazu - a Full-Text Search Engine"
tar xzvf $NAMAZU_FILE

# install perl's File-MMagic
cd File-MMagic
perl Makefile.PL
make install
cd ..

make check
make install
cd ..

# install procmail
echo "install procmail"
yum -y install procmail

# mharc requires Perl and Make,
# this install script assume that only be running at qmt-iso box
# which already has them by default.
# if not, so make sure perl and make available manually

# install Mharc - web-based searchable mail archives
echo "install Mharc - web-based searchable mail archives"
tar xzvf $MHARC_FILE

# download mharc-maildir.patch to enable maildir support for mharc
echo "download mharc-maildir.patch to enable maildir support for mharc"
patch -p0 < mharc-maildir.patch


echo ""
echo "Preferred answer"
echo " Pathname to install mharc: /var/www/html/mailarchive"
echo " Root URL for archives: /mailarchive"
echo ""
echo "While editing lib/ file, below is preferred parameter:"
echo " SW_ROOT=/var/www/html/mailarchive"
#echo " MHONARC_LIB=/usr/lib/MHonArc/"
echo " #ORGMAIL=/var/spool/mail/$LOGNAME"
echo " ORGMAIL=/home/vpopmail/domains/"
echo "         after this you should create email account"
echo "         and subscribe it to milist you want yo archive"
echo " IS_MAIL_SPOOL=1"
echo "" 
echo " ROOT_URL=/mailarchive"
#echo "      blank no need to fill anything there is you are using suggested parameter"
echo ""
#echo "dont forget to create that email account"
echo ""
echo "File lib/lists.def no need to edit now, you can always edit them later"
echo "visit"
echo "to find out what options available"
echo ""
echo "simple example option on lib/lists.def if you want to archive milis"
echo " Name: TOP1 #w/o space"
echo " Description: Milist TOP1"
echo " Address:"
echo ""
echo "After that type 'make' on <mharc-root> folder [/var/www/html/mailarchive]"
echo ""

# lets install mharc
env PERL5LIB=/usr/lib/MHonArc perl

# go to mharc install folder
echo "type in your SW_ROOT again here "
echo "only if it different from default [/var/www/html/mailarchive] "
echo "otherwise just press [enter] : "
read SW_ROOT
if [ -n "$SW_ROOT" ]
 then echo ""
 else SW_ROOT="/var/www/html/mailarchive"

touch info

# install mharc's crontab for maintenance purpose
# get what are in crontab list
crontab -l >> etc/
cat etc/crontab >> etc/
# create crontab again from that file
crontab etc/
echo ""
echo "Please enable these lines"
echo " #57 * * * 1-6    /var/www/html/mailarchive/bin/logcmd -log /var/www/html/mailarchive/log/cron.log -- /var/www/html/mailarchive/bin/read-maildir"
echo " #57 0,4-23 * * 0 /var/www/html/mailarchive/bin/logcmd -log /var/www/html/mailarchive/log/cron.log -- /var/www/html/mailarchive/bin/read-maildir"
echo " #57 2 * * 0      /usr/sbin/logrotate -s /var/www/html/mailarchive/etc/logrotate.status /var/www/html/mailarchive/etc/logrotate.conf"
echo ""
echo "Sorry you have to edit them manually, press [enter] to begin"
read i
crontab -e
# install mharc's apache configuration
cp etc/apache.conf /etc/httpd/conf.d/mharc.conf
echo ""
#echo "Please disable this line"
#echo " ScriptAlias /cgi-bin/ /var/www/html/mailarchive/cgi-bin/"
echo "If you install mharc other than /var/www/html/mailarchive"
echo "You may want to enable this line"
echo " #Alias <ROOT_URL> \"<mharc-install-root>\""
echo ""
echo "Sorry you have to edit them manually, press [enter] to begin"
read i
vi /etc/httpd/conf.d/mharc.conf
# restart apache to enable mharc website
service httpd restart
echo ""
echo "In my mharc installation there is bug in <mharc-root>/html/<list>/index.html"
echo "which not loading css file"
echo "Please add this line"
echo " <link rel=\"stylesheet\" type=\"text/css\" href=\"/mailarchive/html/stylesheet.css\">"
echo "after this line"
echo " <title>$LIST-TITLE$ Archives</title>"
echo ""
echo "Sorry you have to edit them manually, press [enter] to begin"
read i
vi html/.PNM.head

# make a softlink for index.html
ln -s html/lists.html index.html
cd html
ln -s lists.html index.html

echo "now you can access your mailinglist archive at:"
echo "<mharc-ROOT_URL>"
echo ""
echo "for customization you can visit these websites:"
echo "MHonARc"
echo "mharc"

cd $CWD
# script end here

# chmod +x
# ./

More info about the script you visit my blog about it and read the script description

For customizing your Mailinglist Archiving system visit MHonArc and mharc website