This is an old revision of the document!
POPFile v1.1.0 comes with the first official Mac OS X installer! You can now install POPFile on your Mac easily. POPFile v1.1.3 is compatible with Mac OS X 10.7 (Lion).
You'll need several things to get started with POPFile on Mac OS X.
/Library/POPFile/
and it will be automatically launched in background. The installer package includes several utility scripts written in AppleScript. You can copy them to your hard drive.
This procedure shows you how to install POPfile on Mac OS X 10.4.x systems, and how to create a startup item that will start POPfile each time you reboot the system.
As of Mac OS X 10.4, Mac OS X comes with Perl and SQLite3 installed. So you'll simply need to install Xcode, a few Perl library packages, and a startup item.
At the time of this writing (January 2007), POPfile does not fully support SQLite3. On Mac OS X 10.4.x systems, POPfile requires the SQLite2 Perl package, DBD::SQLite2. So to run POPfile in Mac OS X 10.4.x, you'll need to install:
Note: Because setting up CPAN, a Perl package manager, or Fink, another package manager, on a virgin system can complicate matters, we'll stick with the source and do it the old-school way to avoid complications.
Note: To edit scripts or configuration files, use a plain text editor (like the command-line editor,vi, or the GUI editor TextWrangler). Make sure the text file content is plain text.
TIP: On the command line, ~ means “your home directory”. So ~/Desktop/packages
means /Users/yourusername/Desktop/packages
.
Note: An alternative set of instructions is available here by Michael Artz.
NOTE: You should be logged into an administrator account for this procedure.
cd ~/Desktop/packages
tar xzvf name.tar.gz
cd name
perl MakeFile.PL
make
Note: If you compile any of these packages and it outputs an error starting out with something like: Can't locate DBD/SQLite2.pm in @INC, that means that package depends on other Perl library packages. The dependency package name is right after the word “locate” (in this example, it is DBD::SQLite2).
sudo make install
mkdir ~/Library/POPfile
Note: While this folder can reside anywhere, we suggest you create it somewhere in your home directory so that if you back up your home directory, POPfile gets backed up as well. We assume you have used the location ~/Library/POPfile for the rest of this procedure.
cd ~/Library/POPfile
sudo perl popfile.pl
Couldn't start the pop3 proxy because POPFile could not bind to the listen port 110. This could be because there is another service using that port or because you do not have the right privileges on your system (On Unix systems this can happen if you are not root and the port you specified is less than 1024).
you may need to run POPFile as root (use sudo) or change the POP3 and the UI port greater than 1024. To change the port settings, use following command (this command will change the POP3 port to 1110 and the UI port to 9090):
perl popfile.pl --set pop3_port=1110 --set html_port=9090
For more information about the command-line options, see POPFile Command Line and Advanced Options
At this point POPfile is installed properly, but will not start up automatically every time you reboot.
NOTE: You should be logged into an administrator account for this procedure.
sudo mkdir -p /Library/StartupItems/POPfile
{ Description = "POPfile mail classification proxy"; Provides = ("popfile"); Requires = ("Network"); Uses = ("Disks", "Network Time", "IPServices"); OrderPreference = "Last"; Messages = { start = "Starting POPfile"; stop = "Stopping POPfile"; }; }
#!/bin/sh # # POPfile - startup script # # For this to work POPfile should be in /Library/POPfile # . /etc/rc.common PFPATH='/Users/yourusername/Library/POPfile' if [ "$1" == "start" ] then pid=$( ps -axww | grep popfile.pl | grep -v grep | awk '{ print $1 }' ) if ! [ $pid ]; then ConsoleMessage "Starting POPfile mail classification proxy" cd "$PFPATH" perl popfile.pl > /dev/null 2>&1 & fi elif [ "$1" == "stop" ] then pid=$( ps -axww | grep popfile.pl | grep -v grep | awk '{ print $1 }' ) if [ $pid ]; then ConsoleMessage "Stopping POPfile mail classification proxy" kill -6 $pid fi elif [ "$1" == "restart" ] then pid=$( ps -axww | grep popfile.pl | grep -v grep | awk '{ print $1 }' ) ConsoleMessage "Restarting POPfile mail classification proxy" kill -6 $pid cd "$PFPATH" perl popfile.pl > /dev/null 2>&1 & fi
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist SYSTEM " file://localhost/System/Library/DTDs/PropertyList.dtd" ; ;> <plist version="0.9"> <dict> <key>Starting POPfile</key> <string>Starting POPfile </string> <key>Stopping POPfile </key> <string>Stopping POPfile </string> </dict> </plist>
/Library/ StartupItems/ POPfile/ POPfile StartupParameters.plist Resources/ English.lproj/ Localizable.strings
cd /Library/StartupItems sudo chown -R root.admin popfile cd popfile sudo chmod 754 popfile sudo chmod 644 StartupParameters.plist
sudo /Library/StartupItems/POPfile/POPfile start
TODO: Add details about the relationship between POPfile, DBD::SQlite2, and the SQLite3 command-line tool included with Mac OS X 10.4.x.
TODO: Add instructions to edit the popfile.cfg file and change the bayes_dbconnect property to dbi:SQLite2:dbname=$dbname to speed up POPfile launch times.
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.