This small tool implements a whitelist on a Postfix mail-server. It prevents certain recipient addresses (your kids ones) from receiving mail from any not whitelisted address. Any mail from not whitelisted senders is redirected to a delegate (a parent).
Code is here http://files.a385e-5.de/files/ChildProt-0.9.tar.gz
Configure it by adding this line into the master.cf of the Postfix installation:
childprot unix - n n - 25 spawn user=mail argv=/opt/sbin/ChildProt
and this to the main.cf:
smtpd_recipient_restrictions =
[...]
check_policy_service unix:private/childprot
[...]
The restricted recipients and the whitelists are stored in an SQLite3 database:
CREATE TABLE child_address_t (
child INTEGER REFERENCES child_t(id),
address TEXT
);
CREATE TABLE child_t (
id INTEGER PRIMARY KEY,
name TEXT,
delegate TEXT
);
CREATE TABLE whitelist_t (
child INTEGER REFERENCES child_t(id),
address TEXT
);
CREATE VIEW child_v AS
SELECT c.id as id,
c.delegate as delegate,
ca.address as address
FROM child_t c,
child_address_t ca
WHERE c.id = ca.child;
Restricted persons together with their delegates are added to the table child_t, multiple addresses can be assigned to those persons in child_address_t. Whitelists per person are maintained in whitelist_t.
The tool is querying the view child_v.