Ty for you reply

I think you misunderstood the direction of the mail i want to limit. i
wanted to limit "To" and not "From"


/etc/postfix# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
header_checks = pcre:/etc/postfix/header_checks
inet_interfaces = localhost
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = dvlmweb01.u.net, localhost.u.net, localhost
myhostname = dvlmweb01.u.net
mynetworks = 127.0.0.0/8
myorigin = dvlmweb01.u.net
readme_directory = no
recipient_delimiter = +
relayhost = 10.0.0.10
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes

I went with the header_checks solution

cat /etc/postfix/header_checks
IF /To:/
!/(@a\.dk|@b\.dk|@c\.dk)/ REJECT Trying to send to domain thats not whitelisted
ENDIF

Works like i want. I know there is a performance penalty with the pcre
instead of hash tables, but its very development server, so the
traffic is very very low.

It works, thanks.

Reply via email to