Abaixo está uma configuração "stub" para verificar também as mensagens enviadas.
No main.cf:
smtpd_sender_restrictions =
check_client_access cidr:/etc/postfix/internal_clients_filter
E: / etc / postfix / internal_clients_filter
192.168.0.0/24 FILTER smtp:[127.0.0.1]:12501
10.0.0.0/24 FILTER smtp:[127.0.0.1]:12501
(você também pode fazer isso de outras maneiras para usuários logados, ip, etc.)
Use um policybank no Amavisd-new:
$interface_policy{'12501'} = 'INTERNAL';
$policy_bank{'INTERNAL'} = { # mail originating from clients in cidr:/etc/postfix/internal_clients_filter
bypass_spam_checks_maps => [0], # spam-check outgoing mail
bypass_banned_checks_maps => [0], # banned-check outgoing mail
bypass_header_checks_maps => [0], # header-check outgoing mail
forward_method => 'smtp:[127.0.0.1]:12502', # relay to Postfix listener on port 12502
};
E o caminho reinject no postfix:
127.0.0.1:12502 inet n - n - - smtpd
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_restriction_classes=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o mynetworks=127.0.0.0/8
-o smtpd_data_restrictions
-o smtpd_end_of_data_restrictions=
-o local_header_rewrite_clients=
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o smtpd_milters=
-o local_recipient_maps=
-o relay_recipient_maps=
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_address_mappings