Well, it appears that the solution to my problem with Mail Daemon Replacement and spam filtering was easier than I thought – thanks to BiPolar for pointing out the answer (and not ridiculing my obtuseness). It turns out that I simply needed to escape the square brackets in [Spam] – which I would have known if I’d read the MDR “README” file. Whoops. Read on for the details, and to have a good laugh at my newbie-ish mistake.


To re-cap, most of my EMail accounts live on a server that does spam filtering by inserting “[Spam]” into the subject line of suspected junk mail. I had attempted to setup filters in MDR to mark those messages as read and then move them to a spam folder, but I couldn’t get them to work as desired.

Shortly after I posted my plea for help, reader BiPolar posted the solution in the comments area. In his words:

you only need to “escape” the square brackets… ie. use “\[Spam\]*”.
I, for one, use the Match Header with Match “Subject” against “*\[pedevel\]*” to put Pe related messages to ~/mail/Store/pedevel/

Embarrasingly enough for me, this is also outlined in the MDR README file:

Note that [ and ] are special characters. If you wish to include these in your test value, you need to put a \ before them, which causes the regex engine to interpret them as [ and ] characters instead of marking a set of values. For more info on this, read up on regular expressions.

I made that small change to my MDR filters and it now works perfectly: Hormel has been largely banished from my inbox. So the lesson is: documentation often includes useful information. And remember: if you can’t escape the square brackets, try to get them before they get you.

Category: ask   -   Comments RSS   -   Post a Comment   -   Trackback  

« »