Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm trying to test smtp connectivity to my postfix configuration and I can telnet to port 25 from the computer itself but cannot from the outside. I get a connection refused error message. What am I doing wrong? I believe my dns is setup correctly as it seems the telnet can hit the box so I'm fairly sure its not that.
I'm trying to test smtp connectivity to my postfix configuration and I can telnet to port 25 from the computer itself but cannot from the outside. I get a connection refused error message. What am I doing wrong? I believe my dns is setup correctly as it seems the telnet can hit the box so I'm fairly sure its not that.
Thanks.
DO the following command, and see if your port 25 is running on 0.0.0.0 or 127.0.0.1, which is wrong (127.0.0.1)
Is postfix listening on your public IP? do: lsof -ni tcp:25. If you only see postfix listening on localhost, you need to configure it to listen on all interfaces instead.
Or you may have a firewall on that is refusing connections, or a router in the way that is not forwarding the port.
Is postfix listening on your public IP? do: lsof -ni tcp:25. If you only see postfix listening on localhost, you need to configure it to listen on all interfaces instead.
Or you may have a firewall on that is refusing connections, or a router in the way that is not forwarding the port.
I don't have any firewall on and it does seem to be listening on localhost only. How do I change it to listen on all interfaces?
Maybe i should add that this is related to the problem I have of only being able to send email and not receive. Perhaps it does have something to do with DNS too?
Why are you trying to telnet to your smtp port? They're completely different services. Telnet is usually listening on port 21.
If you have an MTA listening on port 25 then when you telnet to that port you should see a response. That will tell you if the MTA is listening. This is a widely used test procedure.
Then you make a port 25 connection and not a port 21 connection
You can also telnet to port 22, 80, 110, 143 etc to test and see if your ports are listening etc.
It's axiomatic that someone will always quote your post if you make a simple mistake, so first let me clear up that telnet is port 23, not 21. Port 21 is default for FTP. I always seem to reverse those two, because it seems to me that ssh (port 22) should have come AFTER the unsecured version.
With that said, I was unaware of this trick, which is why I asked the question. It's still more useful to test the connection with the right kind of request, though. All the telnet trick will tell you is that something is listening there, whereas sending a simple smtp message will test that and more.
It's axiomatic that someone will always quote your post if you make a simple mistake, so first let me clear up that telnet is port 23, not 21. Port 21 is default for FTP. I always seem to reverse those two, because it seems to me that ssh (port 22) should have come AFTER the unsecured version.
With that said, I was unaware of this trick, which is why I asked the question. It's still more useful to test the connection with the right kind of request, though. All the telnet trick will tell you is that something is listening there, whereas sending a simple smtp message will test that and more.
Thats an aphorism for sure.
Using telnet to connect to the mail server, will certainly give you more than just an ack that something is listening. It should give an insight into what is going on. Of course, you have to do this once connected:
Code:
HELO
MAIL FROM:someuser@somehwere.com
RCPT TO:someone@gmail.com
DATA
blah blah blah
.
exit
You should see plenty of output while doing this. After that, the logs are a good place to go.
Last edited by szboardstretcher; 03-25-2011 at 09:56 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.