The "Sheila Effect" has struck again.
After reading the threads about e-mail filters and Python, I decided to take a hack at it myself. Mind you, I'm a Python newbie, a few days ago I hadn't tried anything more complex than "Hello World." But after playing around with some of Sheila's scripts, I was able to put together a rudimentary Python filter. Since I'm more comfortable writing in PHP, I next created a web browser interface to set-up the Python filter, thus making it easy for someone with no programming experience to begin using e-mail filters.
The program, dubbed "E-mail Filter Manager," can so some basic things at this stage...
Allowed E-mail List (aka a "white list"). Any e-mail address entered in this list will pass through the remaining filters, no questions asked.
Banned E-mail Addresses. Standard feature.
Banned Domains. Unless the address appears on the Allowed list, anything from a banned domain gets filtered.
Banned File Extensions. Based on Sheila's code, checks for banned file extensions in attachments and multi-parts.
Banned Words. Searches message body for banned words and phrases... does not bite on word fragments (ie. "sextant" is not a hit for "sex"... but "SeX!!!" would be filtered).
Banned Subjects. Same as banned words, only for subject lines.
A banned (ie. filtered) e-mail can be handled three ways: normal bounce, blackhole or bounce with message, the latter requiring a slightly different CNC set-up (all explained in the online help).
Throw in a few custom set-up options and that's where the proggie stands now. It doesn't do any logging or checks of external black lists, I'm a bit concerned that those kinds of features could be too resource intensive for accounts which receive a lot of mail. I also haven't done any advanced spam detection using the headers, but that sounds like an interesting next step.
I've tried to keep the Python script created by the PHP program as streamlined as possible, all the filter data is written into the script as arrays and a new script is produced each time the PHP program is used for an update. The Python script has had most comments removed, but a commented version is available to anyone who would like to check/improve my newbie code.
I think I have the basics pretty well covered at this point. One of my main design goals was KISS, so I left out the kitchen sink and opted for user friendliness. No doubt someone could take-up where I left off and create an advanced version deserving of a Ph.D thesis, but after three days of hacking (and writing docs... I hate writing docs!), I'm ready for a little RnR. Of course if some bugs are found I'll get back to work, I'm really hoping some people may find this program useful.
As mentioned in the subject, the program is in beta and I'd like to see it get a good shakedown before goin' public (meaning I don't want to be responsible for someone losing all their important e-mail). So... *turns on grovel mode* please check my work and let me know what you think. I'm open to suggestions but my limited experience with Python makes even the simple stuff a challenge (though now that I found IDLE I may play around some more on the PC and give FQ's servers a rest).
So, for anyone interested, the download page can be found here:
http://diamond-back.com/software/efm/
Side note: Today marks the end of exactly three years of hosting with FutureQuest, and in that time I have learned sooooooo much from reading these forums... from TeRRa, Justin, Sheila... well, it's a long list. So I'd like to thank all of you and offer this program as my contribution to the Stone Soup that makes this place so tasty.
