<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-CA link="#0563C1" vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal><span style='font-size:12.0pt'>Hello,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>My mail server has a global Sieve rule defined in sieve_before to file messages classified as spam by spamassassin into the Spam folder:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:12.0pt'>require ["regex", "fileinto", "imap4flags"];<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:12.0pt'>if allof (header :regex "X-Spam-Status" "^Yes") {<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:12.0pt'> fileinto "Spam";<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:12.0pt'>}<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>This works great, except I’d like the ability to whitelist certain senders or domains whose emails end up in Spam, usually due to a misconfigured SPF DNS TXT record or something like that. I use Roundcube as my Webmail client, so the easiest way to whitelist would be to create a rule for each domain directly in Roundcube using its built-in Sieve integration to move legitimate messages out of the Spam folder. I already have several rules set up to flag and sort non-spam messages, and they’re working fine. I therefore tried adding a simple rule to move Spam into the Inbox:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:12.0pt'># rule:[Not Spam]<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:12.0pt'>if allof (header :contains "from" "user@good-domain.com")<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:12.0pt'>{<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:12.0pt'> fileinto "INBOX";<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:12.0pt'>}<o:p></o:p></span></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>However, the above rule does not work as I expected. When I receive an email from good-domain.com that’s classified as Spam by spamassassin, the global rule sends it to the Spam folder and it is not re-filed into the Inbox. The second rule doesn’t seem to do anything. I’m probably doing something simple wrong, but I can’t figure out what (I’m a Sieve newb). Any suggestions please?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Thanks,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Nick<o:p></o:p></span></p></div></body></html>