[Resolved] SMTPSendMail> problem with wireless router

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

[Resolved] SMTPSendMail> problem with wireless router

Post by jpuziano » Sat Mar 21, 2009 10:07 pm

Hi All,

The SMTPSendMail> command works fine in a script running on my home PC with just the DSL modem.

However when I hookup a wireless router (LinksysWRT300N) between the DSL modem and the PC, the SMTPSendMail> command always fails with the following error: "unable to connect to server"

After some Googling, I believe the router is blocking the SMTP traffic so to fix this, I tried setting up Port Forwarding on the wireless router, following the instructions here:

http://portforward.com/english/routers/ ... R/SMTP.htm

which required setting up a static ip first, instructions here:

http://portforward.com/networking/static-xp.htm

However I still cannot get it to work.

Is anyone out there successfully using the SMTPSendMail> command on a PC from behind a wireless router?

If so, can you tell us how to configure the router to make this work?

Marcus, any help here?
Last edited by jpuziano on Sun Mar 29, 2009 1:18 am, edited 1 time in total.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sat Mar 21, 2009 10:31 pm

I am using a XP PRO behind a Linksys wireless router (WAP 11) to Linksys router (BEFVP41) to cable modem every day with SMTPl. Send me some script to run here for you.

I just used the sample script Send Email Example to send email to myself and it worked fine. I had to add three lines because I need authorization. And my Zone Alarm firewall allowed the outgoing emails which I had given permissions to. Nothing unexpected, all was fine. Received the email in about 5 seconds. The send from and recipient addresses were different.

Port Forwarding should have nothing to do with SMTP emails. It is usually set up to allow remote access to specific computer IPs in you internal network. I use it at many sites to connect to specific computers with Remote Admin, UltraVNC, pcAnyWhere, and Remote Desktop.

You might want to check firewall settings on your router. Try to disable the router's firewall first. If that fixes it, then you may need to enable the firewall again and open the ports for email. Normal port for SMTP is 25, and sometimes 587. These will need to be opened if you enable your firewall. If you disable the firewall, then you can use software firewalls instead. That is how I use ZoneAlarm.
Last edited by Bob Hansen on Sat Mar 21, 2009 11:58 pm, edited 1 time in total.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Sat Mar 21, 2009 11:35 pm

I'll second Bob's comments. I can run the same SMTP scripts via wifi (WRT54GS router) or via hardwired connection on the same XP laptop with no differences. It may be a firewall set up issue in your router but port forwarding isn't relevant.

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Sun Mar 22, 2009 12:15 am

Hi Bob and Me_again,

Firewall issue with the router? Here are my router security settings and what I changed them to for a test.

In the Security/Firewall tab I have...
Firewall:
SPI Firewall Protection: enabled (I changed it to disabled)

Internet Filter:
- Filter Anonymous Internet Requests: checked (I unchecked it)
- Filter Multicast: unchecked
- Filter Internet NAT Redirection: unchecked
- Filter IDENT (Port 113): unchecked

Web Filter:
- Proxy: unchecked
- Java: unchecked
- ActiveX: unchecked
- Cookies: unchecked
Unfortunately this made no difference, I still get:

Result of SendMail: Unable to connect to server

I don't have ZoneAlarm installed on this PC and would like to find a solution without having to install it... it seems to me it should be possible... just need some way to get the router to allow the SMTP traffic.

Me_again, are you also using ZoneAlarm like Bob?
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sun Mar 22, 2009 12:26 am

Just a bunch of questions off the top of my head, no particular order ......

Do you know the IP of the smtp email server? Can you ping to it?

Can you remove wireless router, make direct cable connection to DSL modem and confirm it still works without wireless router?

Can you ping to the email server IP with the wireless router removed? Can you ping when wireless is connected? Check the routing path.

Does the wireless router have a hard cable connection? Does that work, but the wireless connection does not?

Check the Gateway and DNS settings on the laptop and on the wireless router. Do you still have the DSL modem as the gateway/DNS on your laptop, may need to change them to the wireless router and set the router gateway and DNS to the DSL router.

