I contacted the friend who had configured the server and with this info he could find and enable something like "Report external adress in Passive Mode". After this it worked :-))
Yes, that was what I expected.
That means, it is technically possible to detect the internal IP and redirect it to the correct external IP! Seems that synapse can do this on Windows (because my code worked on Windows), but not on Linux (because the same code got a 130 sec timeout there).
An 192.168.x.x is always a local IP. The FTP client could just ignore that and try the external IP on which the connection was initiated.
That's what TotalCommander seems to do.
I'm not aware Synapse does this. And if it does, it should also work under Linux.
If you implement the OnStatus for your program you'll see those messages there too (on Windows and Linux) and you'll know which commands are sent.
One possibility... When TotalCommander detects a local IP (like 192.168.x.x) this could also be a local adres within your network.
If Windows is on 10.0.0.x for example and the FTP server reports 192.168.x.x, you know it's a remote location.
If Linux is on 192.168.x.x and the FTP server reports 192.168.x.x, this could also be a local network adres.
How would TotalCommander see the difference?
You ran TotalCommander on Windows. But your program also worked under Windows. So maybe your Windows is on a different subnet from your Linux machine?