0

i have setup my vps as Postfix as a Send-Only SMTP Server on Ubuntu 18.04

and i want to send emails remotely not locally on server

when i send using the server locally it works

but remotely or outside server, am getting this error

client does not have permission to submit mail to this server. the server response was: 4.7.1 : relay access denied


smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_un$
myhostname = server69092.domain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, server69092.domain.com, localhost.domain.c$
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

1 Answers1

0

If you want to relay emails on this server (without actually using smtp auth) you should modify this line:

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128

with

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 ip-of-server-which-sends-the-email

A real example:

Assuming you're sending emails from server with ip 1.2.3.4, then you'll have this in Postfix config:

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 1.2.3.4/32

Do a postfix reload and try and see if it works. If not you could restart the postfix service and try again.

Bogdan Stoica
  • 403
  • 4
  • 9