Why Don't Roundcube Mail Filters Work?

Another post about MIAB’s unreliable spam filtering, I’m afraid.

Having given up on hoping that marking email as Spam in my email client would somehow persuade MIAB to stop delivering junk from those senders, I’ve resorted to actually creating mail filter rules on the MIAB server itself. Which is a bit of a pain, given I have to maintain an ever growing list of “match any of the following…” rules in my filter. Even then it seems to do not much at all. I continue to receive emails from those addresses: Here’s a single example, but this happens with countless senders I’ve added to the filter.

My mail filter…

Screenshot 2024-12-03 at 16.20.28
Screenshot 2024-12-03 at 16.21.43

and my email client inbox…


Screenshot 2024-12-03 at 16.22.37

Is the Roundcube email filtering just completely broken, or am I mis-defining my filters here? It would help if there was at least some rudimentary documentation giving syntax requirements for the filters. For example, am I OK to use “from …contains … spammer.com or should it be “from …contains … @spammer.com, or “from …contains … *@spammer.com or “from …contains … full-email-address@spammer.com ?

The email filtering does work, but I found that I had to do quite a bit of experimentation with it before I got the desired results. You may need play around with “contains”, “matches expression” and “matches regular expression”. I would suggest setting a filter for a “from” address you control and sending email to your account to play with the filter.

Also, be careful about using the action “Discard with message” because you can get into an auto-responder war.

Here’s a screenshot of one of my regex filters that is working:

Thanks. I’m glad someone’s found some way of getting it to work.

It seems crazy that we should have to resort to regex though—especially in circumstances like mine, where I just want a simple block on a spamming domain.

EDIT: one thing I’ve just noticed is that the spam which is bypassing the filters is mostly addressed to an alias of my primary email. So I wonder if that’s contributing to the problem. Is the spam filter implicitly assuming a “To…” field with my primary email address and allowing anything through which is sent to an alias of that address?

This is based on only a couple of emails which arrived since my original post. I’ll continue to monitor what comes in and see if it’s only spam addressed to the alias email address that is bypassing the filter.

It’s been a while, but as I recall I had better success using regex. Not sure why, but at that time I recall spam getting by “contains” filters that should have caught it. Nonetheless I have all three types of filters, contains, matches expression and matches regex, but I can’t say for sure they all work. Your comment about aliases is interesting. I haven’t dealt with that situation, but maybe it is somehow affecting your filters.

Would you be willing to DM me the headers of this email, assuming that you haven’t deleted it yet? @stuzbot

I strongly suspect that the email used a different envelope sender which is why the filter did not work.

AFAIK Sieve filtering From: uses the envelope sender, not the display sender. I could be wrong on that but I think that I am not.

DM sent.

[…and some gratuitous extra characters. Can I post now?]