2

I have configured exim4 and am trying to send out emails using port 587 and the email is being sent but on the mail server it show connecting at port 25. I am using:

echo "Subject:Hello All" | sendmail -v  -port 587 [email protected]


T: remote_smtp for [email protected]
Connecting to gmail-smtp-in.l.google.com [2607:f8b0:4004:c08::1a]:25 ... LOG: MAIN

(Not pasting the entire output of the log here)

+++++++++++++++++++++ I wanted to check why the connection goes to port 25 as shown below---- """Connecting to gmail-smtp-in.l.google.com [2607:f8b0:4004:c08::1a]:25 ... LOG: MAIN""""

I want all my email to connect on port 587 as I have requested for port 587. I have tried most of the settings shown online in the exim4 config file. But still it connects on 25. Links that I followed but no luck : https://www.fyzix.net/index.php?title=Installing_and_Configuring_Exim4_for_Gmail_SMTP_Relay and https://logs.paulooi.com/enable-smtp-port-587-on-exim.php

Also, any mail server I use... it connects to port 25..

Could anyone help me here ?

1

2 Answers 2

1

The easiest way I found to get this working is to add port = 587 to the remote_smtp_smarthost: section in /etc/exim4/conf.d/transport/30_exim4-config_remote_smtp_smarthost

This only works if you're using the split-files config approach, chosen via e.g. dpkg-reconfigure exim4-config. Otherwise you have to edit /etc/exim4/exim4.conf.template (same section).

Then run update-exim4.conf to generate the final config file (/var/lib/exim4/config.autogenerated).

Then restart the exim daemon, e.g. systemctl restart exim4.

(There are probably other/more correct ways to configure this by messing with the driver directive or TLS settings, but for some reason it doesn't work out-of-the-box on Debian, even after specifying port 587 in the SMTP url via dpkg-reconfigure exim4-config. The docs are enormous.)

See also https://www.fyzix.net/index.php?title=Installing_and_Configuring_Exim4_for_Gmail_SMTP_Relay

0

It seems your Exim server is accepting email at port 587, but when it comes to delivering mail, it is not properly configured to establish a TLS/SSL connection to the destination server -- that's why it is connecting to the non-SSL port 25--. You need to get acquainted with Exim SSL/TLS configuration, install a digital certificate and configure Exim to require SSL/TLS connections when delivering messages.

Besides, some remote SMTP servers may want to establish secure connections through different ports, like 465, 587 and --yes-- 25. This depends on the local set up of the remote server.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.