Exim configuration - listening on 25 for localhost only

Solution 1:

If you literally put "localhost" in that setting, try putting instead:

dc_local_interfaces='127.0.0.1 ; ::1'

During dpkg-reconfigure exim4-config, if you select *Internet site" for the type, the second question looks like this:

Please enter a semicolon-separated list of IP addresses. The Exim SMTP listener
daemon will listen on all IP addresses listed here.

An empty value will cause Exim to listen for connections on all available network
interfaces.

If this system only receives mail directly from local services (and not from other
hosts), it is suggested to prohibit external connections to the local Exim daemon.
Such services include e-mail programs (MUAs) which talk to localhost only as well
as fetchmail. External connections are impossible when 127.0.0.1 is entered here,
as this will disable listening on public network interfaces.

IP-addresses to listen on for incoming SMTP connections:

Simply put the following in that field:

127.0.0.1; ::1

Solution 2:

When IPv6 disabled, you must change the file /etc/exim4/update-exim4.conf.conf:

this line: dc_local_interfaces='127.0.0.1 ; ::1'

change to: dc_local_interfaces='127.0.0.1'

Then restart exim.

For clarity, I give the screenshot: enter image description here