Zentyal Forum, Linux Small Business Server
Zentyal Server => Email and Groupware => Topic started by: jac2703 on November 18, 2015, 06:09:32 pm
-
Hi all,
I have a new installation of Zentyal community installed with the mail and mail filtering modules installed.
Incoming mail is being checked, and some of it tagged as SPAM, both in the header and in the subject if I set the option. In webmail, however, it's not being put in the Spam/ Junk folder and just resides in the Inbox.
Is this intended behaviour? Is there a way to get this moved for each user?
-
Yes, mailfilter will only tag spam mails, not move then to wherever. You should set a global sieve filter if you want this to be done automatically
-
Thanks for the reply, jbahillo.
At least now I understand the expected behaviour.
Where would I set a global sieve filter? Is there a GUI, or do I need to create a rules file somewhere?
-
No, ther's no GUI. You will need to read Dovecot + Sieve documentation in order to learn how to do this
-
Thanks.
I've written a quick blog post showing how to do this for anyone else who has this issue.
http://www.jamescoyle.net/how-to/1963-configure-zentyal-4-2-to-move-spam-email-to-junk-folder (http://www.jamescoyle.net/how-to/1963-configure-zentyal-4-2-to-move-spam-email-to-junk-folder)
-
Hello. Just a small note regarding your article (thx for contributing, by the way)
If you do that way, changes done to dovecot config will be lost once you restart zentyal-mail module. You will need to create a custom stub for that. Custom stubs are documented on doc.zentyal.org
-
Thanks for the pointer - good to know!
It looks like the sieve config is already defined then, in dovecot.conf.mas.
Once I restarted the zentyal mail service the config was indeed over-written with the templates code as you suggest. The template adds a pointer to /var/vmail/default.sieve which I've created as a below.
require ["fileinto"];
# rule:[SPAM]
if header :contains "X-Spam-Flag" "YES" {
fileinto "Spam";
}
However, it doesn't seem to work. Sending a SPAM message doesn't get placed into the junk folder. Any thoughts?
-
Rule looks ok, just make sure that the path to the folder is correct - perhaps better using the full path, using the right separator. Perhaps worthy doing a similar rule on webmail itself and loking on sogo.sieve the result