Connecting to remote SMTP mail server

  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8922
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post September 7th, 2012, 3:04 pm

So it sounds like the connection to the servers are there. I do think this is a firewall problem then. Most websites will allow you to connect port 25 inbound, but not necessarily the other way around which explains why it works for you when you test from your local machine.

When you test from your local machine to port 25 on any server you are inbound to that server, and thus their firewalls are likely allowing it.

However, when you do it from server to server, you are inbound on one and outbound on the other. The firewalls on each server are likely blocking outbound port 25, but allowing inbound port 25. So the only way around this would be either to change the firewall settings, or to use a different port that you can go outbound on.

This is very common, as you can see here for example:

https://csguide.cs.princeton.edu/email/ ... =node%2F86

Quote:
By blocking outbound packets on port 25/tcp, we limit the ability of compromised hosts on our network to send out unsolicited bulk e-mail to other sites.


What you might want to do to confirm this is to e-mail each host and ask them if they block port 25 outbound, make sure you get someone who actually knows the answer too.

Hope that helps identifying the problem, maybe it will get you going in the right direction to find a solution :)
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post September 7th, 2012, 3:04 pm

  • wpas
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jul 12, 2010
  • Posts: 214
  • Loc: Canada
  • Status: Offline

Post September 7th, 2012, 5:28 pm

I used a script myself to check that port 25 was open on both websites and it was.

A couple of posts back I indicated that the following url

http://www.checktls.com/perl/TestReceiver.pl?FULL

could access both mx hosts on port 25 with no problem.

I do not think port 25 is the problem
http://www.schembrionics.com
The Ultimate Solutions Center
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8922
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post September 8th, 2012, 1:15 pm

That script is testing for port 25 inbound though on both servers, not outbound. I believe that site only checks for one direction.
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • wpas
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jul 12, 2010
  • Posts: 214
  • Loc: Canada
  • Status: Offline

Post September 8th, 2012, 2:44 pm

checking inbound is basically what I want.

I want to be able to verify emails like they do.

I have a script that when someone registers on my site, I check for proper syntax and that an MX mail domain exists.

As a last test, I want to connect to the smtp server to see if it actually exists.

I realize that some smtp servers accept all email and then dispose of them later so this is not as good as actually sending an email and waiting for a response.

This is the basic reason why I need to connect to remote smtp servers.

I was using my websites as testing sites but could not connect to them inbound as the website I mentioned does.

I have not used perl scripts but I read somewhere that you can also connect to smtp servers via some smtp script. I wonder if this might help.

The only problem is I never worked with perl scripts and so I am not sure I could figure it out with weeks of learning how perl works.
http://www.schembrionics.com
The Ultimate Solutions Center
  • wpas
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jul 12, 2010
  • Posts: 214
  • Loc: Canada
  • Status: Offline

Post September 12th, 2012, 12:16 pm

I have not seen any further responses.

Does this mean I am out of luck
http://www.schembrionics.com
The Ultimate Solutions Center
  • Zealous
  • Guru
  • Guru
  • User avatar
  • Joined: Apr 15, 2011
  • Posts: 1192
  • Loc: Sydney
  • Status: Offline

Post September 12th, 2012, 1:20 pm

this is the 3rd week..... lol

idk what else to do with it really
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8922
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post September 12th, 2012, 1:55 pm

I really believe you should contact your web host and ask them how their firewall is setup, and if inbound or outbound port 25 is blocked. I believe at this time you still don't know that answer as you are only able to test one direction with that website resource you listed, and it makes it hard to figure out exactly the cause to your issue. If one direction is blocked, then my advice would be to use a different web host, or find a way to use a different port that has both inbound and outbound open. I think you will have this same problem no matter what language your script is in, whether it is PHP or PERL.
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • wpas
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jul 12, 2010
  • Posts: 214
  • Loc: Canada
  • Status: Offline

Post September 12th, 2012, 4:03 pm

When I do use the website resource I mentioned I can communicate with both SMTP servers on both websites and I do get responses back from each server when I connect and then use the standard HELO, MAIL FROM, RCPT TO, RSET and QUIT commands. The servers respond to each command I send.

