OK, in this thread:
There were some questions about Whitelist/Blacklist filtering.
Here are some simple examples using filtering.
Suppose this is your .qmail-default file in your /big/dom/xdomain directory:
|condredirect firstname.lastname@example.org /usr/bin/env python /big/dom/xdomain/sircamscan.py
|condredirect email@example.com /usr/bin/env python /big/dom/xdomain/addresscheck.py to ./goodtolist.txt
|condredirect firstname.lastname@example.org /usr/bin/env python /big/dom/xdomain/addresscheck.py cc ./goodtolist.txt
|condredirect email@example.com /usr/bin/env python /big/dom/xdomain/addresscheck.py from ./goodfromlist.txt
|condredirect firstname.lastname@example.org /usr/bin/env python /big/dom/xdomain/domaincheck.py from ./gooddomains.txt
is a private e-mail address that I share with NO ONE, not friends, family, NO ONE. I filter my mail and the filter decides wether to forward to that addy or not.
Here is what it does: the first line checks whether a copy of the SirCam virus has been sent. (I only got two copies today? It's going away, I think.) If the mail passes that test, it is redirected to a "black-hole" address. (See this post http://www.aota.net/forums/showthrea...0563#post50563
for more details.)
The next three lines check for addresses in a white list. They all run this script:
Corrected Code posted in next Post
ADMIN EDIT: Removing Proof That Sheila is Human by Sheila's Request
I call this script "addresscheck.py". This script takes two parameters:
A mail header field (To, CC or From) and the name of a whitelist file.
In the file goodtolist.txt I have a list of e-mail addresses, that if anyone sends an e-mail TO or CC to that address, I want to get that e-mail. So, lines 2 and 3 of the .qmail file are checking the To field and the CC field to see if those addresses are in my whitelist of "To" addresses.
The fourth line of my .qmail file is checking another file, called "goodfromlist.txt", which is a list of e-mail addresses, that if I receive anything FROM that e-mail address, then I want to get that e-mail.
The fifth line is checking a file called gooddomains.txt, which is a list of domains that I WANT to receive mail from. (I haven't posted the domaincheck.py script here, but if someone wants it, just send me a message.)
The sixth line forwards any mail that has not passed previous filters to a spamcop address.
You could reverse the principles here, and have blacklists of e-mail addys or domains, instead of whitelists, and use the same addresscheck.py script, only I'd assume you'd redirect them e-mail to a different address (like spamcop or a black hole? Or use the "bouncesaying" command to bounce the messages back?)
I don't know how "server friendly" it is to have up to five scripts execute per email received to the default mailbox for a domain. This is just an example, and one should probably be conservative with this type of thing.
Anyway, I hope these examples are useful to some of the people who asked about the Blacklist/Whitelist type of stuff.