I am running ClearOs 7 Community. I have set up IMAP, SMTP and AntiSpam, so I can receive emails from outside, and read them with IMAP.
I am getting emails which are clearly spam (they have [SPAM] in the subject), but they are arriving in the INBOX. I want them to do the same as they used to do in my old server, and be moved into the SPAM folder.
There doesn't seem to be any configuration in the UI to do this. How do I do it "by hand"?
I am getting emails which are clearly spam (they have [SPAM] in the subject), but they are arriving in the INBOX. I want them to do the same as they used to do in my old server, and be moved into the SPAM folder.
There doesn't seem to be any configuration in the UI to do this. How do I do it "by hand"?
Share this post:
Responses (3)
-
Accepted Answer
-
Accepted Answer
I have solved this!
Cyrus has a built-in filtering system which can redirect mail to folders according to rules you supply. I found on my old server I had set up some rules, but had forgotten all about it.
The rule I needed (for user nikki) was:
# cat spamrule
require
["fileinto","envelope","reject","vacation","imapflags","relational","comparator-i;ascii-numeric","regex","notify"];
if header :contains "x-spam-flag" "YES" {
fileinto "user/nikki/SPAM";
stop;
}
And, when logged in as user nikki, I can add this rule to the system using sieveshell as follows (nb: the sieveshell prompt is >:
sieveshell -u nikki localhost:2000
Please enter your password:
> put spamrule
> activate spamrule
> list
spamrule <- active script
> quit
Of course, this presupposes you can open a shell for each user (I logged in as root and used
), and that you know each user's password (which I do).su -s /bin/bash - nikki
-
Accepted Answer
I am not aware of ClearOS 6.x being able to move spam mail automatically, but it may just be a faulty memory. There are two ways of doing it that I know. It can be done in your e-mail client. In Thunderbird, for example, you can set up message rules which trigger on the subject line or there is also a specific Junk Mail setting which allows you to "Trust junk mail headers set buy:" and pick Spamassassin. The other way is to use sieve rules. The paid-for version of Roundcume allows you to do this. If you set the rule in Roundcube, Roundcube does not have to be running for the rule to function. Both methods have the disadvantage that it is a per user function and not global. I do not know how to set this globally. I looked years ago before I even had Roundcube but got nowhere. In those days I think I was under ClearOS 5.x and Horde.
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.
Register Here »