Access denied when sending mail - postfix

i have configured mail server with postfix with dovecot with no encryption:
When connecting with Thunderbird imap is working fine. when sending email from another domain to this domain again it is fine. but when i want to send mail frommy domain to another it gives me error and this is /var/log/maillog:

Jan 18 18:23:09 srv1 postfix/smtpd[3991]: NOQUEUE: reject: RCPT from unknown[95.81.67.120]: 554 5.7.1 <Recipient email>: Relay access denied; from=<Sender> to=<Recipient email> proto=ESMTP helo=<[127.0.0.1]>

here is my smtp_restrcitions:

smtpd_recipient_restrictions = reject_unknown_sender_domain,  reject_unknown_recipient_domain, reject_non_fqdn_sender,  reject_non_fqdn_recipient, reject_unlisted_recipient,  check_policy_service inet:127.0.0.1:7777, permit_mynetworks,  permit_sasl_authenticated, reject_unauth_destination,  reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname,  check_policy_service inet:127.0.0.1:10031

any idea?

Your host IP does not have DNS reverse IP address lookup (PTR records in 120.67.81.95.inaddr.arpa pseudo domain): "from unknown[95.81.67.120]"

Change this to

smtpd_recipient_restrictions = 
permit_mynetworks,
permit_sasl_authenticated,
reject_unknown_sender_domain,  
reject_unknown_recipient_domain, 
reject_non_fqdn_sender,  
reject_non_fqdn_recipient, 
reject_unlisted_recipient,  check_policy_service inet:127.0.0.1:7777,    reject_unauth_destination,  
reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname,  
check_policy_service inet:127.0.0.1:10031

And then make sure your localhost is in the mynetworks parameter/file.

1 Like

There is value in having a rDNS or PTR record set. Ask the owner of the ip address (HamaraSystem Co) to create a pointer record.