0

i'm setting up a mail server with postfix, dovecot and roundcubemail, i receive emails, but when I send e-mail to any address the system SMTP Error (454): inserting the recipient "<email>" failed (4.7.1 <email>: Relay access denied) My main.cf is this:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_tls_cert_file = /etc/postfix/ssl/mailserver.crt
smtpd_tls_key_file = /etc/postfix/ssl/mailserver.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = <mydomain>
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = <mydomain>, localhost.<mydomain>, localhost
relayhost =
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtpd_tls_auth_only = no
smtp_tls_note_starttls_offer = yes
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

Note: When i send mail to my host i receive it, but if I send mail to live or gmail it don't send anything.

Vince
  • 9
  • 2

1 Answers1

0

You have defined that you allow sasl auth to relay

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination

but you have not defined how sasl auth is supposed to work

smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous

See my answer from a similar previous question

How to configure my postfix to use Outlook,Thunderbird

Stephan
  • 531
  • 3
  • 16