I have searched other post on here and they appear to be relevant but when I enter in the exact same commands it denies relay access to everyone. I have also used the postmap command to refresh the database.
Feb 16 15:54:48 EMAIL2 postfix/smtpd[6512]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 554 5.7.1 <josh.dobs@gmail.com>: Recipient address rejected: Relay access denied; from=<msolis@EMAIL2.drewmedical.com> to=<josh.dobs@gmail.com> proto=ESMTP helo=<192.168.1.51>
I used this page as reference.
http://www.postfix.org/RESTRICTION_CLASS_README.html
Below is my main.cf
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = /usr/share/doc/postfix
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = EMAIL2.EXAMPLE.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
# Identifies what mail the host will deliver locally.
mydestination = EXAMPLE.com, EMAIL2.EXAMPLE.com, localhost.EXAMPLE.com
#relayhost =
mynetworks = 192.168.1.0/24, 127.0.0.0/8,
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
html_directory = /usr/share/doc/postfix/html
mydomain = EXAMPLE.com
# Rewriting Addresses in Outgoing Mail
masquerade_domains = EXAMPLE.com
# MailScanner Header Cheecker
header_checks = regexp:/etc/postfix/header_checks
# Enables maildir style email retension
home_mailbox = Maildir/
### Reject bogus email
#smtpd_delay_reject = yes
#smtpd_helo_required = yes
#smtpd_helo_restrictions =
# permit_mynetworks,
## reject_invalid_hostname,
## reject_non_fqdn_hostname,
# permit
#smtpd_data_restrictions =
#reject_unauth_pipelining,
#permit
#smtpd_sender_restrictions =
# permit_mynetworks,
# reject_non_fqdn_sender,
# reject_unknown_sender_domain,
# permit
#smtpd_recipient_restrictions =
#permit_sasl_authenticated,
#permit_mynetworks,
#reject_unknown_recipient_domain,
#reject_unauth_destination,
# permit
### TLS - SASL ###
smtpd_sasl_local_domain = EXAMPLE.com
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_tls_auth_only = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
smtpd_tls_received_header = yes
smtpd_tls_key_file = /etc/ssl/private/smtpd.key
smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt
smtp_tls_note_starttls_offer = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
#smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject _unauth_destination
smtpd_recipient_restrictions = check_sender_access hash:/etc/postfix/restricted_senders, check_relay_domains
smtpd_restriction_classes = local_only
local_only = check_recipient_access hash:/etc/postfix/local_domains, reject
This is the local_domains file:
user@EMAIL2:/etc/postfix$ cat local_domains
# This table defines what destinations are local
# FORMAT = this.domain OK
EXAMPLE.com OK
EMAIL2.EXAMPLE.com OK
This is the restricted senders file
user@EMAIL2:/etc/postfix$ cat restricted_senders
# Users restricted to local only.
# FORMAT IS = foo@domain local_only
brose@EXAMPLE.com local_only
brose@EMAIL2.EXAMPLE.com local_only
Any help will be greatly appreciated.