LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-29-2009, 06:25 PM   #1
advolente
LQ Newbie
 
Registered: Mar 2009
Posts: 9

Rep: Reputation: 0
Hope this is the right way to form this question...


netstat -tna gives the following output (concat)

Code:
tcp        0      0 127.0.0.1:4011              0.0.0.0:*                   LISTEN
So I think that is saying that interface 127.0.0.1 is listening on port 4011..which is almost, i think, what I need to be happening.

I am trying to set up an email server for my website, so that oscommerce is able to send out it's emails etc, etc. My isp (comcast) blocks smtp port so to work around that I'm using a different port. Yesterday when I did a port scan of my external IP address and scanned port 4011 i got that it was open and responding, today that is not the case. So I did a netstat and the preceding output is what I got.

so i'm assuming that I cannot get to that port because my internal ip address mapped to my external ip via my router is not connect with this port 4011, so I cannot telnet to it and consequently it cannot send messages to the outside world.

Is there a way to have this port listening on a different interface (192.168.1.2 exactly)

Thank you for any help and sorry if this question is ridiculous, I'm not sure how to even form it or if this is the way to go about getting done what I need done. I'm not entirely a linux newbie but I am fairly inexperienced in this type of stuff.

By the way I'm using Postfix for email service if that is relevant.

thank you again

Ken
 
Old 03-29-2009, 06:54 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Add a p to your netstat parameters. That will show you the program that is using the socket.
Quote:
# netstat -tnap
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 3766/cupsd
This shows that the cupsd daemon is listening on port 631. Be sure to use the root account or sudo to issue the command.

Last edited by stress_junkie; 03-29-2009 at 06:55 PM.
 
Old 03-29-2009, 08:14 PM   #3
advolente
LQ Newbie
 
Registered: Mar 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by stress_junkie View Post
Add a p to your netstat parameters. That will show you the program that is using the socket.

This shows that the cupsd daemon is listening on port 631. Be sure to use the root account or sudo to issue the command.
Code:
tcp        0      0 127.0.0.1:4011              0.0.0.0:*                   LISTEN      3773/master         
         
tcp        0      0 127.0.0.1:465               0.0.0.0:*                   LISTEN      3773/master
I'm using postfix and the config file name is master.cf so I think that is why it says master is using it?

But it looks like this is using two different ports?
 
Old 03-30-2009, 12:00 PM   #4
advolente
LQ Newbie
 
Registered: Mar 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by stress_junkie View Post
Add a p to your netstat parameters. That will show you the program that is using the socket.

This shows that the cupsd daemon is listening on port 631. Be sure to use the root account or sudo to issue the command.
I know what program is listening on that port. I guess this is a Postfix question. How do I change postfix listening on that port at 127.0.0.1 to listening at 192.168.1.2 on the port?

k
 
Old 03-30-2009, 12:46 PM   #5
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
I've never set up an MTA so I don't know how to configure one. Maybe someone who knows how to configure Postfix can jump in here, or you could read the user manual.

http://www.postfix.org/
 
Old 03-30-2009, 01:08 PM   #6
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,231
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
Yes that would be your postfix process.

Code:
mail:~# netstat -lanp | grep :25
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN     21301/master
but why not just just configure postfix to use your ISP's mail server as a relayhost ?


http://www.postfix.org/BASIC_CONFIGU...html#relayhost
Quote:
What delivery method: direct or indirect

By default, Postfix tries to deliver mail directly to the Internet. Depending on your local conditions this may not be possible or desirable. For example, your system may be turned off outside office hours, it may be behind a firewall, or it may be connected via a provider who does not allow direct mail to the Internet. In those cases you need to configure Postfix to deliver mail indirectly via a relay host.

Examples (specify only one of the following):
Code:
    /etc/postfix/main.cf:
        relayhost =                   (default: direct delivery to Internet)
        relayhost = $mydomain         (deliver via local mailhub)
        relayhost = [mail.$mydomain]  (deliver via local mailhub)
        relayhost = [mail.isp.tld]    (deliver via provider mailhub)

Last edited by farslayer; 03-30-2009 at 01:09 PM.
 
Old 03-30-2009, 04:28 PM   #7
advolente
LQ Newbie
 
Registered: Mar 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by farslayer View Post
Yes that would be your postfix process.

Code:
mail:~# netstat -lanp | grep :25
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN     21301/master
but why not just just configure postfix to use your ISP's mail server as a relayhost ?


http://www.postfix.org/BASIC_CONFIGU...html#relayhost
I realize that relaying via your ISP is easier but it's also not without conditions, of which I am not willing to live with. They put a very strict and very low limit on the amount of emails you can send, a limit I do not even come close to approaching on a day to day basis but exceed on a quarterly basis when I do my contact list emails for my business. In the past I have had to spread them out over several days or pay another company to do them for me and this is my attempt to do them myself and save some money.

So my netstat says postfix is running and it's listening on all interfaced on port 4011. That being the case why do I continue to receive cannot connect port 25 errors when sending emails to myself?

Thank you for your replies.

Ken
 