You can ignore ZoneAlarm (ZA). That is what I use for firewall, have Windows firewall and router firewalls disabled. You can use any firewall you choose, but it must enable the IP and ports of the new wireless router. No need to consider installing ZA.

Try the SMTP command and define the port as 25.
Try it again and define the port as 587 instead.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Sun Mar 22, 2009 2:28 am

Yes, I am using Zone Alarm but I don't think it matters. Pretty much the same suggestions as Bob, try pinging the name of the smtp server from the XP command prompt, smtp.whatever, even if it doesn't respond to the ping (some servers have ping disabled) you should see if the PC is able to get an IP address and therefore routing for it. Also I don't know your router but in my linksys you can ping from the router admin itself, so that's another test. If ping works from the router but not the PC then that's a big clue.

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Sun Mar 22, 2009 4:40 am

Thanks Bob for the ping suggestion.
Me_again wrote:Yes, I am using Zone Alarm but I don't think it matters. Pretty much the same suggestions as Bob, try pinging the name of the smtp server from the XP command prompt, smtp.whatever, even if it doesn't respond to the ping (some servers have ping disabled) you should see if the PC is able to get an IP address and therefore routing for it. Also I don't know your router but in my linksys you can ping from the router admin itself, so that's another test. If ping works from the router but not the PC then that's a big clue.
Thanks Me_again for the above... ping results were:
from XP command prompt wrote:Pinging smtp.aaa.aaa [nnn.nnn.nnn.nnn] with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for nnn.nnn.nnn.nnn:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
from inside router wrote:PING smtp.aaa.aaa (nnn.nnn.nnn.nnn): 32 data bytes

--- smtp.aaa.aaa ping statistics ---

5 packets transmitted, 0 packets received, 100% packet loss
It responds about the same way when pinged from the XP command prompt as from the router... no pings are returned... appears dead... however it does resolve to an ip address so perhaps ping is disabled for that smtp server.

I also tried a traceroute from the router:
traceroute wrote:traceroute to smtp.aaa.aaa (nnn.nnn.nnn.nnn), 30 hops max, 40 byte packets

1 aaaaaannnna-aann-aan.aaa.aaa (nnn.nnn.nnn.nnn) 9.808 ms 8.550 ms 8.806 ms

2 aaaaaannnna-aann-annn.aaa.aaa (nnn.nnn.nnn.nnn) 10.257 ms 9.286 ms 9.026 ms

3 * * * Request timed out.

... same story all the way down...

30 * * * Request timed out.
Then I Googled to find some free smtp mail servers out there... found a listing and tried using smtp.mail.yahoo.com for my smtp server in my SMTPSendMail> command with exactly the same results... "unable to connect to server"... though it looks fine when you ping it:
ping smtp.mail.yahoo.com wrote:Pinging smtp.plus.mail.fy4.b.yahoo.com [69.147.102.58] with 32 bytes of data:

Reply from 69.147.102.58: bytes=32 time=56ms TTL=56
Reply from 69.147.102.58: bytes=32 time=56ms TTL=56
Reply from 69.147.102.58: bytes=32 time=55ms TTL=56
Reply from 69.147.102.58: bytes=32 time=55ms TTL=56

Ping statistics for 69.147.102.58:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 55ms, Maximum = 56ms, Average = 55ms
Replies to Bob's questions below:
Bob Hansen wrote:Just a bunch of questions off the top of my head, no particular order ......

Do you know the IP of the smtp email server? Can you ping to it?
ping results above
Bob Hansen wrote:Can you remove wireless router, make direct cable connection to DSL modem and confirm it still works without wireless router?
Removed the router, made direct cable connection from PC to DSL modem, fired up PC and could not connect to the internet period. At that point I suppose I'd have had to change some settings in Windows for the tcpip connection... add the dns servers.. etc. etc... didn't bother, put the router back in... connection to the internet back to normal (so to speak).
Bob Hansen wrote:Can you ping to the email server IP with the wireless router removed? Can you ping when wireless is connected? Check the routing path.
see results above.
Bob Hansen wrote:Does the wireless router have a hard cable connection? Does that work, but the wireless connection does not?
Not worried about the wireless connection actually... just trying to make this work on a PC that is directly connected to the wireless router.
Bob Hansen wrote:Check the Gateway and DNS settings on the laptop and on the wireless router. Do you still have the DSL modem as the gateway/DNS on your laptop, may need to change them to the wireless router and set the router gateway and DNS to the DSL router.
Again, no laptop in the picture, just a PC directly connected to the router.
Bob Hansen wrote:You can ignore ZoneAlarm (ZA). That is what I use for firewall, have Windows firewall and router firewalls disabled. You can use any firewall you choose, but it must enable the IP and ports of the new wireless router. No need to consider installing ZA.
OK... holding off on that idea.
Bob Hansen wrote:Try the SMTP command and define the port as 25.
Try it again and define the port as 587 instead.
I assume you mean add one of the following lines to the script:

