Current time: 12-23-2024, 11:55 PM Hello There, Guest! (LoginRegister)


Post Reply 
[SOLVED]Cannot connect to SMTP remotely
Author Message
brianhill1980 Offline
Junior Member
*

Posts: 21
Joined: Feb 2009
Reputation: 0
Post: #1
[SOLVED]Cannot connect to SMTP remotely
Hi there,

I'm having a bit of a time getting my SMTP server running. I'm using Postfix.

The problem I'm having is remote clients cannot send mail through the server even though they have a valid email address on the server.

Things I can do:
- ping server's ip
- ping server's domain
- Receive IMAP messages using webmail and software
- Send mail through webmail
- Use ssh to connect to server then telnet into SMTP server

Things I CAN'T do:
- telnet into SMTP server for testing from remote pc
- Send mail using software on remote pc (Mail.app, Thunderbird, Outlook, iPhone)

Problems encountered:
- When I try to telnet into the server from a remote computer (telnet brianhillphotography.ca 25) it times out. When I try to telnet from an ssh terminal connected to the server it works.
- Trying to send mail from anywhere but the webmail results in an error saying the server could not be contacted.

Things I've tried:
- Checked configuration of main.cf and master.cf. Settings look to be correct.
- Ran 'dpkg-reconfigure postfix'. Same issue's occuring.


I have a firewall running on the server, but TCP port 25 is open. I've also tried disabling the firewall and I get the same result. Not able to connect. It's like Postfix is rejecting any connections from remote addresses, but I can't figure out why.

Any help would be appreciated. Thanks!
(This post was last modified: 07-28-2009 12:30 PM by brianhill1980.)
07-26-2009 12:56 AM
Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #2
RE: Cannot connect to SMTP remotely
First of all, check that postfix is listening in your public address (or all of them-0.0.0.0) using netstat:
Code:
netstat -tlnp

If it's running, try to connect and check the logs for further info:
Code:
tail /var/log/mail.log

