Mandler
04-07-2010, 04:10 PM
For the past few years, primarily based on info that Sheila has provided in her postings, I have been using conditional redirects to send SPAM to a secondary email account (e.g., junk@mydomainname.com).
I have three tests. The first two check text files for bad "from's" and "subjects" that I have collected over the years.
condredirect junk@mydomainname.com sh -c '822field from | grep -qiFf "/big/dom/xmydomainname/email_filters/alan/bad_from.txt"'
condredirect junk@mydomainname.com sh -c '822field from | grep -qiFf "/big/dom/xmydomainname/email_filters/alan/bad_subject.txt"'
The third runs a little python script that looks for various phrases inside of the message.
condredirect junk@mydomainname.com /usr/bin/env python /big/dom/xmydomainname/email_filters/alan/filter.py
These have worked really well for me. A piece of junk mail gets through maybe once every other week, if that often.
Here's my question:
Rather than redirecting mail to a Junk account, is there a way to programmatically mark the message as "SPAM" and move it to a Junk folder within the same account?
I'm asking because I'd like to give other users on my domain the same benefit as I'm receiving without setting up secondary email accounts for everyone.
I have three tests. The first two check text files for bad "from's" and "subjects" that I have collected over the years.
condredirect junk@mydomainname.com sh -c '822field from | grep -qiFf "/big/dom/xmydomainname/email_filters/alan/bad_from.txt"'
condredirect junk@mydomainname.com sh -c '822field from | grep -qiFf "/big/dom/xmydomainname/email_filters/alan/bad_subject.txt"'
The third runs a little python script that looks for various phrases inside of the message.
condredirect junk@mydomainname.com /usr/bin/env python /big/dom/xmydomainname/email_filters/alan/filter.py
These have worked really well for me. A piece of junk mail gets through maybe once every other week, if that often.
Here's my question:
Rather than redirecting mail to a Junk account, is there a way to programmatically mark the message as "SPAM" and move it to a Junk folder within the same account?
I'm asking because I'd like to give other users on my domain the same benefit as I'm receiving without setting up secondary email accounts for everyone.