I'd like to know how to block my users to send mail to each other but give them chance to send and receive external mail.
john@localdomain.com <---> julie@localdomain.com REJECT
john@localdomain.com <---> tom@gmail.com OK
julie@localdomain.com <---> tom@gmail.com OK
I've already tried to configure access restrictions rules like
/etc/postfix/main.cf:
smtpd_recipient_restrictions =
...
check_recipient_access hash:/etc/postfix/protected_destinations
...the usual stuff...
smtpd_restriction_classes = insiders_only
insiders_only = check_sender_access hash:/etc/postfix/insiders, reject
/etc/postfix/protected_destinations:
all@my.domain insiders_only
all@my.hostname insiders_only
/etc/postfix/insiders:
my.domain OK matches my.domain and subdomains
another.domain OK matches another.domain and subdomains
But that didn't help cause local sender blocked before local recipient checked and local recipient blocked before external one checked.