PDA

View Full Version : Postfix SMTP Port 25 Problem/Question


ccix
21st January 2006, 08:33
I've had a email server setup for awhile now with sendmail. i've since installed a new hard drive and started with the fresh setup for the debian 3.1 how to. Everything seems to work great except this....

If i'm on the local host i can telnet to port 25 and send mail/etc.... But if i try to login from outside the domain (say from dialup or not from my office...at my parents house) it doesn't connect, just times out? What am i missing? Is there a setting i missed. Followed the setup perfectly (set it up a few times actually why playing around). One note, i'm not using ISPCONFIG.

Any help would be appreciated.

Eric

falko
21st January 2006, 08:42
Are you using Sendmail or Postfix right now? If you use Postfix, have a look at the inet_interfaces setting in /etc/postfix/main.cf, if you use Sendmail, have a look here: http://www.howtoforge.com/forums/showthread.php?t=25

Might also be a firewall problem. Please post the output of iptables -L

ccix
21st January 2006, 08:49
I am using Postfix (setup via the howto for the perfect setup+SQL/auth/etc)

inet_interfaces = all

ns:/etc/postfix# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination


mail server is mail.ccix.com if you'd like to telnet in and see what happens.... any other ideas? Let me know if you want a copy of any other config settings/files.


Eric

themachine
21st January 2006, 08:51
are you behind a firewall??? if so, perhaps you need to open the port up and configure port forwarding... by default the port is probably blocked at the firewall.

ccix
21st January 2006, 08:56
No physical firewall in front of the server. If i plugin the old harddrive and use my old setup then i can send email fine through sendmail (was using debian 3.0 ...worked okay but i liked the way the howto setup things this way).

So definately no firewall (Cisco 675 for DSL, then into a 4 port up ...where the server is connected directly).

themachine
21st January 2006, 17:59
You might want to contact your ISP and inquire as to whether they block port 25 or not. I see customers all the time that cannot send/receive SMTP email *exect* through the servers that are provided by the ISP. It is likely that port 25 is being blocked at the ISP level.

ccix
21st January 2006, 23:58
Not sure what i did but it seems to work now for the most part. I can't connect to it via dial up but if i'm on my cell phone connection it works fine. No ISP blocking anything (Qwest DSL line,do what ya want with it is pretty much what i was told and i had a server running 2 days ago without any problem). Thanks for the suggestions though.

falko
22nd January 2006, 08:50
Not sure what i did but it seems to work now for the most part. I can't connect to it via dial up but if i'm on my cell phone connection it works fine.
Maybe it's the firewall on your client that is blocking?

AgeOfPenguins-com
10th May 2006, 23:05
I know for a fact my ISP is blocking port 25.

How do I set up my mail server to use port 26?

Matthew

themachine
10th May 2006, 23:13
Honestly, I would rather create a port redirect, rather than change the port which the mail server listens on. Then, you simply change the port within your mail client. I have some IPTABLES examples on how to create Port redirects:

http://www.5dollarwhitebox.org/wiki/index.php/Howtos_Basic_IPTables#Port_Redirects


Setup:

Add the Iptables rules to create the redirect so that any traffic going to port 26 is redirected to 25. In your mail client, configure SMTP to connect to your server on port 26.

Let me know if you need any help.

sjau
10th May 2006, 23:41
I think I added port 2500 to my server by doing this:

open master.cf and change


smtp inet n - n - - smtpd

to

smtp inet n - n - - smtpd
2500 inet n - n - - smtpd

AgeOfPenguins-com
11th May 2006, 00:04
I'm not that far yet (setting up e-mail clients etc.)

I'm trying to SEND mail from my server, but my ISP blocks any outbound traffic that isn't headed for its own mail server. (They do that to prevent spam, so you can't just set up a mail server at home and have fun sending out millions of e-mails)

The problem is, I'm not a spammer but I'd like to allow my web server to send e-mails like a normal web server. How can I configure Postfix to use port 26 instead of port 25?

I have a professional webhosting account as well, and they have a special service to "start another copy of the mail service on port 26" for those customers who otherwise can't send mail via port 25.

But in my case, the server ITSELF is on the ISP's network, so it can't send mail on port 25. Is that going to prevent me from sending out e-mail altogether?

That might be...

Matthew

sjau
11th May 2006, 00:18
Just do as I above and instead of port 2500 use port 26.... your server will then listen to both ports :)

I just know that port 2500 works fine from my university... they allow use of port 25 only in combination with Lotus Notes ^^

AgeOfPenguins-com
11th May 2006, 00:42
But how can my server use another port, when it has to send messages to other servers which are using the standard port 25?

That very traffic will be blocked by my ISP -- because although I have both 25 and 26 open, my server will have to communicate with the other servers on the standard SMTP port, 25.

If my users needed to bypass this kind of blocking, they could contact my server -- but my server itself needs to be able to send e-mails itself. How can it do that if the only standard port is blocked?

