PDA

View Full Version : Chaning SMTP Port from 25


tyallred
11-05-2003, 10:42 AM
With so many ISP's blocking port 25 for SMTP, what is the process to change the port to something different, like 2112?

S2S-Robert
11-05-2003, 10:56 AM
I presume you're running your direct admin on your home connection?

I think you'll have to change the sendmail port.

DirectAdmin Support
11-05-2003, 12:37 PM
Hello,

add to top section of /etc/exim.conf
daemon_smtp_service = "2112"

http://www.exim.org/pipermail/exim-users/Week-of-Mon-20011015/031284.html

tyallred
11-05-2003, 04:50 PM
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,

ProWebUK
11-05-2003, 06:32 PM
Originally posted by DirectAdmin Support
add to top section of /etc/exim.conf

tyallred
11-05-2003, 09:58 PM
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!

DirectAdmin Support
11-05-2003, 11:01 PM
Hello,

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

John

tyallred
11-17-2003, 10:13 PM
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;

tyallred
11-18-2003, 08:44 AM
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)

tyallred
12-10-2003, 09:01 AM
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?

ProWebUK
12-10-2003, 09:05 AM
Moving this to the system level discussion, not really anything to do with the admin level of DirectAdmin :)

Chris

tyallred
12-20-2003, 11:28 PM
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

modem
01-27-2005, 12:30 PM
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:

'modem_19@yahoo.com' 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??

tyallred
01-27-2005, 12:40 PM
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?

modem
01-27-2005, 01:57 PM
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.

jlasman
01-27-2005, 08:38 PM
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

modem
02-03-2005, 08:36 AM
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.

jlasman
02-05-2005, 08:57 AM
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

albatroz
02-12-2005, 11:53 AM
So, is there an stardardised solution for making port 26 also responding as an smtp port?

albatroz
06-13-2005, 12:09 PM
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

jlasman
06-13-2005, 04:30 PM
While you can certainly use any port you want, the standard port for authenticated mail sending is port 587.

Jeff