snowhall wrote:
Postfix is running. I'm sending emails and can connect to port 25 from my server (because it's allow to this IP)
It's open only for selected IP address because 25 is only for sending email.
Should I open this port to everyone?
Yes, because Gmail is trying to send an e-mail to your server, and it's not on that select list of IP addresses you have.
Keep port 25 open for all, but restrict your configuration so you don't end up becoming an open relay.
The
permit_mynetworks and
reject_unauth_destination parameters for the configuration option
smtpd_recipient_restrictions do the trick for you (they are usually the default for Postfix, as I gather).
The
mynetworks option can then be used to just allow certain IP addresses and/or network segments to send e-mail to anyone via your server.
snowhall wrote:
It's listening localhost only:
localhost:smtp
How can I change to *:smtp ?
Do you have the
smtp_bind_address option set to anything in main.cf? If you do, set it to blank or
0.0.0.0 to let Postfix use all interfaces/IPs on your server (localhost, public IP(s) and, if used, private IP).