Hi!
I've made a try on installing POPFile on SME 7.x
It's very easy but I really don't know what you are going to think about this. So please stop me if you find this stupid or heretic!
Here we go! POPFile is a POP3 Proxy used to classify email.
It's based an bayes filtering and is coded in perl.
POPFile is designed to run over POP3 protocol, but seems to be compatible with IMAP (not recommended by the dev team as POPFile was written for POP3 !)
At the begining, no categories are created and POPFile only knows a few words to ignore...
You just have to create categories and reclassify emails in them.
The learning period depends on how many categories you will be using and how much mail you receive (the more you receive, the faster it's operational)
The web interface is really simple and userfriendly...
Here the install howto:
1) Download/install dependency
#yum install perl-DBD-SQLite --enablerepo=dag
If you don't have DAG repo yet, just add it! You can found how on this forum or in the wiki searching a little...
2) Download POPFile
#wget "http://mesh.dl.sourceforge.net/sourceforge/popfile/popfile-0.21.2.zip"
3) Create install directory and unzip files
mkdir -p /opt/popfile
unzip -q /root/addons/popfile/popfile-0.21.2.zip -d /opt/popfile
4) Make popfile.pl executable
chmod 744 /opt/popfile/popfile.pl
5) Because POPFile can be installed in several configuration, we have to modify default configuration
sed -e "s/8080/7676/" /opt/popfile/UI/HTML.pm >/opt/popfile/UI/HTML.pm.new
sed -e "s/config_( 'local', 1/config_( 'local', 0/" /opt/popfile/UI/HTML.pm.new >/opt/popfile/UI/HTML.pm
rm -f /opt/popfile/UI/HTML.pm.new
sed -e "s/config_( 'port', 110/config_( 'port', 1100/" /opt/popfile/Proxy/POP3.pm >/opt/popfile/Proxy/POP3.pm.new
sed -e "s/config_( 'secure_port', 110/config_( 'secure_port', 1100/" /opt/popfile/Proxy/POP3.pm.new >/opt/popfile/Proxy/POP3.pm
sed -e "s/config_( 'local', 1/config_( 'local', 0/" /opt/popfile/Proxy/POP3.pm >/opt/popfile/Proxy/POP3.pm.new
mv -f /opt/popfile/Proxy/POP3.pm.new /opt/popfile/Proxy/POP3.pm
Port 7676 will be used for accessing the web interface (instead of 8080 by default which could cause problems if using DansGuardian)
Port 1100 will be used to wait for incoming POP3 connexions (defaut port is 110, used by POP3 !)
The server will accept incoming POP3 connexions (disabled by default as POPFile can be installed on a single PC)
The web interface will be accessible from LAN only (restricted to 127.0.0.1 by default which is really not easy !) Don't touch this option or you will have to enable again from SME's shell using LYNX ! (lynx
http://127.0.0.1:7676)
Server will accept multiples POP3 connexions (disabled by default as POPFile can be installed on a single PC)
6) Create the service : go in '/etc/rc.d/init.d/' directory and create a file named 'popfile'. Copy and paste the following in it
#!/bin/sh
#
# chkconfig: 345 80 20
# description: popfile is a POP3 Proxy
# pidfile: /opt/popfile/popfile.pid
# processname: popfile
homedir=/opt/popfile
case "$1" in
start)
echo "Starting popfile..."
chemin=`pwd`
cd $homedir
$homedir/popfile.pl >> $homedir/popfile_console.log 2>&1 &
cd $chemin
pid=`ps -ef | grep perl | grep popfile.pl | gawk '{print $2}'`
if [ "${pid}" = "" ] ; then
echo "Start of popfile : [ERROR]"
else
echo "Start of popfile : [OK]"
fi
;;
stop)
echo "Stopping popfile..."
pid=`ps -ef | grep perl | grep popfile.pl | gawk '{print $2}'`
if [ "$pid" = "" ] ; then
echo "Stop of popfile : [ERROR]"
echo "popfile was not launched!"
else
kill $pid
echo "Stop of popfile : [OK]"
fi
;;
restart)
$0 stop && $0 start || exit 1
;;
status)
pid=`ps -ef | grep perl | grep popfile.pl | gawk '{print $2}'`
if [ "${pid}" = "" ] ; then
echo "popfile service is not running..."
else
echo "popfile service is running..."
fi
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
exit 0
7) Configure service : it needs to be executable, the link will be created and service will start on each start
chmod 755 /etc/rc.d/init.d/popfile
ln -f -s /etc/rc.d/init.d/e-smith-service /etc/rc7.d/S98popfile
db configuration set popfile service status enabled
signal-event remoteaccess-update
service popfile start
Well that's done, connect to
http://yourserver:7676Create some categories... Change language, and please protect access by a password! I suggest to disable the option to modify the subject which will be enabled by default for all categories you will create.
On the client side a few stuffs needs to be configured:
- The POP3 server is : your_sme_server
- The username is : your_sme_server
:your_sme_login
- POP3 server port is 1100
Now you're retrieving mail via POPFile, don't forget to reclassify mails...
Please give me feedback!