Exim can’t send emails out of the server, but can receive

eximsmtp

I installed cpanel on a new server, so exim is included. As my provider blocks port 25, I added port 587 (according to the ISP recomendation), to the "Allow exim to listen on port " setting.

I can receive messages sent to any email created on the server, but no way to send messages out of the server. They go to the Queue and stack there.

There are the logs, of when trying to send an email to a gmail address.

LOG: MAIN
  cwd=/usr/local/cpanel/whostmgr/docroot 4 args: /usr/sbin/exim -v -M 1UQguD-0005bE-74
delivering 1UQguD-0005bE-74
Connecting to gmail-smtp-in.l.google.com [2607:f8b0:4002:c04::1a]:25 ... failed: Network is unreachable
LOG: MAIN
  gmail-smtp-in.l.google.com [2607:f8b0:4002:c04::1a] Network is unreachable

And this, trying to send to hotmail.

LOG: MAIN
  mx2.hotmail.com [65.55.37.120] Connection timed out
Connecting to mx2.hotmail.com [65.55.92.152]:25 ... failed: Connection timed out (timeout=5m)
LOG: MAIN
  mx2.hotmail.com [65.55.92.152] Connection timed out

Where Am I wrong?

Best Answer

Outgoing SMTP must use port 25. Port 587 is the submission port which is only for your users to connect to the server and submit emails for sending. The actual sending of the email from your server to the other servers must occur over port 25. You must contact your ISP to lift the block on port 25 or configure another email server (which is not blocked on 25) as a smart host.