//Let>SMTP_PORT=25
Let>SMTP_PORT=587

I added these and commented out either one or the other. Ran the script but still no connection... though it fails differently. With port 25 it immediately tells me no connection but when using 587, it takes quite a while before it finally tells me the same thing.

I noticed my Windows firewall was on. I opened up port 25, didn't help, I opened up port 587, didn't help, I turned off Windows firewall completely, didn't help.

Thoughts?
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sun Mar 22, 2009 3:43 pm

Sorry, I probably was not clear in some of the tests I suggested. But you helped me when you said you were not concerned about a laptop/wireless connection. You are dealing with a PC only.

Let me recap test environment and results:
PC cable connected to DSL modem sends SMTP with no problem.
PC cable connected to Linksys wireless modem with cable connected to DSL modem does not send SMTP.
---------------------------------------
Even though you will need to make changes to Gateway and DNS, I would suggest again, in this sequence. Thanks to Me_again for suggesting ping from wireless router.
Have all firewalls disabled.
1. PC connected to DSL, ping a known email SMTP server.
2. PC connected to Wireless cabled to DSL, ping the same SMTP from the router.
3. PC connected to Wireless cabled to DSL, ping the same SMTP from the PC.

If any of those three tests fail, stop and immediately fix that problem. If any test fails, then the higher number test cannot succeed. I suspect that the GW/DNS settings are not correct on the PC and/or Wireless modem.

It is also possible that the IPs, are not correct from DHCP settings. I usually disable the router DHCP feature and use static IP addresses internally. Assign 192.168.100.1 to wireless router, assign 192.168.100.11 to the PC. All using the same subnet 255.255.255.0 Make sure that GW and DNS numbers correspond with the static IPs.
Last edited by Bob Hansen on Sun Mar 22, 2009 7:19 pm, edited 1 time in total.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Sun Mar 22, 2009 3:52 pm

You can't use smtp with a free yahoo account, only the $20 plus accounts, but if you try this script using a free account you will get an auth failure, not an smtp connection failure which will show if you are connecting to the server so it is worth making the test.

(Oh, I have 9.1, not sure if smtp has changed.)

Code: Select all

Let>SMTP_AUTH=1
Let>SMTP_USERID=someuser
Let>SMTP_PASSWORD=someword
Let>SMTP_PORT=587
//Let>SENDMAIL_STATUS=0
Let>[email protected]
Let>myname=Me Again
Let>subject=This is a Test
Let>body=This is only a Test
Let>[email protected]
SMTPSendMail>recipients,smtp.mail.yahoo.com,me,myname,subject,body,
Message>Result of SendMail: %SMTP_RESULT%

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Sun Mar 22, 2009 4:39 pm

Me_again wrote:You can't use smtp with a free yahoo account, only the $20 plus accounts, but if you try this script using a free account you will get an auth failure, not an smtp connection failure which will show if you are connecting to the server so it is worth making the test.

(Oh, I have 9.1, not sure if smtp has changed.)

Code: Select all

Let>SMTP_AUTH=1
Let>SMTP_USERID=someuser
Let>SMTP_PASSWORD=someword
Let>SMTP_PORT=587
//Let>SENDMAIL_STATUS=0
Let>[email protected]
Let>myname=Me Again
Let>subject=This is a Test
Let>body=This is only a Test
Let>[email protected]
SMTPSendMail>recipients,smtp.mail.yahoo.com,me,myname,subject,body,
Message>Result of SendMail: %SMTP_RESULT%
I ran this script exactly as above and yes, it comes back with a different error "535 authorization failed (#5.7.0)" not the familiar "unable to connect to server"... so it looks like I am indeed connecting to the server.

