Sieve scripting on OS X Server 10.4.3 using avelsieve
As noted elsewhere on the forums (and AFP548), the latest Tiger updater has fixed the problems many were having with Sieve scripts, particularly using the SquirrelMail plug-in avelsieve. Below is guide to getting this working if you're starting from scratch, something I see a number of people are asking for...
Prerequisites
===============
I have used the following setup on a fresh install of Mac OS X 10.4 Server, with the 10.4.3 Combo Update installed. I then added a user to the local netinfo domain as a test case, and along with the default admin account have enabled mail for these users - Note: Open Directory is not currently running.
Web, DNS, SMTP and IMAP/POP are all running, and SquirrelMail has been enabled in Web Services. SquirrelMail has been tested for the two users mentioned above, and both accounts log in correctly, displaying empty mail boxes.
To enable sieve scripts via Squirrelmail
========================================
1) If it doesn't already exist, create the following directory as root or using sudo from the Terminal;
% sudo mkdir -p /usr/sieve
% sudo chown cyrusimap /usr/sieve
% sudo chgrp wheel /usr/sieve
Directory permissions should then look like;
drwxr-xr-x 3 cyrusimap wheel 102 Nov 3 21:31 sieve
2) Add (or un-comment if it exists) the following line to the /etc/services file. To do this you either need to su to root (or use sudo) to edit the file using the Terminal.
sieve 2000/tcp # Sieve mail filtering
3) Stop the mail services from Server Admin.
4) On the Mail -> Settings -> Advanced tab, ensure you have IMAP set to allow 'PLAIN' as well as 'Clear' Authentication.
5) Start the mail services from Server Admin.
6) Run the following command using the Terminal, as any user;
% telnet localhost 2000
You should see the following output;
Trying ::1...
Connected to localhost.
Escape character is '^]'.
"IMPLEMENTATION" "Cyrus timsieved v2.2.12-OS X 10.4.0"
"SASL" "PLAIN"
"SIEVE" "fileinto reject envelope vacation imapflags notify subaddress relational comparator-i;ascii-numeric regex"
"STARTTLS"
OK
7)If you see this, your timsieved is working correctly. Use the escape character to leave the daemon, and quit telnet.
8) Download the most recent avelsieve distribution from the web page at http://email.uoa.gr/projects/squirrelmail/avelsieve_download.php. I used the more recent Dev Branch version: avelsieve-1.9.3.tar.gz, and haven't tested the earlier 1.0.1 version. If anyone has this working also, let me know.
9) Un-tar this in the squirrelmail plugins directory ( /usr/share/squirrelmail/plugins ), again as root or using sudo via the Terminal and cd into ( avelsieve/config/ ). Copy the example config 'config_sample.php' to 'config.php' IN THE SAME DIRECTORY (this is different from the V1.0.1 setup I believe). I didn't need to edit anything in the config.
10) Run the SquirrelMail config perl script, using sudo like so;
% sudo /etc/squirrelmail/config/conf.pl
Choose Option 8, "Plugins" from the menu, and enable "avelsieve" by selecting it from the resultant list. Save your changes and quit the utility.
11) Login in to one of the mail accounts using SquirrelMail, and the "Filters" menu should now be an option - choosing this allows you to create your sieve scripts, including a vacation mail 'auto-reply'.
12) Looking in the /usr/sieve/a/admin directory (for example) should show the following files;
lrwx------ 1 cyrusima wheel 12 Nov 4 11:41 defaultbc -> phpscript.bc
-rw------- 1 cyrusima wheel 232 Nov 4 11:42 phpscript.bc
-rw------- 1 cyrusima wheel 1056 Nov 4 11:42 phpscript.script
Please let me know comments and/or corrections, especially if you have achieved this differently.
Regards,
Ian Butler