For instance, my webhost (Spry.com) is running 2 copies of the mail server -- on ports 25 and 26. That allows me to send mail from that domain name, because my computer and the webserver talk on port 26 -- which isn't blocked by SBCYahoo (DSL). But the server there has to send it to its destination -- so what if THAT server was connected to the Internet via SBCYahoo? Could it ever hope to send out e-mails?

Another way of looking at it -- if blocking port 25 is to prevent spamming, why wouldn't spammers just set up a cheap Linux box and configure it for port 26, and send out spam 24/7? Is it really that simple?

Matthew

themachine
11th May 2006, 00:53
Sending SMTP traffic out port 26 will do you no good if the receiving server is not listening on Port 26.

Conclusion: Running a mailserver on your ISP generally is a no go. I would recommend purchasing a hosted server where the petty restrictions of an ISP do not apply.

AgeOfPenguins-com
11th May 2006, 00:57
Would it be possible to send everything through a "relay host" (e.g., mail.domain_using_webhost_listening_on_port_26.com ) and then it would send it to the Internet at large.

But I haven't figured out how to "authenticate" on Postfix -- where do you put in your account name/password to use that SMTP server? I mean, most webhosts require authentication to be able to use their port 25 (to send e-mail) Otherwise spammers could guess the mail server's name and use that.

As you can see, it's possible to use another mail server to do all the sending:

#relayhost = $mydomain
#relayhost = [gateway.my.domain]
#relayhost = [mail.mydomain.com]
#relayhost = uucphost
#relayhost = [an.ip.add.ress]

BUT how do I send it on Port 26, and how do I authenticate with that mail server, since they all require authentication now?

I have an account there, however, so I should be able to use that server. Especially on my Spry account, which is already listening on ports 25 and 26.

Any advice here?

Matthew

falko
11th May 2006, 01:28
Would it be possible to send everything through a "relay host" (e.g., mail.domain_using_webhost_listening_on_port_26.com ) and then it would send it to the Internet at large.

Yes, have a look here: http://www.howtoforge.com/forums/showpost.php?p=207&postcount=2

mlz
12th July 2011, 22:43
I tried adding the line to master.cf, and restarting postfix, however, I can not connect. telnet localhost 26 (I set up for port 26 since Optimum doesn't block this port) and can not communicate with smtp.

here is the line I added to master.cf

26 inet n - n - - smptd


Here is my session with telnet:

[root@www postfix]# telnet localhost 26
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
ehlo localhost.com
^]
telnet> quit

I'm running ISPConfig 3 with the centos 5 perfect host setup. I need this working as we are on optimum (sic) which blocks port 25, and I'd like to be able to use my own mailserver.

falko
13th July 2011, 11:52
What's the output of netstat -tap?

