can't mail with WAN clients

HI, I have something very strange going on.

In our office, we have two servers.

100svr02 is our Servoy application server and 100svr04 is our SMTP server (SBS2008)
In the servoy-admin page we only set the smtp host to 100svr04, and we made sure that 100svr02 is allowed to mail with 100svr04

If I start a LAN client (so in the same network) and I send an email, everything works great, the mail is send succesfully
but if I start a WAN client, so for example from my home (the server is behind a NAT, with open ports 80) everything is working fine, but I can’t mail anymore.

So I started some debugging & test & trial and I found out, that when I’m using the http tunnel the mail plugin does not work anymore.

We use profiling, so we have two url’s we can test, one with http tunnel and one with socket tunnel

using http tunneling on the same LAN works
using http tunneling via WAN, it does not work anymore.

using socket tunneling on the same LAN works
using socket tunneling on the same LAN works

I see this error in the servoy-admin page.

2011-01-06 21:42 	RMI TCP Connection(412)-82.73.187.150 	ERROR 	com.servoy.j2db.util.Debug 	SMTPSend Could not connect to SMTP host: 100svr04, port: 25
javax.mail.MessagingException: Could not connect to SMTP host: 100svr04, port: 25; nested exception is: java.net.ConnectException: Connection timed out: connect
     at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1706)
     at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:525)
     at javax.mail.Service.connect(Service.java:291)
     at javax.mail.Service.connect(Service.java:172)
     at javax.mail.Service.connect(Service.java:121)
     at javax.mail.Transport.send0(Transport.java:190)
     at javax.mail.Transport.send(Transport.java:120)
     at com.servoy.extensions.plugins.mail.MailServer.sendMail(Unknown Source)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.lang.reflect.Method.invoke(Unknown Source)
     at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
     at sun.rmi.transport.Transport$1.run(Unknown Source)
     at java.security.AccessController.doPrivileged(Native Method)
     at sun.rmi.transport.Transport.serviceCall(Unknown Source)
     at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
     at java.lang.Thread.run(Unknown Source)
    Caused by: java.net.ConnectException: Connection timed out: connect
     at java.net.PlainSocketImpl.socketConnect(Native Method)
     at java.net.PlainSocketImpl.doConnect(Unknown Source)
     at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
     at java.net.PlainSocketImpl.connect(Unknown Source)
     at java.net.SocksSocketImpl.connect(Unknown Source)
     at java.net.Socket.connect(Unknown Source)
     at java.net.Socket.connect(Unknown Source)
     at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:284)
     at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:227)
     at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1672)
     ... 21 more

so something is going wrong when using http tunneling, and than WAN clients…

we have another server in our hosting center, there the SMTP server is running localhost, and using email on that one, with http-tunnel or sockettunnel is no problem.
The difference there, is that the server is not behind a NAT, but hangs directly with it’s networkcard to the internet.

Hi Harjo,

I wish a happy new year :-)!

How are the network settings in servoy-admin of the 100svr02?

Sounds like a resolve issue to me.

so the only thing (we need to be sure of that) between the 2 profiles is that 1 has the property that it has to use socket and the other that it has to use http?

There is no other change what so ever?

What kind of server is it? Maybe you are running out of tcp connections?

What kind of server is it? Maybe you are running out of tcp connections?

the appliation_server 100svr02 runs on a windows xp layer.
100svr04 is Windows Small Business 2008 server.

running out of tcp connections, is certainly not the issue!!

Yes, one url is using no profile like this:

http://xxx.xx/servoy-client/DirectManager.jnlp
with these settings:
[attachment=2]Schermafbeelding 2011-01-07 om 18.40.32.png[/attachment]

and the other url uses this url (with profile)
http://xxx.xx/servoy-client/tunnel/DirectManager.jnlp
with these settings:
[attachment=1]Schermafbeelding 2011-01-07 om 18.40.44.png[/attachment]
Somehow when I use the the profile url, 100svr02 (servoy application-server) can’t reach 100svr04 no more, when I want to use the mail plugin.
[attachment=0]Schermafbeelding 2011-01-07 om 18.45.09.png[/attachment]

Johan, I can send you the two url’s if you want…

Schermafbeelding 2011-01-07 om 18.40.32.png

oke did some more testing, with other preferences, and I came across that that the hostname was emptyI know filled it with the default 127.0.0.1
[attachment=0]Schermafbeelding 2011-01-07 om 18.54.38.png[/attachment]
and now using the mailplugin with http tunneling works! :-)

Schermafbeelding 2011-01-07 om 18.54.38.png

Exactly as the log said it couldn’t resolve…