How-To Change SMTP port Exim

Last week I would change the SMTP port from my Exim4 email server in Amsterdam.

Why?

I am using my laptop on many network over many providers. Also the network from ziggo.nl in The Netherlands that blocked all SMTP (port 25) traffic outside here one network.

I prefer to user just one SMTP server independently on what network I am connecting to the internet. My exim4 SMTP server does SMTP authentication over TLS, I user Thunderbird as a email client and with all that I can send email over all networks while I keep the SMTP server closed for Spam re-layers.

As you know is port 25 the standard port to connect to SMTP, but because of the fact that ziggo.nl is so sciesofreen that the block all traffic on port 25 outside there network I can connect to my own server on port 25.

The Solution

The solution is to let the email client connect on a other port than 25. So two things has to be done to make this work. In my example I suppose we use port 26 to connent.

  1. Make Exim4 to listen (also) on port 26
  2. Make Thunderbird connect on port 26

Exim4 config

To "learn" Exim4 to listen not only on port 25 but also on port 26 we edit the file update-exim4.conf.conf (Ubuntu / Debian)

Change the line:

dc_local_interfaces=''

to:
dc_local_interfaces='0.0.0.0.25:0.0.0.0.26'

The 0.0.0.0 stand for "listen to all interfaces and op IP-numbers". The last two digits stand for the portnumber. If you want you can also give up the IP-address of a interface like 127.0.0.0.1.25:127.0.0.1:26

Then re-build the configfile and restart Exim4

update-exim4.conf
/etc/init.d/exim4 restart

Exim4 Thunderbird Email client

To change the SMTP port of your Thunderbird email client go to:

-> Edit
-> Account setting
-> Outgoing Server (SMTP)
-> Edit - And change the port from 25 into 26
-> OK

That's all!

Note: I see many post on the internet that says that the command daemon_smtp_ports = 25 : 26 should do the same. I can't get that to work Exim4 gives an error about unknown command.

Post new comment
The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.