So would I be correct to assume at this point that settings on my PC/router/DSL Modem must be OK and my ISP's smtp mailserver may have issues?
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Sun Mar 22, 2009 5:01 pm

jpuziano wrote:I ran this script exactly as above and yes, it comes back with a different error "535 authorization failed (#5.7.0)" not the familiar "unable to connect to server"... so it looks like I am indeed connecting to the server.

So would I be correct to assume at this point that settings on my PC/router/DSL Modem must be OK and my ISP's smtp mailserver may have issues?
That would be my conclusion, you could try a test changing the server name to e.g. yaho instead of yahoo and that should provoke the server error.

Not all ISP's allow their servers to be used this way (anti abuse/spammer reasons) so it may not be a "problem" as such. Sometimes they only allow it from IP's on their network.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sun Mar 22, 2009 7:18 pm

I agree that your SMTP server may be having problems, but I would expect to see the same results when tried from your PC connected to DSL and/or connected to the router.

That is why I was trying to help isolate the server from the PC from the router. Try to locate a known good SMTP server that you can get authorization to log into. Do the testing on that server.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Mon Mar 23, 2009 3:45 pm

It was quite some time ago, a couple months, that the smtp mail server associated with my DSL internet account stopped working for me from home with the STMPSendMail> command.

The STMPSendMail> command still works fine from work where I use a different smtp mail server... so I have no issues with the STMPSendMail> command itself.

Thinking about it, it doesn't make sense that the ISP's smtp mail server could be down for that long... people would complain and it would be fixed.

Its not answering a ping but like you say Me_again... that could be on purpose for anti abuse/spammer reasons.

Along the same lines... perhaps its now also checking the "from_address" parameter to validate that the request came from my email address with this ISP... which is associated to my DSL account.

But that's not the "from_address" I was using in the SMTPSendMail> command... I was using a different email address in there... one that I use more often.

It used to work fine that way but then it stopped working... perhaps that's why... things tightened up for anti abuse/spammer reasons.

I'll check it out and post back later. Thanks for all your help Bob and Me_again, much appreciated.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Mar 23, 2009 3:52 pm

Who is your ISP? Some ISPs - comcast is a well known example - block traffic on port 25 unless it is via their SMTP server. If you are the admin for the SMTP server, make it listen on a different port. I know that this trick works for comcast as we had to do it so that Paul could send mail via mjtnet.com from home.

It may also need authentication (SMTP_AUTH) and/or pop auth where you must POP to collect mail before you can send. I would be very surprised if the mail server is open without any form of authentication.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Sun Mar 29, 2009 1:17 am

The problem is solved. Bob and Me_again, you were right, nothing to do with port forwarding... it was a firewall issue just as you suspected.

I use McAfee and had fixed an issue long ago with port 25 (I even had a comment inside the macro that mentioned what I did) so I didn't dig in to the settings in McAfee until I had tried just about everything else.

What I didn't remember is that on this PC, this wasn't the same installation of McAfee... this is a newer one... and I needed the same fix again! :oops:

To make sure I never forget, I'm including the following steps as comments in the macro. Perhaps they might be helpful to another user who installs McAfee and has problems with the SMTPSendMail> command:
comments added to my macro wrote: using McAfee VirusScan Enterprise 8.0.0

In the VirusScan Console, right click on "Access Protection" then click Properties.

Access Protection Properties Ports

checked - Prevent mass mailing worms from sending mail 25

select the above and click Edit button

First Port: 25

Direction - Outbound - prevent local processes from accessing these ports on the network.

Excluded Processes

Enter one or more process names which will not be affected by this rule.
Separate multiple process names with commas.

amgrsrvc.exe,tomcat.exe,outlook.exe, and a whole bunch more...

add MSCHED.EXE to the above list, Apply and it will work
Thanks Marcus for the suggestions and a big thanks to Bob and Me_again for the extensive help in troubleshooting this... points to you both.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts