-3

im setting up a Postfix/Dovecot mailserver on CENTOS, i came send and recieve emails fine using webmail, i can also pull emails from the server using googles settings no problem, however when i attempt to send email from google using the email address from the mailserver not my gmail i get a 554 relay access denied error

output of postconf -n
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
disable_vrfy_command = yes
enable_original_recipient = no
header_checks = regexp:/etc/postfix/header_checks
inet_interfaces = all
local_recipient_maps = 
mailbox_size_limit = 0
maximal_backoff_time = 8000s
maximal_queue_lifetime = 7d
minimal_backoff_time = 1000s
mydestination = $mydomain
myhostname = mail.mainewarmers.com
mynetworks = 127.0.0.0/8, <site IP>, [::1]/128, 209.85.216.43
mynetworks_style = host
myorigin = $mydomain
readme_directory = no
recipient_delimiter = +
smtp_helo_timeout = 60s
smtp_tls_note_starttls_offer = yes 
smtp_tls_security_level = may
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_client_restrictions = reject_rbl_client sbl.spamhaus.org, reject_rbl_client      
blackholes.easynet.nl, reject_rbl_client dnsbl.njabl.org
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_delay_reject = yes
smtpd_hard_error_limit = 12
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks, warn_if_reject reject_non_fqdn_hostname,   reject_invalid_hostname, permit
smtpd_recipient_limit = 16
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = 
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks,   warn_if_reject reject_non_fqdn_sender, reject_unknown_sender_domain,   reject_unauth_pipelining, permit
smtpd_soft_error_limit = 3
smtpd_tls_cert_file = /etc/postfix/cert.pem
smtpd_tls_key_file = /etc/postfix/key.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 450
virtual_alias_maps = hash:/etc/postfix/virtual\

telnet to port 25 works just fine, as does openssl s_client -connect mail.mainewarmers.com:25 -starttls smtp

however, whenever i attempt to send an email to an external email address using my google account

Technical details of permanent failure: Google tried to deliver your message, but it was rejected by the relay mail.mainewarmers.com by mail.mainewarmers.com. [54.164.102.132].

The error that the other server returned was: 554 5.7.1 : Relay access denied

maillog gives me this

Nov  7 19:54:39 ip-172-31-17-198 postfix/smtpd[5046]: NOQUEUE: reject: RCPT from   mail-qg0-f43.google.com[209.85.192.43]: 554 5.7.1 <a@mail>: Relay access denied;  from=<bhanscom@mainewarmers.$
Nov  7 19:54:39 ip-172-31-17-198 postfix/smtpd[5046]: disconnect from mail-qg0-f43.google.com[209.85.192.43]

i have gone over my postconf and setup for the last 5 hours, i dont see anything wrong can someone point me in the correct direction? thanks a bunch!

1 Answers1

-1

fixed it, used dig and ns to find the ips google uses to send mai, added those to mynetworks. works like a charm finally after all day