Differences

This shows you the differences between two versions of the page.


howtos:mandrake [2008/02/08 19:49] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +===== Installing POPFile on Mandrake =====
 +
 +==== General ====
 +
 +This howto describes the process to successfully install POPFile on Mandrake 10.0 configured with the following options;
 +
 +  - POPFile listening on port 110 for POP3 connections with the UI on port 8080. This configuration requires POPFile run as superuser.
 +  - POPFile started from an init.d script and servicing all users on the machine, this implies a shared corpus where all users share the same central corpus. It also implies shared message history in the UI. **Due to the shared corpus and history, if privacy is a concern this setup should not be used.**
 +  - POPFile will be installed to the following directories;
 +    * /usr/share/popfile (the shared programs)
 +    * /var/lib/popfile  (the shared data)
 +    * /var/log/popfile  (popfile logs)
 +
 +
 +==== Step by Step Instructions ====
 +
 +  * Download the Cross Platform zip package for the latest release of POPFile to your home directory, then issue the following shell commands to unzip the package into a popfile subdirectory;
 +<code>
 +mkdir popfile
 +unzip -d popfile popfile*.zip
 +</code>
 +  * Switch to the POPFile directory and issue the following shell commands after switching to superuser.
 +<code>
 +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/
 +</code>
 +  * Create wrapper scripts for the POPFile programs, save the scripts in /usr/sbin/
 +    * popfile-bayes
 +<code>
 +  -!/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 "$@"
 +</code>
 +    * popfile-insert
 +<code>
 +  -!/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 "$@"
 +</code>
 +    * popfile-pipe
 +<code>
 +  -!/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 "$@"
 +</code>
 +    * popfile
 +<code>
 +  -!/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/
 +</code>
 +  * Make the wrapper scripts executable
 +<code>
 +chmod +x /usr/sbin/popfile*
 +</code>
 +  * Put the following init.d script in /etc/init.d/ with the filename popfile 
 +<code>
 +  -!/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</code>
 +}
 +
 +stop() {
 +<code>   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</code>
 +}
 +
 +status() {
 +<code>   if [ "${pid}" = "" ] ; then
 +       echo "down"
 +   else
 +       echo "up"
 +   fi</code>
 +}
 +
 +case "$1" in
 +<code>   start)
 +       start
 +       ;;
 +   stop)
 +       stop
 +       ;;
 +   restart)
 +       stop
 +       start
 +       ;;
 +   status)
 +       status
 +       ;;
 +   *)
 +       echo $"Usage: $0 {start|stop|restart|status}"
 +       exit 1
 +       ;;</code>
 +esac
 +
 +cd $cwd
 +exit 0
 +
 +</code>
 +  * Install the init.d service
 +<code>
 +chmod +x /etc/init.d/popfile
 +chkconfig --add /etc/init.d/popfile
 +</code>
 +  * Create a symbolic link to popfile-service
 +<code>
 +ln -s /etc/init.d/popfile /usr/sbin/popfile-service
 +</code>
 +  * Startup POPFile
 +<code>
 +popfile-service start
 +</code>
 +  * Test the UI, from your browser, visit the url http://127.0.0.1:8080 . If the UI doesn't work, review the installation steps carefully and check the TroubleShooting page of the Wiki.
 +
 +  * Cleanup, delete the downloaded source package from your home directory. **Make sure you have exited superuser mode before doing this.**
 +<code>
 +cd ~
 +rm -Rf popfile
 +rm popfile*.zip
 +</code>
 +
 +==== Configuring the Mail Client ====
 +
 +  - The mail client, KMail, retrieves direct from the ISP via POP3. If you are using this method, follow the general POPFile instructions for configuring your mail client, e.g., change the server to 127.0.0.1 and the account to realserver.com:username
  
 
Old revisions

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.

Recent changes RSS feed Donate Driven by DokuWiki
The content of this wiki is protected by the GNU Fee Documentation License