My email setup based on Dovecot and rspamd. I configured managesieve service in Dovecot and Sieve integration in Mail app.
Is this possible to run user Sieve filter when it marks some message as spam/not spam?
How to catch this event?
Sieve script for all users account will be the same. Is there way to autoprovision it to the all users email accounts? Existing and new ones.
As it is in all popular public email services. When user mark message as spam, I want to trigger Sieve filter which moves message to Spam folder and with rspamc sends spam signature to rspamd server.
Can it be done by this way with Mail app Sieve integration?
When user mark message as Spam in Mail app, on message icon appears exclamation mark and word āJunkā. But mail headers does not change.
How to catch flags or event in SIeve script when user mark message as spam?
Could you please provide a simple example of such Sieve filter?
What should be in IF condition in the Sieve script to handle a message marked as spam?
# Move spam to spam folder
if anyof (header :contains "X-Spam-Flag" "YES", header :contains ["X-Spam", "X-Spam-Status"] "Yes") {
fileinto :create "Junk";
# Stop here so that we do not reply on spams
stop;
}
To developers: This was interesting to investigate how it works. But, please, add a few words how Sieve integration works to Mail app admin documentation.
Did anyone else get this working? Weāre trying to implement it on our servers, but the message never gets moved.
We have enabled imapsieve following iRedMail docs at Auto learn spam/ham with Dovecot imap_sieve plugin (iredmail.org)
It is working, if users move their messages manually to junk folder the reporting script is executed.
But we havenāt been able to make the user-defined script work. Although the message flags are changed (verified using doveadm fetch) the message is never moved. It looks like the āimap.changedflagsā environment variable is always empty.
Sieve needs a complete UI to make and delete rules with, in fact. No professional email program worth so much as a warm cup of spit fails to have filter rule capabilities.
I made my own manually but the average mail user would be completely unable to navigate this kind of interface, and this feature alone makes using this mail app mostly a non-starter in a corporate setting.
A sieve UI is something we want to have. The vacation autoresponder did the base work for a Sieve UI. The work can be picked up by an engineer any time.