QmailtoasterMain Page | About | Help | FAQ | Special pages | Log in

Printable version | Disclaimers | Privacy policy

MailingList Archiving

From Qmailtoaster

If you want to setup Mailinglist Archiving system like Mail-Archive.com, 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 install-mailarchive.sh
#!/bin/sh
# This script installs MHonArc (www.mhonarc.org),
# Namazu (www.namazu.org), Procmail (www.procmail.org) 
# then install (www.mhonarc.org/mharc)
# for web-based mailinglist archiving
# on QMT-ISO or QMailToaster box
#
# Mailinglist Archiving using MHonArc/mharc for QMT-ISO
# ver 1.0 beta
# pakogah@pala.bo-tak.info
# http://am3n.profusehost.net
# 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_SITE=http://www.mhonarc.org/release/MHonArc/tar/
MHONARC_FILE=MHonArc-2.6.16-1.noarch.rpm # Please check the above site for latest version
NAMAZU_SITE=http://www.namazu.org/stable/
NAMAZU_VER=namazu-2.0.17 # Please check the above site for latest version
NAMAZU_FILE=$NAMAZU_VER.tar.gz
MHARC_SITE=http://www.mhonarc.org/release/mharc/tar/
MHARC_VER=mharc-0.7.3 # Please check the above site for latest version
MHARC_FILE=$MHARC_VER.tar.gz
QMTISO="1" # this script should run properly on QMT-ISO
           # if you are not using QMT-ISO but using QMailToaster
           # change it to 0
TMPFOLDER="mailarchivefiles"

#---------- 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 (www.mhonarc.org),"
echo "Namazu (www.namazu.org), Procmail (www.procmail.org)" 
echo "then install (www.mhonarc.org/mharc)"
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
VALID_USER="root"
CURRENT_USER=`whoami`

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

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

# create own folder to dump all necessary packages
mkdir $TMPFOLDER
cd $TMPFOLDER


# install MhonArc - A mail-to-HTML converter
echo "install MhonArc - A mail-to-HTML converter"
wget $MHONARC_SITE$MHONARC_FILE
rpm -Uvh $MHONARC_FILE

# install namazu - a Full-Text Search Engine
echo "install namazu - a Full-Text Search Engine"
wget $NAMAZU_SITE$NAMAZU_FILE
tar xzvf $NAMAZU_FILE
cd $NAMAZU_VER

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

./configure
make
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"
wget $MHARC_SITE$MHARC_FILE
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"
wget http://am3n.profusehost.net/files/mharc-maildir.patch
patch -p0 < mharc-maildir.patch

cd $MHARC_VER

echo ""
echo "Preferred answer"
echo " Pathname to install mharc: /var/www/html/mailarchive"
echo " Root URL for archives: /mailarchive"
echo ""
echo "While editing lib/config.sh 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/yourcompany.com/archive/Maildir/new"
echo "         after this you should create email account archive@yourcompany.com"
echo "         and subscribe it to milist you want yo archive"
echo " IS_MAIL_SPOOL=1"
echo " ADMIN_ADDRESS=youraddress@yourcompany.com" 
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 http://www.mhonarc.org/mharc/doc/bin/mk-procmailrc.html#list_definition_file"
echo "to find out what options available"
echo ""
echo "simple example option on lib/lists.def if you want to archive milis top1@yourcompany.com"
echo " Name: TOP1 #w/o space"
echo " Description: Milist TOP1"
echo " Address: top1@yourcompany.com"
echo ""
echo "After that type 'make' on <mharc-root> folder [/var/www/html/mailarchive]"
echo ""

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

# 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"
fi

cd $SW_ROOT
touch info

# install mharc's crontab for maintenance purpose
# get what are in crontab list
crontab -l >> etc/yourcrontab.save
cat etc/crontab >> etc/yourcrontab.save
# create crontab again from that file
crontab etc/yourcrontab.save
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 "http://www.yourcompany.com/<mharc-ROOT_URL>"
echo ""
echo "for customization you can visit these websites:"
echo "MHonARc http://www.mhonarc.org"
echo "mharc http://www.mhonarc.org/mharc"

cd $CWD
# script end here


# chmod +x install-mailarchive.sh
# ./install-mailarchive.sh

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

Retrieved from "http://wiki.qmailtoaster.com/index.php/MailingList_Archiving"

This page has been accessed 4,751 times. This page was last modified on 8 March 2011, at 04:17. Content is available under GNU Free Documentation License 1.2.


Find

Browse
Main page
Community portal
Current events
Recent changes
Random page
Help
Edit
View source
Editing help
This page
Discuss this page
New section
Printable version
Context
Page history
What links here
Related changes
My pages
Log in / create account
Special pages
New pages
File list
Statistics
More...