Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Socket blocked on Google App Engine Standard Java8

This documentation page says that:

Applications in the Java 8 runtime can use native Java sockets with no restrictions

However a socket to port 25 get blocked somewhere. The code bellow works fine on my local JVM but not in Google app engine Java8 standard env.

Socket skt = new Socket("gmail.com", 25);
BufferedReader rdr = new BufferedReader(new InputStreamReader(skt.getInputStream()));

I have been going through the docs for days now, but cannot find anything explaining why its not working. Nothing on my logs neither.

Can I open a socket to port 25 on GAE or not? please help

like image 411
Adil Avatar asked Dec 06 '25 04:12

Adil


1 Answers

Port 25 is always blocked for mail related security reasons.

In the Java sockets documentation that you shared is stated that:

Port 25 (SMTP) is blocked; you can still use authenticated SMTP on the submission port 587.

It's true that the documentation is somewhat misleading about if this port limitation applies only to Java 7 runtime or affects Java 8 too. I'll send feedback about this documentation page to prevent future confusion.

like image 176
Guillermo Cacheda Avatar answered Dec 09 '25 18:12

Guillermo Cacheda



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!