Hi,
I have the following question:
- By default: All hosts should be able to mail to domain1.org, domain2.org, internaldomain.org and subdomains
- If the host(s) may_use_external_mail, they should be able to mail to other external addresses
If a mail doesn't match above requirements, it has to be rejected.
The configuration below works, but I have to list each host in /etc/postfix/policy_by_machines.
And that is not what I want. Can somebody help me ?
I have the following question:
- By default: All hosts should be able to mail to domain1.org, domain2.org, internaldomain.org and subdomains
- If the host(s) may_use_external_mail, they should be able to mail to other external addresses
If a mail doesn't match above requirements, it has to be rejected.
The configuration below works, but I have to list each host in /etc/postfix/policy_by_machines.
And that is not what I want. Can somebody help me ?
Code:
smtpd_restriction_classes = may_use_external_mail, only_internal_mail
may_use_external_mail =
permit
only_internal_mail =
check_recipient_access hash:/etc/postfix/allowed_recipients
reject
smtpd_client_restrictions =
check_client_access hash:/etc/postfix/policy_by_machines
permit
smtpd_recipient_restrictions =
permit_mynetworks
reject_unauth_destination
permit
cat /etc/postfix/allowed_recipients
@domain1.org
@domain2.org
cat /etc/postfix/policy_by_machines
workstation1.internal.domain may_use_external_mail
workstation2.internal.domain only_internal_mail