This howto describes the process to successfully install POPFile on Mandrake 10.0 configured with the following options;
mkdir popfile unzip -d popfile popfile*.zip
cd popfile su mkdir /usr/share/popfile mkdir /var/lib/popfile mkdir /var/log/popfile cp *.gif *.pl *.png *.ico /usr/share/popfile/ cp stopwords /usr/share/popfile/ cp license /usr/share/popfile/ cp v*.change /usr/share/popfile/ chmod +x /usr/share/popfile/*.pl cp -Rf Classifier /usr/share/popfile/ cp -Rf POPFile /usr/share/popfile/ cp -Rf Proxy /usr/share/popfile/ cp -Rf UI /usr/share/popfile/ cp -Rf languages /usr/share/popfile/ cp -Rf manual /usr/share/doc/popfile/ cp -Rf skins /usr/share/popfile/
-!/bin/sh cd /usr/share/popfile export POPFILE_ROOT=/usr/share/popfile export POPFILE_USER=/var/lib/popfile umask 0027 exec /usr/share/popfile/bayes.pl "$@"
-!/bin/sh cd /usr/share/popfile export POPFILE_ROOT=/usr/share/popfile export POPFILE_USER=/var/lib/popfile umask 0027 exec /usr/share/popfile/insert.pl "$@"
-!/bin/sh cd /usr/share/popfile export POPFILE_ROOT=/usr/share/popfile export POPFILE_USER=/var/lib/popfile umask 0027 exec /usr/share/popfile/pipe.pl "$@"
-!/bin/sh cd /usr/share/popfile export POPFILE_ROOT=/usr/share/popfile export POPFILE_USER=/var/lib/popfile umask 0027 exec /usr/share/popfile/popfile.pl "$@" --set config_piddir=/var/run/ --set logger_logdir=/var/log/popfile/
chmod +x /usr/sbin/popfile*
-!/bin/sh - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later - version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - Copyright (c) 2003 John Graham-Cumming - - === - - popfile - - A shell script designed to start and stop POPFile from within - /etc/init.d on *nix systems. - - usage: popfile { start | stop | restart | } - - RedHat comment block... - - chkconfig: 345 80 20 - description: popfile is a POP3 proxy and mail filter - pidfile: /var/run/popfile.pid - processname: popfile - - - LSB comment block... - - - BEGIN INIT INFO - Provides: popfile - Required-Start: $network - Required-Stop: $network - Default-Start: 3 4 5 - Default-Stop: 3 4 5 - Description: popfile is a POP3 proxy and mail filter - END INIT INFO - popfile_root=/usr/share/popfile popfile_user=/var/lib/popfile popfile="${popfile_root}/popfile.pl" cwd=`pwd` popfile_pid="/var/run/popfile.pid" pid=`cat ${popfile_pid} 2> /dev/null` start() { <code> echo -n "Starting POPFile as background process: " if [ "${pid}" = "" ] ; then cd ${popfile_root} export POPFILE_ROOT=${popfile_root} export POPFILE_USER=${popfile_user} ${popfile} --set config_piddir=/var/run/ --set logger_logdir=/var/log/popfile/ &> /var/log/popfile/popfile & echo " done" else echo " POPFile already running" fi
}
stop() {
echo -n "Stopping POPFile: " if [ "${pid}" = "" ] ; then echo "POPFile not running" else kill $pid if [ -e $popfile_pid ] ; then rm ${popfile_pid} fi pid="" echo " done" fi
}
status() {
if [ "${pid}" = "" ] ; then echo "down" else echo "up" fi
}
case “$1” in
start) start ;; stop) stop ;; restart) stop start ;; status) status ;; *) echo $"Usage: $0 {start|stop|restart|status}" exit 1 ;;
esac
cd $cwd exit 0
</code>
chmod +x /etc/init.d/popfile chkconfig --add /etc/init.d/popfile
ln -s /etc/init.d/popfile /usr/sbin/popfile-service
popfile-service start
cd ~ rm -Rf popfile rm popfile*.zip
Should you find anything in the documentation that is incomplete, unclear, outdated or just plain wrong, please let us know and leave a note in the Documentation Forum.