Добрый вечер. прошу помощи в следующем вопросе. Есть работающая связка postfix+dovecot+mysql. нужно ограничить отправку почты только на два домена. Условно domain1.com(наш домен) и еще один domain2.com пробую сделать это через Postfix restriction classes
В mail.cf:
check_sender_access = mysql:/etc/postfix/sql/restricted_senders.conf
check_recipient_access = mysql:/etc/postfix/sql/local_domains.conf
smtpd_recipient_restrictions =
check_sender_access,
permit_mynetworks,
reject_unauth_destination
smtpd_restriction_classes = local_only
local_only = check_recipient_access, reject_unauth_destination
smtpd_client_restrictions = permit_mynetworks,
permit_sasl_authenticated,
permit
smtpd_helo_restrictions = permit_mynetworks,
permit_sasl_authenticated,
reject_invalid_helo_hostname,
reject_non_fqdn_helo_hostname,
reject_unknown_helo_hostname,
permit
smtpd_sender_restrictions = permit_mynetworks,
permit_sasl_authenticated,
reject_non_fqdn_sender,
reject_unknown_sender_domain,
permit
smtpd_data_restrictions = permit_mynetworks,
reject_unauth_pipelining,
reject_multi_recipient_bounce,
permit
smtpd_etrn_restrictions = reject
smtpd_helo_required = yes
smtpd_discard_ehlo_keywords = etrn, silent-discard
smtpd_forbidden_commands = CONNECT GET POST
disable_vrfy_command = yes
В /etc/postfix/sql/restricted_senders.conf
user = postfix
password = pass
hosts = 127.0.0.1
dbname = mail
table = restricted_senders
select_field = permission
where_field = usermail
В /etc/postfix/sql/local_domains.conf
user = postfix
password = pass
hosts = 127.0.0.1
dbname = mail
table = local_domains
select_field = result
where_field = domain
Были созданы базы и добавлены пользователи и домены
insert into restricted_senders values ('user1@name.domain1.com','local_only');
insert into restricted_senders values ('domain1.com','OK');
insert into restricted_senders values ('domain2.com','OK');
Но почта все равно ходит на любые внешние домены.