Author Topic: Managesieve plugin and spam filter  (Read 7893 times)

Offline tonyvier

  • Jr. Member
  • **
  • Posts: 31
Managesieve plugin and spam filter
« on: March 19, 2015, 03:11:41 AM »
Hi,

I had a spam filter on my server, and spam was put in the Junk folder automatically.

I played a bit with the managesieve Roundcube plugin and it works good, sadly I have not found a (Android) mail client that pushes notifications for more than just the Inbox alone yet....

But, since I have used the managesieve plugin, the spam messages get delivered to the Inbox again...

I have in /var/lib/dovecot/sieve/default.sieve :

require "fileinto";
if header :contains "X-Spam-Flag" "YES" {
  fileinto "Junk";
}

With the right permissions....

Thanks!

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
Re: Managesieve plugin and spam filter
« Reply #1 on: March 19, 2015, 04:07:42 AM »
In the configuration of Dovecot sieve did you set the location of `/var/lib/dovecot/sieve/default.sieve` using `sieve_default` (or `sieve_global_path`)?

From the Dovecot manual:
Quote
sieve_default = (v0.3+) - The location of the default personal sieve script file which gets executed ONLY if user's private Sieve script does no exist, e.g. /var/lib/dovecot/default.sieve.

If you are using `sieve_default` but you want to keep the default file executed as well as the personal sieve script then you might try `sieve_before` or `sieve_after` instead.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline tonyvier

  • Jr. Member
  • **
  • Posts: 31
Re: Managesieve plugin and spam filter
« Reply #2 on: March 19, 2015, 04:20:23 AM »
Ok, thanks I have a Global, and added before:

  # The default Sieve script when the user has none. This is a path to a global
  # sieve script file, which gets executed ONLY if user's private Sieve script
  # doesn't exist. Be sure to pre-compile this script manually using the sievec
  # command line tool.
  # --> See sieve_before fore executing scripts before the user's personal
  #     script.
  #sieve_default = /var/lib/dovecot/sieve/default.sieve
 
  sieve_before = /var/lib/dovecot/sieve/default.sieve
  sieve_global_path = /var/lib/dovecot/sieve/default.sieve

Will test now....

Offline tonyvier

  • Jr. Member
  • **
  • Posts: 31
Re: Managesieve plugin and spam filter
« Reply #3 on: March 19, 2015, 04:25:40 AM »
And works!

Thanks...

BTW is there a way to hide the dovecot.sieve folder from the IMAP client?

(and do you know of any android email client that can give PUSH notices on more than the Inbox only?)

Edit: K-9 :)

« Last Edit: March 19, 2015, 05:29:46 AM by tonyvier »

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
Re: Managesieve plugin and spam filter
« Reply #4 on: March 19, 2015, 09:22:58 AM »
I've never known the dovecot.sieve folder to show up in IMAP I think it must be something about your dovecot/sieve config but I'm not sure what, sorry.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline tonyvier

  • Jr. Member
  • **
  • Posts: 31
Re: Managesieve plugin and spam filter
« Reply #5 on: March 19, 2015, 09:49:50 AM »
Yes it shows up,

The dovecot.sieve directory has become part of the IMAP folder structure. see pic how it shows in Roundcube (or other clients), structure is the same as IMAP folder.

Its a standard postfix dovecot installation, with virtual domains / mailboxes.....



Offline tonyvier

  • Jr. Member
  • **
  • Posts: 31
Re: Managesieve plugin and spam filter
« Reply #6 on: March 19, 2015, 10:03:41 AM »
Oh,  what would be a normal location of this folder?

Offline tonyvier

  • Jr. Member
  • **
  • Posts: 31
Re: Managesieve plugin and spam filter
« Reply #7 on: March 20, 2015, 12:41:05 AM »
Oh, its not a folder  :-[

Its a symbolic link to the managesieve.sieve file in the (virtual) users sieve directory....

It is created when the managesieve Roundcube plugin is first used...




Offline tonyvier

  • Jr. Member
  • **
  • Posts: 31
Re: Managesieve plugin and spam filter
« Reply #8 on: March 25, 2015, 02:15:23 AM »
Ok, found the solution here:

http://forum.froxlor.org/index.php/topic/12821-roundcube-and-managesieve-issues/page-3

In short:

in 90-sieve.conf there is : sieve = ~/.dovecot.sieve

Change it to sieve = ~/sieve/.dovecot.sieve

Move the .dovecot.sieve and .dovecot.svbin to this sieve directory of the user.

Files with a "." show up as a imap folder..

It says here:

http://wiki2.dovecot.org/Pigeonhole/ManageSieve/Configuration

"Note: It is not wise to place this link inside your mail store, as it may be mistaken for a mail folder. Inside a maildir for instance, the default .dovecot.sieve would show up as phantom folder /dovecot/sieve in your IMAP tree."