Postfix errors, cannot send emails

Hi everyone,

I’m facing an issue with postfix. Previously, I have successfully set gmail as smtp server in nc config. Nextcloud is sending test email correctly, but the system cannot send email when, for example, Fail2ban wants to kick someone.

Here is an extract of my logs:

Feb 16 19:44:48 nextcloudpi postfix/smtp[10227]: connect to ownyourbits.com[185.162.171.236]:25: Connection timed out
Feb 18 22:18:36 nextcloudpi postfix/error[32663]: B0B711F01F: to=<contact@mydomain.org>, relay=none, delay=10232, delays=10141/90/0/0.03, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to aspmx.l.google.com[74.125.140.27]:25: Connection timed out)

After some research on the forum, I was not able to make it work, and more important, to clearly identify the issue.
Why is it trying to reach google.com on port 25 ? Is that normal, considering that I have set port 465 in my config ?
Is it coming from my router, my provider ?

Any help will be really appreciated !

Thank you

Port 25/tcp is the default, unsecure SMTP port over which email is sent. Port 465/tcp is
used for TLS secured SMTPS traffic. Here you find further information about the different
protocols: https://de.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol

Thank you for your answer. So, the SMTP configuration is not used by Postfix ? How can I configure it ?

I have followed this post, and now, it’s fully working. So we have to make the configuration twice. If there is another way, I haven’t found it, but I would be interested in it !