If port 25 were blocked, I would expect not to get any responses back.

I must therefore assume that port 25 is not blocked.

Unless I am not thinking correctly here.
http://www.schembrionics.com
The Ultimate Solutions Center
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8922
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post September 12th, 2012, 4:37 pm

That is only for inbound on port 25 though. The test that you are running is from another server that is trying to connect to port 25 on your servers and your server responds to that request (as it is an inbound connection and allowed). You are not testing going outbound on port 25 originating from your server, so that is different. It is possible to have a port open in one direction and not the other direction. Many hosts do block outbound on port 25 and leave inbound port 25 open which lets them receive mail. The reason they block outbound is to try and prevent spam from originating from their servers. Many hosts will require outbound to be on other ports besides port 25 if they allow it. This is why I recommend contacting your webhosts to see how they have things configured as this can at least give you the information we need to help you further here and if we can rule this out or not. At the moment it still seems like the likely problem to me.

Hope that makes sense :)
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8922
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post September 12th, 2012, 4:47 pm

Here is a simple PHP script that you can use to test if a port is open or closed, maybe this can help:

PHP Code: [ Select ]
$fp = fsockopen('127.0.0.1', 25, $errno, $errstr, 5);
if (!$fp) {
    // port is closed or blocked
} else {
    // port is open and available
    fclose($fp);
}
  1. $fp = fsockopen('127.0.0.1', 25, $errno, $errstr, 5);
  2. if (!$fp) {
  3.     // port is closed or blocked
  4. } else {
  5.     // port is open and available
  6.     fclose($fp);
  7. }
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • wpas
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jul 12, 2010
  • Posts: 214
  • Loc: Canada
  • Status: Offline

Post September 12th, 2012, 8:27 pm

I used your script and changed it to echo a message back.

On both websites port 25 is open and available.

Actually, I had also used a similar script to check port 25 which was found to be open and available on both websites.
http://www.schembrionics.com
The Ultimate Solutions Center
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8922
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post September 12th, 2012, 10:49 pm

Awesome, so that confirms inbound does work like you mentioned. Now let's check to see if outbound works. Go ahead and modify your script to instead of using '127.0.0.1', use: '67.18.182.194'. That is Ozzu's mail server, and everyone who send's mail to ozzu would connect to that IP address. If your script passes that test, then that confirms you are open on port 25 both inbound and outbound. Let me know the results when you get a chance :)
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • wpas
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jul 12, 2010
  • Posts: 214
  • Loc: Canada
  • Status: Offline

Post September 13th, 2012, 6:15 am

I modified the script to include the OZZU mail server and put it on both websites.

Each website was not able to connect to your mail server.
Got error 110, Connection Timed Out in both cases.

But this is the problem I have been enquiring about in this thread.
I can connect locally, but not remotely.
http://www.schembrionics.com
The Ultimate Solutions Center
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8922
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post September 13th, 2012, 12:19 pm

Yeah I suppose it is, guess that just re-confirms the problem.

You really just need to contact your webhosts now and confirm they are blocking outbound port 25, and if they have any work-arounds for that. Some hosts just do not allow you to send mail from there servers, and if that is the case you are going to be out of luck and need to find a new host. They may also have an alternate server that you can send mail out of. Please contact them and see what they say.
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • wpas
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jul 12, 2010
  • Posts: 214
  • Loc: Canada
  • Status: Offline

Post September 13th, 2012, 7:33 pm

I still do not understand the problem.

I do not want to send emails. I only want to try to validate an email address.

You indicated previously that with the web source I was using:

"That is only for inbound on port 25 though. The test that you are running is from another server that is trying to connect to port 25 on your servers and your server responds to that request (as it is an inbound connection and allowed). "

This is really all I want to do.
So if inbound is allowed why can I not connect to the server.
If outbound is for sending emails, I do not want to send emails.

Am I missing something
http://www.schembrionics.com
The Ultimate Solutions Center
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post September 13th, 2012, 7:33 pm

Post Information

  • Total Posts in this topic: 56 posts
  • Users browsing this forum: Kurthead+1 and 162 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.