Old 03-30-2009, 05:06 PM   #8
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,231
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
You keep saying you get the error can't connect to port 25 but you never state where this error appears..

What you are doing to when the error shows up?
Does it appear on the Screen ?
Is it in some log file ?
you need to provide more info.

For all I know your Mail Client is trying to connect to to the mail server via the standard port (25)..






I would get a new ISP.. Yours sounds horrendous for a business, blocking ports limiting email. not very conducive to business needs.
 
Old 03-30-2009, 05:17 PM   #9
advolente
LQ Newbie
 
Registered: Mar 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by farslayer View Post
You keep saying you get the error can't connect to port 25 but you never state where this error appears..

What you are doing to when the error shows up?
Does it appear on the Screen ?
Is it in some log file ?
you need to provide more info.

For all I know your Mail Client is trying to connect to to the mail server via the standard port (25)..
I used evolution to send the internal message and I've used Webmin to send emails using the Postfix module. The error shows up in the Postfix Mail Queue screen of webmin.

Code:
    	Mail ID    	Sent    	From    	To    	Size    	Status   
	6778011B60BF 	2009/03/30 15:10 	owner@*********.com 	*******@yahoo.com 	435 bytes 	connect to mail.*******.com[x.x.x.x]:25: Connection refused
	B851B11B60C4 	2009/03/30 15:11 	owner@*********.com 	root@*********.com 	434 bytes 	connect to mail.*********.com[x.x.x.x]:25: Connection refused
Here is the exact error message. The same thing happens whether sending to an internal user (owner@*********.com) or external email address (*********@yahoo.com). I get the same connection refused error. Is there a way to test sending emails from commandline in postfix?

Quote:
I would get a new ISP.. Yours sounds horrendous for a business, blocking ports limiting email. not very conducive to business needs.
I'm locked into my contract with them for another year so that unfortunatley isn't an option. Hopefully I can get this to work.

I appreciate the help you've given.

Ken

Last edited by advolente; 03-30-2009 at 05:18 PM.
 
Old 03-30-2009, 05:53 PM   #10
advolente
LQ Newbie
 
Registered: Mar 2009
Posts: 9

Original Poster
Rep: Reputation: 0
I sent an email from commandline by telneting to my mail.domain.com 4011.

Here is the maillog output for that session. Hopefully this may shed some light on something.

Code:
Mar 30 15:37:10 domain postfix/smtpd[6131]: connect from localhost.localdomain[127.0.0.1]
Mar 30 15:38:35 domain postfix/smtpd[6131]: 78AD111B60C6: client=localhost.localdomain[127.0.0.1]
Mar 30 15:39:15 domain postfix/cleanup[6152]: 78AD111B60C6: message-id=<20090330223835.78AD111B60C6@mail.domain.com>
Mar 30 15:39:15 domain postfix/qmgr[4049]: 78AD111B60C6: from=<Owner@domain.com>, size=394, nrcpt=1 (queue active)
Mar 30 15:39:15 domain postfix/smtp[6162]: warning: numeric domain name in resource data of MX record for domain.com: x.x.x.x
Mar 30 15:39:15 domain postfix/smtp[6162]: connect to x.x.x.x[x.x.x.x]:25: Connection refused
Mar 30 15:39:15 domain postfix/smtp[6162]: connect to mail.domain.com[x.x.x.x]:25: Connection refused
Mar 30 15:39:15 domain postfix/smtp[6162]: 78AD111B60C6: to=<root@domain.com>, relay=none, delay=61, delays=61/0.01/0.01/0, dsn=4.4.1, status=deferred (connect to mail.domain.com[x.x.x.x]:25: Connection refused)
Mar 30 15:39:54 domain postfix/smtpd[6131]: disconnect from localhost.localdomain[127.0.0.1]
So to recap, this is me sending an email from Owner@domain.com to root@domain.com from the mail server after telneting into localhost on port 4011. There were no errors given during the telnet session, this is all from the log file.

I've edited out my domain and ip information.

Thank you

Ken
 
Old 03-31-2009, 09:19 PM   #11
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,231
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
Since you are obscuring the domain and IP info it's hard to tell exactly what is going on..

My best guess is that your ISP only allows connections on Port 25 (SMTP) to it's own Email server, and will not allow you to send from your mail server directly to any other mail server. The reason that is done is to prevent spamming and SPAM worms on Windows boxes from inundating the internet with Junk.

If that's the case then using the relay host as I suggested earlier may be your only option.

Alternately a Mail server is going to try and deliver mail to Port 25, so by running your mail server on port 4011, no-one can deliver to you.

Last edited by farslayer; 03-31-2009 at 09:20 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple Question (I hope) jon3k Linux - General 3 04-13-2005 02:51 PM
Quick (I hope) mdkkdm question stunter Mandriva 0 06-07-2004 10:49 PM
LILO question (I hope this is a little advanced) netstv Programming 1 05-25-2004 06:39 AM
Simple grep question - I hope ! MiguelE Linux - Newbie 3 04-16-2004 08:46 AM
I hope this is not such a stupid question! angmaya Linux - Newbie 3 10-17-2003 11:59 PM


All times are GMT -5. The time now is 03:50 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration