Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Sieve scripting on OS X Server 10.4.3 using avelsieve

All,

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

Posted on Nov 4, 2005 7:09 AM

Reply
45 replies

Jan 12, 2006 12:03 PM in response to Ian Butler

This did work for me, almost.

Whenever I try to create or edit a rule, I get the following error:

<pre>Array ( [type] => address [address] => toorcc [matchtype] => contains [addressmatch] => collab.sakaiproject.org )
Warning: Cannot modify header information - headers already sent by (output started at /usr/share/squirrelmail/plugins/avelsieve/include/process userinput.inc.php:53) in /usr/share/squirrelmail/plugins/avelsieve/edit.php on line 191</pre>

This is using the latest version of avelsieve (1.9.4). Has anyone else seen anything similar? The rules do get created and the filtering works, but the error message is disconcerting.



iMac flat panel, 15 Mac OS X (10.4.3)

Jan 17, 2006 2:31 PM in response to Mark Daniel, m.d.

hey mark,
we have already prometed our server (10.4.3)to OD master. are you saying that i should still use the directions in the begging of the thread even though it says "server should be standalone"? anything special during installation? or should i just follow the exact directions? as far as i can understand you have successfully installed avelsieve on more than one OD master? have you done it on tiger?
thanks
martin

Feb 8, 2006 3:36 AM in response to Ian Butler

Ian,

I followed your instructions and had things working fine. But I have just found out that it has stopped working. I don't know if it was when I upreaded to 10.4.4 or not. When I click the filters link I get "Could not log on to timsieved daemon on your IMAP server localhost.
Please contact your administrator."

I have downloaded the lastest versions of Avelsieve, BDB, tinsieved and Cyrus-sasl and repeated your instructions but it still will not work. When I type in Terminal "telnet localhost 2000" I get "Trying ::1...
Connected to localhost.
Escape character is '^]'."
but that is all.
Can You or anyone help!!!!!

Mar 23, 2006 8:22 AM in response to Ian Butler

Sieve still crashes....

We are running an Xserve with 10.4.5
Added the sieve to service
and after telnetting to localhost 2000 it starts crashing. See the log below. Ran Mailfbr and permissions fixes.....help.....

Anyone on this topic a clue where to look? willem@appleisp.nl

Mar 23 17:01:32 xserve sieve[28101]: DBERROR db4: fatal region error detected; run recovery
Mar 23 17:01:32 xserve sieve[28101]: DBERROR: dbenv->open '/var/imap/db' failed: DB_RUNRECOVERY: Fatal error, run database recovery
Mar 23 17:01:33 xserve crashdump[28100]: crash report written to: /Library/Logs/CrashReporter/timsieved.crash.log
Mar 23 17:01:33 xserve crashdump[28102]: timsieved crashed
Mar 23 17:01:33 xserve crashdump[28102]: crash report written to: /Library/Logs/CrashReporter/timsieved.crash.log
Mar 23 17:01:44 xserve launchd: org.postfix.master: exited: Terminated
Mar 23 17:01:46 xserve master[28118]: process started
Mar 23 17:01:47 xserve ctl_cyrusdb[28119]: verifying cyrus databases
Mar 23 17:01:47 xserve ctl_cyrusdb[28119]: skiplist: recovered /var/imap/mailboxes.db (20 records, 3512 bytes) in 0 seconds
Mar 23 17:01:47 xserve ctl_cyrusdb[28119]: skiplist: recovered /var/imap/annotations.db (0 records, 144 bytes) in 0 seconds
Mar 23 17:01:47 xserve ctl_cyrusdb[28119]: done verifying cyrus databases
Mar 23 17:01:47 xserve master[28118]: ready for work
Mar 23 17:01:47 xserve ctl_cyrusdb[28120]: checkpointing cyrus databases
Mar 23 17:01:47 xserve ctl_cyrusdb[28120]: done checkpointing cyrus databases
Mar 23 17:07:31 xserve sudo: root : TTY=unknown ; PWD=/ ; USER=cyrusimap ; COMMAND=/usr/bin/cyrus/bin/cyrus-quota -r
Mar 23 17:07:38 xserve sudo: root : TTY=unknown ; PWD=/ ; USER=cyrusimap ; COMMAND=/usr/bin/cyrus/bin/ctl_cyrusdb -r
Mar 23 17:07:39 xserve ctl_cyrusdb[28175]: verifying cyrus databases
Mar 23 17:07:39 xserve ctl_cyrusdb[28175]: skiplist: recovered /var/imap/mailboxes.db (20 records, 3512 bytes) in 0 seconds
Mar 23 17:07:39 xserve ctl_cyrusdb[28175]: skiplist: recovered /var/imap/annotations.db (0 records, 144 bytes) in 0 seconds
Mar 23 17:07:39 xserve ctl_cyrusdb[28175]: done verifying cyrus databases
Mar 23 17:07:39 xserve sudo: root : TTY=unknown ; PWD=/ ; USER=cyrusimap ; COMMAND=/usr/bin/cyrus/bin/cyrus-quota -r
Mar 23 17:07:58 xserve sieve[28179]: DBERROR db4: fatal region error detected; run recovery
Mar 23 17:07:58 xserve sieve[28179]: DBERROR: dbenv->open '/var/imap/db' failed: DB_RUNRECOVERY: Fatal error, run database recovery
Mar 23 17:07:58 xserve master[28118]: process 28179 exited, signaled to death by 10
Mar 23 17:07:58 xserve master[28118]: service sieve pid 28179 in READY state: terminated abnormally
Mar 23 17:07:58 xserve crashdump[28180]: timsieved crashed

