Setup postfix mysql and spamassassin for kids use
First of all you need debian install on a server on the internet
apt-get install amavisd-new spamassassin clamav clamav-daemon zoo unzip unarj bzip2 unzoo libnet-ph-perl libnet-snpp-perl libnet-telnet-perl nomarch lzop apt-get install postfix postgrey dovecot squrrielmail proemail apt-get install razor pyzor adduser clamav amavis adduser amavis clamav
postconf -e 'content_filter = amavis:[127.0.0.1]:10024' postconf -e 'receive_override_options = no_address_mappings'
root@1256-1776-4220:/etc/amavis/conf.d# cat 15-content_filter_mode
use strict;
@bypass_virus_checks_maps = ( %bypass_virus_checks, @bypass_virus_checks_acl, $bypass_virus_checks_re);
@bypass_spam_checks_maps = ( %bypass_spam_checks, @bypass_spam_checks_acl, $bypass_spam_checks_re); 1;
root@1256-1776-4220:/etc/amavis/conf.d# cat 50-user use strict;
Create postfix database in mysql
create database postfix; CREATE TABLE protected_users ( recipient VARCHAR( 50 ) NOT NULL , class VARCHAR( 10 ) NOT NULL, UNIQUE ( recipient ) );
CREATE TABLE whitelist ( sender VARCHAR( 50 ) NOT NULL , action VARCHAR( 2 ) NOT NULL , UNIQUE ( sender ) );
insert into protected_users (recipient, class) values ('marjanne@quantrill.eu','whitelist');
insert into whitelist (sender, action) values ('terry.quantrill@btinternet.com','OK’);
GRANT SELECT on postfix.* TO postfix@localhost identified by 'postfix';
/etc/postfix/main.cf
strict_rfc821_envelopes = yes disable_vrfy_command = yes smtpd_delay_reject = yes smtpd_helo_required = yes smtpd_recipient_restrictions = reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unauth_pipelining, permit_mynetworks, check_policy_service inet:127.0.0.1:60000, permit_tls_clientcerts, reject_rbl_client zen.spamhaus.org, warn_if_reject reject_invalid_hostname, warn_if_reject reject_non_fqdn_hostname, reject_unauth_destination, check_helo_access hash:/etc/postfix/helo_checks, mysql:/etc/postfix/protected_users.cf smtpd_restriction_classes = whitelist whitelist = check_sender_access mysql:/etc/postfix/whitelist.cf reject receive_override_options = no_address_mappings
root@1256-1776-4220:/etc/postfix# cat protected_users.cf
dbname = postfix hosts = 127.0.0.1 user = postfix password = postfix table = protected_users select_field = class where_field = recipient
root@1256-1776-4220:/etc/postfix# cat whitelist.cf
dbname = postfix hosts = 127.0.0.1 user = postfix password = postfix table = whitelist select_field = action where_field = sender Check using: postmap -v -q "simon.quantrill@gmail.com” mysql:/etc/postfix/whitelist.cf postmap -v -q "marjanne@quantrill.eu" mysql:/etc/postfix/protected_users.cf
For any feedback or corrections, please write in to: Simon Quantrill