The error should show up there. In the case that no connection is shown, something happens with the network. Check if the port is really open using netcat:
Code:
intheserver: /etc/init.d/postfix/stop
intheserver: nc -lp 25   (the command doesn't return)
inyourmachine: echo 'hi' | nc ip.of.the.server 25
"hi" should show up in the server's shell, otherwise it's a network/firewall issue.

Post the results from these tests and let's see if we can identify what's happening Smile

PS: It's great when someone takes it's time to create correct problem descriptions, kudos to you for that! On another occasion tough, try to include some basic info that always helps diagnosing problems: OS/Distro/Version, Ispcp version, and relevant log files (mail.log in this case).
(This post was last modified: 07-26-2009 01:14 AM by kilburn.)
07-26-2009 01:11 AM
Visit this user's website Find all posts by this user Quote this message in a reply
brianhill1980 Offline
Junior Member
*

Posts: 21
Joined: Feb 2009
Reputation: 0
Post: #3
RE: Cannot connect to SMTP remotely
Results of netstat:

Quote:Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:60000 0.0.0.0:* LISTEN 2031/postgrey.pid -
tcp 0 0 127.0.0.1:10025 0.0.0.0:* LISTEN 8375/master
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1926/mysqld
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 8375/master
tcp 0 0 127.0.0.1:12525 0.0.0.0:* LISTEN 1990/policyd-weight
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1562/portmap
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 8375/master
tcp 0 0 127.0.0.1:690 0.0.0.0:* LISTEN 2210/famd
tcp 0 0 127.0.0.1:9876 0.0.0.0:* LISTEN 2282/ispcp_daemon
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 2222/proftpd: (acce
tcp 0 0 216.19.176.36:53 0.0.0.0:* LISTEN 1830/named
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 1830/named
tcp 0 0 0.0.0.0:24 0.0.0.0:* LISTEN 1844/sshd
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 8375/master
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 1830/named
tcp 0 0 0.0.0.0:40926 0.0.0.0:* LISTEN 1573/rpc.statd
tcp6 0 0 :::110 :::* LISTEN 2106/couriertcpd
tcp6 0 0 :::143 :::* LISTEN 2088/couriertcpd
tcp6 0 0 :::80 :::* LISTEN 2266/apache2
tcp6 0 0 :::53 :::* LISTEN 1830/named
tcp6 0 0 :::24 :::* LISTEN 1844/sshd
tcp6 0 0 ::1:953 :::* LISTEN 1830/named

I'm guessing it's called 'master'. Seems to be the only service running on port 25.

Trying to send a message this is all that shows up in the logs. It's in both 'mail.log' and 'mail.info'.

Quote:Jul 25 10:15:50 brianhillphotography imapd: Connection, ip=[::ffff:96.48.209.112]
Jul 25 10:15:51 brianhillphotography imapd: LOGIN, user=brian@brianhillphotography.ca, ip=[::ffff:96.48.209.112], port=[56979], protocol=IMAP

I tried that nc thing you told me. Nothing showed up, it eventually timed out.

System Info:
Debian Lenny
APF firewall
IspCP ver. 1.0.0

APF Firewall Rules:
Quote:# Common inbound (ingress) TCP ports
IG_TCP_CPORTS="21,24,25,53,80,110,143,443,993,995,60000"

If there is any other info you need please let me know. Thanks for the help so far.
07-26-2009 04:02 AM
Find all posts by this user Quote this message in a reply
nuke3d Offline
Junior Member
*

Posts: 107
Joined: Sep 2007
Reputation: 1
Post: #4
RE: Cannot connect to SMTP remotely
Is your computer connected via WLAN?
I've had issues with port 25 as well, but only from computers using WLAN... No idea why, maybe the accesspoint filters something on its own.
(This post was last modified: 07-26-2009 06:18 PM by nuke3d.)
07-26-2009 06:17 PM
Find all posts by this user Quote this message in a reply
brianhill1980 Offline
Junior Member
*

Posts: 21
Joined: Feb 2009
Reputation: 0
Post: #5
RE: Cannot connect to SMTP remotely
No. My computer at home is connected via ethernet cable to my netgear router. I have, for the sake of testing purposes, connected my computer directly to my modem. So there is nothing that could be blocking the connection. And as I mentioned, it's also happening on my iPhone using the cellular data service.
07-27-2009 01:34 AM
Find all posts by this user Quote this message in a reply
nuke3d Offline
Junior Member
*

Posts: 107
Joined: Sep 2007
Reputation: 1
Post: #6
RE: Cannot connect to SMTP remotely
I'd guess it's your server provider blocking this port. If it's a home server this might be rather normal. Best contact your ISP about this.
07-27-2009 05:46 PM
Find all posts by this user Quote this message in a reply
brianhill1980 Offline
Junior Member
*

Posts: 21
Joined: Feb 2009
Reputation: 0
Post: #7
RE: Cannot connect to SMTP remotely
I highly doubt that it's my provider. I work for a small ISP, which is where I'm hosting my server, and they don't filter or block any ports. I'll double check, but I'm pretty sure I asked this once already.
(This post was last modified: 07-27-2009 10:55 PM by brianhill1980.)
07-27-2009 10:54 PM
Find all posts by this user Quote this message in a reply
brianhill1980 Offline
Junior Member
*

Posts: 21
Joined: Feb 2009
Reputation: 0
Post: #8
RE: Cannot connect to SMTP remotely
Update:

I brought my laptop into the office and tried to telnet into the SMTP server again. It worked!

So it looks as though the SMTP server is not allowing connections from outside networks. I'll ask the IT guys about it. Is there anything in the Postfix config that would prevent connections from outside networks?

Thanks!
07-28-2009 12:54 AM
Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #9
RE: Cannot connect to SMTP remotely
No, postfix it's not blocking outside connections in your case because netstat shows that it is listening on all interfaces. Even if it was refusing connections, these tries should show up in your mail.log, and according to your previous post there are no connection attemps shown there (you pasted imap-related log lines, not postfix related ones).

Moreover, as the "nc" test you made didn't show anything on the server terminal, I can assure you that there's something blocking the incoming network connections through port 25. It may be a local firewall or the ISP, but surely something is blocking these connections...
(This post was last modified: 07-28-2009 10:54 AM by kilburn.)
07-28-2009 10:52 AM
Visit this user's website Find all posts by this user Quote this message in a reply
brianhill1980 Offline
Junior Member
*

Posts: 21
Joined: Feb 2009
Reputation: 0
Post: #10
Big Grin [SOLVED] RE: Cannot connect to SMTP remotely
Problem Solved.

My ISP, not the ISP the server runs on, blocks port 25 for me. I guess to help prevent spam.

What I was not aware of is that I'm able to connect through port 587 instead of 25 for SMTP authentication.

I changed my port settings in my applications from the default 25 to 587 and presto!

Thanks for all the help guys. I appreciate it. I absolutely love ispCP.
07-28-2009 12:23 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)