Mar 23 17:08:12 xserve sieve[28329]: DBERROR db4: fatal region error detected; run recovery
Mar 23 17:08:12 xserve sieve[28329]: DBERROR: dbenv->open '/var/imap/db' failed: DB_RUNRECOVERY: Fatal error, run database recovery
Mar 23 17:08:12 xserve crashdump[28328]: crash report written to: /Library/Logs/CrashReporter/timsieved.crash.log
Mar 23 17:08:12 xserve master[28118]: process 28329 exited, signaled to death by 10
Mar 23 17:08:12 xserve master[28118]: service sieve pid 28329 in READY state: terminated abnormally
Mar 23 17:08:12 xserve crashdump[28330]: timsieved crashed
Mar 23 17:08:12 xserve sieve[28331]: DBERROR db4: fatal region error detected; run recovery
Mar 23 17:08:12 xserve sieve[28331]: DBERROR: dbenv->open '/var/imap/db' failed: DB_RUNRECOVERY: Fatal error, run database recovery
Mar 23 17:08:12 xserve crashdump[28330]: crash report written to: /Library/Logs/CrashReporter/timsieved.crash.log
Mar 23 17:08:13 xserve crashdump[28332]: timsieved crashed
Mar 23 17:08:13 xserve crashdump[28332]: crash report written to: /Library/Logs/CrashReporter/timsieved.crash.log
Mar 23 17:08:20 xserve launchd: org.postfix.master: exited: Terminated
Mar 23 17:08:22 xserve master[28349]: process started
Mar 23 17:08:23 xserve ctl_cyrusdb[28350]: verifying cyrus databases
Mar 23 17:08:23 xserve ctl_cyrusdb[28350]: skiplist: recovered /var/imap/mailboxes.db (20 records, 3512 bytes) in 0 seconds
Mar 23 17:08:23 xserve ctl_cyrusdb[28350]: skiplist: recovered /var/imap/annotations.db (0 records, 144 bytes) in 0 seconds
Mar 23 17:08:23 xserve ctl_cyrusdb[28350]: done verifying cyrus databases
Mar 23 17:08:23 xserve master[28349]: ready for work
Mar 23 17:08:23 xserve ctl_cyrusdb[28351]: checkpointing cyrus databases
Mar 23 17:08:23 xserve ctl_cyrusdb[28351]: done checkpointing cyrus databases
Mar 23 17:09:42 xserve sudo: root : TTY=unknown ; PWD=/ ; USER=cyrusimap ; COMMAND=/usr/bin/cyrus/bin/cyrus-quota -r
Mar 23 17:10:58 xserve sudo: root : TTY=unknown ; PWD=/ ; USER=cyrusimap ; COMMAND=/usr/bin/cyrus/bin/cyrus-quota -r
Mar 23 17:12:13 xserve sudo: root : TTY=unknown ; PWD=/ ; USER=cyrusimap ; COMMAND=/usr/bin/cyrus/bin/cyrus-quota -r
Mar 23 17:13:30 xserve sudo: root : TTY=unknown ; PWD=/ ; USER=cyrusimap ; COMMAND=/usr/bin/cyrus/bin/cyrus-quota -r
Mar 23 17:14:46 xserve sudo: root : TTY=unknown ; PWD=/ ; USER=cyrusimap ; COMMAND=/usr/bin/cyrus/bin/cyrus-quota -r
Mar 23 17:16:03 xserve sudo: root : TTY=unknown ; PWD=/ ; USER=cyrusimap ; COMMAND=/usr/bin/cyrus/bin/cyrus-quota -r

********

Host Name: xserve
Date/Time: 2006-03-23 17:08:12.959 +0100
OS Version: 10.4.5 (Build 8H14)
Report Version: 4

Command: timsieved
Path: /usr/bin/cyrus/bin/timsieved
Parent: master [28118]

