JavaMail - Corkscrew - http proxy

720 views Asked by At

I tried writing code to send email using Java mail API. The code worked fine when I'm connected to direct internet. But when I use internet over a http proxy, the code doesn't work. After all the research I did. I found Java mail doesn't support http proxy tunnelling. I also found program like CORKSCREW will help me to tunnel through proxy. But When I did some research on that, I didn't understand what is the connection between Java code and Corkscrew. Please help me to understand this. I have got to finish the Java code sooner. Please help me.

1

There are 1 answers

4
Bill Shannon On

To use corkscrew with JavaMail, you configure inetd to run corkscrew when you connect to some local port. The corkscrew command that you run then specifies the proxy server and the remote mail server that you want to connect to.

The Java code doesn't change, you just configure JavaMail to use "localhost" and the local port that's configured for corkscrew. The corkscrew "server" then forwards/tunnels all requests to the real mail server.

An alternative to corkscrew is connect, which can be run as a server without using inetd.