mlz
13th July 2011, 20:13
[root@www languages]# netstat -tap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:imaps *:* LISTEN 927/imap-login
tcp 0 0 *:pop3s *:* LISTEN 1545/dovecot
tcp 0 0 localhost.localdomain:10024 *:* LISTEN 1927/amavisd (maste
tcp 0 0 localhost.localdomain:10025 *:* LISTEN 15868/master
tcp 0 0 *:mysql *:* LISTEN 1898/mysqld
tcp 0 0 *:submission *:* LISTEN 15868/master
tcp 0 0 *:pop3 *:* LISTEN 1545/dovecot
tcp 0 0 localhost.local:dyna-access *:* LISTEN 1810/clamd
tcp 0 0 *:imap *:* LISTEN 927/imap-login
tcp 0 0 *:sunrpc *:* LISTEN 1715/portmap
tcp 0 0 *:ftp *:* LISTEN 1961/pure-ftpd (SER
tcp 0 0 www.m-l-z.com:domain *:* LISTEN 1689/named
tcp 0 0 localhost.localdomai:domain *:* LISTEN 1689/named
tcp 0 0 *:smtp *:* LISTEN 15868/master
tcp 0 0 localhost.localdomain:rndc *:* LISTEN 1689/named
tcp 0 0 *:26 *:* LISTEN 15868/master
tcp 0 0 localhost.localdomain:51649 localhost.localdomain:mysql ESTABLISHED 23321/amavisd (ch11
tcp 0 0 localhost.localdomain:54495 localhost.localdomain:mysql ESTABLISHED 2020/amavisd (ch1-a
tcp 0 0 www.m-l-z.com:pop3s 184.167.249.243:53082 TIME_WAIT -
tcp 13 0 localhost.localdomain:26 localhost.localdomain:39249 CLOSE_WAIT -
tcp 34 0 localhost.localdomain:26 localhost.localdomain:39251 CLOSE_WAIT -
tcp 0 0 localhost.localdomain:mysql localhost.localdomain:51649 ESTABLISHED 1898/mysqld
tcp 0 0 localhost.localdomain:mysql localhost.localdomain:54495 ESTABLISHED 1898/mysqld
tcp 0 0 *:imaps *:* LISTEN 927/imap-login
tcp 0 0 *:pop3s *:* LISTEN 1545/dovecot
tcp 0 0 *:pop3 *:* LISTEN 1545/dovecot
tcp 0 0 *:rockwell-csp2 *:* LISTEN 1794/sshd
tcp 0 0 *:imap *:* LISTEN 927/imap-login
tcp 0 0 *:webcache *:* LISTEN 4825/httpd
tcp 0 0 *:http *:* LISTEN 4825/httpd
tcp 0 0 *:tproxy *:* LISTEN 4825/httpd
tcp 0 0 *:ftp *:* LISTEN 1961/pure-ftpd (SER
tcp 0 0 *:domain *:* LISTEN 1689/named
tcp 0 0 ::1:rndc *:* LISTEN 1689/named
tcp 0 0 *:https *:* LISTEN 4825/httpd
tcp 0 0 www.m-l-z.com:http ::ffff:184.167.249.24:38149 TIME_WAIT -
tcp 0 0 www.m-l-z.com:http ::ffff:184.167.249.24:38151 TIME_WAIT -
tcp 0 0 www.m-l-z.com:http ::ffff:184.167.249.24:37982 TIME_WAIT -
tcp 0 0 www.m-l-z.com:http ::ffff:184.167.249.24:38001 TIME_WAIT -
tcp 0 0 www.m-l-z.com:http ::ffff:184.167.249.24:37993 TIME_WAIT -
tcp 0 0 www.m-l-z.com:http ::ffff:220.181.94.227:61376 TIME_WAIT -
tcp 0 0 www.m-l-z.com:http ::ffff:184.167.249.24:38046 TIME_WAIT -
tcp 0 0 www.m-l-z.com:http ::ffff:184.167.249.24:38038 TIME_WAIT -
tcp 0 0 www.m-l-z.com:http ::ffff:184.167.249.24:38032 TIME_WAIT -
tcp 0 0 www.m-l-z.com:http ::ffff:119.63.196.118:34483 TIME_WAIT -
tcp 0 0 www.m-l-z.com:http ::ffff:184.167.249.24:38024 TIME_WAIT -
tcp 0 0 www.m-l-z.com:http ::ffff:184.167.249.24:38073 TIME_WAIT -
tcp 0 0 www.m-l-z.com:http ::ffff:184.167.249.24:38065 TIME_WAIT -
tcp 0 0 www.m-l-z.com:http ::ffff:184.167.249.24:38060 TIME_WAIT -
tcp 0 6624 www.m-l-z.com:rockwell-csp2 ::ffff:184.167.249.24:35028 ESTABLISHED 8060/0
tcp 0 0 www.m-l-z.com:http ::ffff:184.167.249.24:38107 TIME_WAIT -
tcp 0 0 www.m-l-z.com:http crawl-66-249-71-206.g:34578 TIME_WAIT -
tcp 0 0 www.m-l-z.com:http ::ffff:184.167.249.24:38080 TIME_WAIT -
tcp 0 0 www.m-l-z.com:http b3091271.crawl.yahoo.:45542 TIME_WAIT -
tcp 0 0 www.m-l-z.com:http ::ffff:184.167.249.24:38140 TIME_WAIT -
tcp 0 0 www.m-l-z.com:http ::ffff:184.167.249.24:38133 TIME_WAIT -
tcp 0 0 www.m-l-z.com:http ::ffff:184.167.249.24:38120 TIME_WAIT -
tcp 0 0 www.m-l-z.com:http ::ffff:184.167.249.24:38116 TIME_WAIT -
tcp 0 0 www.m-l-z.com:http ::ffff:184.167.249.24:38114 TIME_WAIT -

falko
14th July 2011, 20:07
tcp 0 0 *:smtp *:* LISTEN 15868/master Postfix is still listening on port 25.

mlz
15th July 2011, 02:34
It should be listening on both 25 and 26. And the netstat shows that too:


tcp 0 0 *:26 *:* LISTEN 15868/master


But if you telnet there (www.foxysplace.com port 26) there is nothing there.

falko
15th July 2011, 11:44
Sorry, I've overlooked that line...
Is there anything in your mail log when you try to connect on port 26?

mlz
19th July 2011, 04:49
Getting this shortly after I try to connect:


Jul 18 19:45:41 PTY12097D master[3839]: fatal: master_spawn: exec /usr/libexec/postfix/smptd: No such file or directory
Jul 18 19:45:42 PTY12097D postfix/master[15868]: warning: process /usr/libexec/postfix/smptd pid 3839 exit status 1
Jul 18 19:45:42 PTY12097D postfix/master[15868]: warning: /usr/libexec/postfix/smptd: bad command startup -- throttling

mlz
6th August 2011, 01:11
I'm guessing no one knows how to fix this...

falko
6th August 2011, 13:01
Unfortunately I have no idea... :(

mlz
6th August 2011, 19:13
Thanks for your help. I guess I can try posting on the Postfix mail list and see if I find out anything.