Version: ??? (???)

PID: 28331
Thread: 0

Exception: EXC BADACCESS (0x0001)
Codes: KERN PROTECTIONFAILURE (0x0002) at 0x0000000c

Thread 0 Crashed:
0 timsieved 0x00022018 prot_printf + 24 (prot.c:656)
1 timsieved 0x00004f64 fatal + 88 (timsieved.c:175)
2 timsieved 0x000173d0 mboxlist_init + 136 (mboxlist.c:2320)
3 timsieved 0x00004f88 service_init + 20 (timsieved.c:191)
4 timsieved 0x00002d3c main + 1096 (service.c:385)
5 timsieved 0x000021e0 _start + 392 (crt.c:267)
6 timsieved 0x00002054 start + 48

Thread 0 crashed with PPC Thread State 64:
srr0: 0x0000000000022018 srr1: 0x100000000000f030 vrsave: 0x0000000000000000
cr: 0x24000032 xer: 0x0000000020000000 lr: 0x0000000000022010 ctr: 0x000000009001ff14
r0: 0x0000000000004f64 r1: 0x00000000bffff0e0 r2: 0x000000000003b5b0 r3: 0x0000000000000000
r4: 0x0000000000031a74 r5: 0x0000000000034050 r6: 0x0000000000000000 r7: 0x0000000000000000
r8: 0x0000000000000000 r9: 0x000000000000004b r10: 0x0000000000000000 r11: 0x00000000a0006910
r12: 0x000000009001ff14 r13: 0x0000000000000000 r14: 0x0000000000000000 r15: 0x0000000000000000
r16: 0x00000000bffffeec r17: 0x000000000000003c r18: 0x00000000000000fa r19: 0x0000000000042900
r20: 0x0000000000000000 r21: 0x0000000000000000 r22: 0x00000000a0011ae8 r23: 0x0000000000042900
r24: 0x00000000003001b0 r25: 0x0000000000000001 r26: 0x00000000003001e0 r27: 0x0000000000000001
r28: 0x00000000bffffee4 r29: 0x000000000004d660 r30: 0x000000000003a310 r31: 0x0000000000022010

Binary Images Description:
0x1000 - 0x39fff timsieved /usr/bin/cyrus/bin/timsieved
0x205000 - 0x299fff libdb-4.1.dylib /usr/lib/libdb-4.1.dylib
0x8fe00000 - 0x8fe54fff dyld 44.2 /usr/lib/dyld
0x90000000 - 0x901b3fff libSystem.B.dylib /usr/lib/libSystem.B.dylib
0x9020b000 - 0x9020ffff libmathCommon.A.dylib /usr/lib/system/libmathCommon.A.dylib
0x919c4000 - 0x91a8cfff libcrypto.0.9.7.dylib /usr/lib/libcrypto.0.9.7.dylib
0x94cdc000 - 0x94cecfff libsasl2.2.dylib /usr/lib/libsasl2.2.dylib
0x94cf0000 - 0x94d1ffff libssl.0.9.7.dylib /usr/lib/libssl.0.9.7.dylib

Mar 24, 2006 3:23 PM in response to Ian Butler

I have a problem in that when I pico the services file, and add in the sieve line, the resulting file looks like this:

tcp-id-port 1999/tcp # cisco identification port
#
callbook 2000/udp # callbook
callbook 2000/tcp # callbook
# Devon Bowen
sieve 2000/tcp # Sieve mail filtering
wizard 2001/udp # curry

All I get when I run telnet localhost 2000 is:

Trying ::1...
Connected to localhost.
Escape character is '^]'.

It just hangs and does nothing else. Can anyone shed any light on this? On the assumption that helpful guide in this forum is the best way to work with 10.4.5 can anyone shed any light please?

Thanks

Justyn

May 5, 2006 2:59 PM in response to Ian Butler

As far as I can tell, you only have to enable 'Plain'; however, is there a way that this can be accomplished WITHOUT enabling the 'Plain' and/or 'Clear' options for mail?

I really don't like having those options turned on if I can help it. I know it's timesieved that has a problem with the auth is there a config file that will allow what I want?

Thanks,
David

Jun 7, 2006 8:13 PM in response to Ian Butler

I've used Mac OS X for quite some time and just started using Terminal in Mac OS X Server. I've been following your instructions and have a couple questions.

I'm not sure how to check the Directory permissions you mention at the end of Line 1 using the Terminal.

I was also wondering what command do I use to Add or Un-comment the /etc/service file you mention in Line 2.

What syntex do I use to Un-tar Sieve in the squirrelmail plugins directory in Line 9.

Your help would be greatly appreciated.

Sieve scripting on OS X Server 10.4.3 using avelsieve

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.