Discussion:
Server-side mail filtering (postfix+cyrus-imap)
(too old to reply)
nunatarsuaq
2009-11-10 10:42:08 UTC
Permalink
Anybody knows how to set up server-side filtering using Sieve?
My server is running openSuse with postfix and cyrus-imap. I guess
both of them have to be somehow configured to use Sieve as a filter.
I need to move all messages marked as spam (by SpamAssasin) to user's
"Junk" folder.
--
ToMasz
Eero Volotinen
2009-11-10 13:35:27 UTC
Permalink
Post by nunatarsuaq
Anybody knows how to set up server-side filtering using Sieve?
My server is running openSuse with postfix and cyrus-imap. I guess
both of them have to be somehow configured to use Sieve as a filter.
I need to move all messages marked as spam (by SpamAssasin) to user's
"Junk" folder.
How about:
http://www.delouw.ch/linux/Postfix-Cyrus-Web-cyradm-HOWTO/html/cyrus-config.html

It was the first hit on google search .. and there are lot of
documentation on web.

I am using dovecot with sieve and postfix, it is much less complex to
configure..

--
Eero
Julien Vehent
2009-11-12 16:09:31 UTC
Permalink
Please Copy the list in your replies :)
This is a good tutorial but when a newly created filter file should be
written?
When I invoke
# sieveshell -u cyrus -a cyrus localhost
First, you should log in with your personal account and NOT the cyrus
user.
Sieve filters are attached to your IMAP account, each user has its own.
and type
put sieve_filter
if header :contains "X-Spam-Flag" "YES" {
fileinto "Junk";
stop;
}
line 2: fileinto not required
The syntax of the "Junk" folder is probably not good. If you use default
configuration of cyrus-imap, I suppose it should be more something like
"user.<yourusername>.Junk".

For me, it is "user.julien.Spam" and the complete filter is thus:
---
if header :contains "X-Spam-Flag" "YES" {
fileinto "user.julien.Spam";
stop;
}
---


Julien
Julien Vehent
2009-11-13 15:45:49 UTC
Permalink
Can you send the result of "grep sieve /etc/imapd.conf", I wonder if your
sieve configuration in /etc/imapd.conf is correct...
maybe the path of sievedir leads to a directory that's not writable...
Same thing.
I logged in with a personal account put a filter (tried
"user.testowy.Junk", "user/testowy.Junk" and "user/testowy/Junk") with
the same error
line 2: fileinto not required
Folder /var/spool/imap/t/user/testowy/Junk exists.
Loading...