I would like to setup my Postfix following way:
- Allow to send email only by authenticated users on any email address (authentication is working now)
- Allow to receive messages only to the limited number of users (preferrably specified in /etc/postfix/virtual, but I can add any other required file)
Actually I have only following restrictions in main.cf
:
relayhost =
relay_domains = $mydestination
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination,permit
smtpd_sender_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_non_fqdn_sender,reject_unknown_sender_domain,permit
virtual_alias_maps = hash:/etc/postfix/virtual
alias_database = hash:/etc/postfix/aliases, hash:/etc/aliases
Content of /etc/postfix/virtual
file aimed to collect all mail from specified virtual user to existing local one:
admin@mysite.com postfix
feedback@mysite.com postfix
abuse@mysite.com postfix
webmaster@mysite.com postfix
As I understand smtpd_recipient_restrictions
value reject_unauth_destination
should be enough, but when I turn it on I cannot send emails to any external system - postfix says Relay access denied
. I cannot get how to fix it.
UPD: Finally I placed 'paranoid-style' record:
smtpd_recipient_restrictions =
permit_sasl_authenticated,
permit_mynetworks,
# permit,
reject_unauth_destination,
reject