LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Hope this is the right way to form this question... (https://www.linuxquestions.org/questions/linux-newbie-8/hope-this-is-the-right-way-to-form-this-question-715349/)

advolente 03-29-2009 06:25 PM

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

stress_junkie 03-29-2009 06:54 PM

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.

advolente 03-29-2009 08:14 PM

Quote:

Originally Posted by stress_junkie (Post 3491978)
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?

advolente 03-30-2009 12:00 PM

Quote:

Originally Posted by stress_junkie (Post 3491978)
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

stress_junkie 03-30-2009 12:46 PM

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/

farslayer 03-30-2009 01:08 PM

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)



advolente 03-30-2009 04:28 PM

Quote:

Originally Posted by farslayer (Post 3492744)
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

farslayer 03-30-2009 05:06 PM

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.

advolente 03-30-2009 05:17 PM

Quote:

Originally Posted by farslayer (Post 3493023)
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

advolente 03-30-2009 05:53 PM

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

farslayer 03-31-2009 09:19 PM

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.


All times are GMT -5. The time now is 12:22 AM.