Chaning SMTP Port from 25

tyallred

Verified User
Joined
Nov 5, 2003
Messages
16
Location
USA
With so many ISP's blocking port 25 for SMTP, what is the process to change the port to something different, like 2112?
 
Can you tell me where exactly it goes in the exim.conf file?

Nomatter where I've tried to put it, it won't allow exim to run.

(I've run the kill -1) to do the HUD, but it won't start/restart at all.

Thanks,
 
well, it worked, but it's "PORT" , not 'service'

like so...

daemon_smtp_port = "2112"
acl_smtp_rcpt = check_recipient
acl_smtp_data = check_message


Thanks Everybody!
 
Hello,

Good to hear. My guess would be that the article is probably just a bit out of date.

John
 
last change

To get the "Webmail" to work, you have to change the following line.... in this file /var/www/html/webmail/inc/class.smtp.php

var $Port = 2112;
 
Squirrel Mail port change

To get Squirrel Mail to work with an alias port... Change the following line in this file:

/var/www/html/squirrelmail-1.4.2/class/deliver/Deliver_SMTP.class.php

From

$stream = fsockopen($host, $port , $errorNumber, $errorString);


To

$stream = fsockopen($host, 2112 , $errorNumber, $errorString);

(This is line 40)
 
problem with changing smtp port from 25

All of this above works great, with the exception of:

Anybody that is using account name = email address isn't receiving email.

I can just tell people to not have their account name be something that want to receive email at, but is there way to have my cake and eat it too?
 
Moving this to the system level discussion, not really anything to do with the admin level of DirectAdmin :)

Chris
 
Alas! port 25 and an alternate!

This works best:

Just add this first line to /etc/exim.conf and both 25 and 26 will work as smtp ports.

daemon_smtp_ports = 25 : 26
acl_smtp_rcpt = check_recipient
acl_smtp_data = check_message

With this you don't have to change webmail / squirrelmail settings at all, and spamassassin still works, etc.

Yipee!

:p
 
I tried following these above directions to bypass my ISP's port 25 SMTP filter but unfortunately I couldn't get it to work.

The first change I made to the /etc/exim.conf file was to add the following line.

daemon_smtp_port = 25 : 125

This was placed immediately above the

acl_smtp_rcpt = check_recipient
acl_smtp_data = check_message

Because there was no previous daemon_smtp_port option in the exim.conf file. And yes I'm using the latest Exim 4.44 with jlasman's exim.conf file provided by DirectAdmin.

Here's the problem I ran into. When I inserted the above line, reran the service exim restart command I was able to portscan my server and see a new port open on 125 with Exim 4.44 responding to it. But when I went to send an email message from Outlook to my email server on port 125 I got the following bounceback error:

Subject: Running a test
Sent: 01/27/2005 2:28 PM

The following recipient(s) could not be reached:

'[email protected]' on 01/27/2005 2:28 PM
503 valid RCPT command must precede DATA


All the messages were bouncing back that I was sending, BUT Outlook was telling me it made a successfull connection to the server and that Exim WAS in fact listening to port 125.

What have I messed up on to cause it to immediately within a second send the above email back to me? Now when I go back to using port 25 and changing the smtp server to that of my ISP, I don't get that error.

Ideas? Thoughts??
 
First off, I'm no genius

I think you might be creating a conflict trying to open up all of the ports between 25 and 125. Is there a reason you just didn't use 25 : 26?
 
Hrm, I thought that was just opening only ports 25 and 125, not everything in between.

The reason I chose a higher port along with 25 is incase my ISP decides to block/filter anymore lower ports.
 
You are correct; you're only opening two ports. Tyallred is mistaken.

The proper SMTP port, according to RFC 2476, is port 587.

Here's some code you could enter as part of the rcpt acl to block all unauthenticated email on port 587:

<snip>
accept hosts = +auth_relay_hosts
condition = ${if eq {$interface_port}{587} {yes}{no}}
endpass
message = relay not permitted, authentication required
authenticated = *
</snip>

As far as the problem is concerned, if you can prove it's your server returning the error (check your logs) ask on exim-users.

Jeff
 
Where exactly would that code go? I saw at the bottom of the ACL portion that there was the condition, message, and auth. code already there. Would I need to add it again?

I'm definately a newbie to exim and want to make sure I don't screw up the exim.conf file and try to learn why things work the way they do in the process.
 
While the standard DA exim.conf file includes similar code, it's not the same and doesn't serve the same purpose.

This code should go above these lines:

# default at end of acl causes a "deny", but line below will give
# an explicit error message:
deny message = relay not permitted

Don't forget to restart exim.

Jeff
 
So, is there an stardardised solution for making port 26 also responding as an smtp port?
 
Last edited:
Any updates on this?

I have just added this line
"daemon_smtp_port = 25 : 125"
to my exim 4.40 installation.

Restarted the service and everything seems to be OK
 
Back
Top