Server-side Sieve Filters Not Active...?

Hi,

I'm currently looking to implement Snow Leopard Server for my organisation, I'm having problems with Server Side Filters. I can add and edit Sieve Rules fine from the web UI, and I can see them created in /Library/EmailRules/sievescripts/ as .sieve files.

Apple 10.6 Documentation indicates that the lines:

sieve 2000/udp # Sieve mail filtering
Sieve 2000/tcp # Sieve mail filtering

Should be added to /etc/services, which I have I done.

However when I send email matching these rules nothing appears to be filtered.

I decided to take a look in /etc/dovecot/dovecot.conf and I've noticed that in the "managesieve" section there are the lines

listen = *:2000
sieve = /var/spool/imap/dovecot/sieve-scripts/%u/dovecot.sieve

This appears to be different from the location where the Sieve scripts are actually generated. Is this why there is no Server-side filtering being performed...? Should I alter the Dovecot configuration or is there somewhere that configures Sieve...?

Thanks in advance for any tips and advice...

J

Mac OS X (10.6)

Posted on Sep 7, 2009 12:30 AM

Reply
24 replies

Sep 10, 2009 5:35 AM in response to Josh_B

I'd like to get this working too. Squirrel Mail has a nice plug-in to manage the rules that the users can make use of.

From the docs I read, and I hope it isn't true, Managesieve isn't installed and requires recompiling Dovecot if you want to use it.

If Apple hasn't included it, why even bother mentioning server-side filtering as I'd rather not recompile my own binary to have it nuked in an Apple update later on.

Thanks (again) for the 3/4ths implementation, guys.

Maybe the idea is to use the the directory for the scripts and managesieve isn't used, that would explain the differences in location for the scripts.

Sep 11, 2009 8:11 AM in response to CLWolf

In the end I found that I needed to make sure I had the following in /etc/postfix/main.cf

Then reload/restart postfix.

Then I symlink'd

/var/spool/imap/dovecot/sieve-scripts/user-id/dovecot.sieve to /Library/EmailRules/sievescripts/4F561B1E-86D0-4ED2-96E2-FB292347D8C4.sieve

And then in dovecot.conf, in the protocol lda section add the following:

log_path = /var/log/mailaccess.log
info logpath = /var/log/mailaccess.log
syslog_facility = mail

This will give better logging so you can see whether its working.

I need to work out where sieve picks up the directory location as it doesn't seem to read /etc/dovecot.conf for that. So far I haven't found it...!

I haven't tried updating to 10.6.1...

Sep 12, 2009 6:38 PM in response to Josh_B

Got mine working as well. As an aside, this plug-in for SquirrelMail (OS X's default webmail) is an incredibly easy to use solution for server-side filtering:

http://squirrelmail.org/plugin_view.php?id=73

I had it up and running in less than 15 minutes and works like a charm; and your users can simply log in to webmail and create their own server-side filters easily.

Sep 13, 2009 10:31 PM in response to Steven Major

I got mine working, here's a more play by play:

1. go to /etc/dovecot/
2. rename dovecot-example.conf to dovecot.conf
3. edit dovecot.conf and go to the protocol managesieve section and uncomment the login_executable line and the mail_executable line. I didn't change the values
4. I then made a mail rules file by using the built in UI (enable web config and mail server config) then use web UI to add some rules
5. ln -s /Library/EmailRules/sievescripts/ UID.sieve /var/spool/imap/dovecot/sievescripts/ UID/dovecot.sieve

NOTE: ** if anyone knows how to automate step 5, then this won't need to manually be done for each new user, or is this something managesieve should be doing automatically? **

Then restart Mail service. Also check mailaccess.log you may see permission denied. If so, give the .sieve file better permissions, including the enclosing folder, since it must write a .sieved file (compiled rules)

This should do it, no idea why some of this stuff wasn't done on install/configure, may have been my upgrade. Can anyone confirm this works better during a fresh install?

Sep 15, 2009 11:28 AM in response to Josh_B

I have tried it all. I was getting the permissions error, and I just opened the enclosing folder up (777). That no longer gives me the error, but I don't get the vacation blast. Do you know how to reset the daily setting so I can really test it? I have a feeling it thinks it already sent it so it will not do it again.

Sorry if this is wordy. Two young children who didn't sleep all night means Dad didn't sleep all night either.

🙂

(Oh, and I updated to 10.6.1 as well)

Sep 22, 2009 8:01 PM in response to CLWolf

Well, the working test server writes a directory named the %u in /var/spool/imap/dovecot/sieve-scripts.

My system will not write this directory.

In the test server, this directory is owned by the user.

Files are
.dovecot.lda_dupes (keeps tracks of who it sent vacation to)
dovecot.sieve (sym link to wiki serverrules.sieve
wiki serverrules.sieve
dovecot.sievec

I'm getting too tired to work anymore. Anyone have any idea on how to get this working on an upgrade install?

Sep 22, 2009 10:04 PM in response to CLWolf

Ok, I found wiki sievemanager is what watches the folder /Libary/EmailRules/sievescripts.

This should be in your LaunchDaemons and run at startup.

If you manually run wiki sievemanager it will indeed create the folders and files in var/spool/imap/dovecot/sievescripts.

On my test system it is lightning fast. On my production server it is slow to create them. Think I might have to offload some processing on another server.

Sep 23, 2009 1:20 AM in response to Shane Depner1

sorry, should have been more specific.

wiki sievemanager is in /usr/libexec

there is a plist in LaunchDaemons that runs that program.

I ran the program from the command line and it created the directories. Now it is running fine. I had to change the owner of /var/spool/imap/dovecot/sievescripts to _dovecot. I also added a cmusieve quota line in dovecot.conf but I don't have my notes with me right now (and not sure it mattered, but it was that way on my test machine).

I honestly kept changing a little here and there, but the folders were not created until I ran wiki sievemanager.

Hope it helps.

Message was edited by: sorry...really tired.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Server-side Sieve Filters Not Active...?

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