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.
Asked
Active
Viewed 703 times
0
-
Please read [How to ask](http://stackoverflow.com/help/how-to-ask). – segarci Jan 14 '15 at 14:20
-
Pardon me. Can you please comment what is wrong with my question? I am new to stack overflow excuse me if it sounds rude. @segarci – Ragupathy Jan 14 '15 at 14:24
1 Answers
1
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.

Bill Shannon
- 29,579
- 6
- 38
- 40
-
Thanks a lot for the reply. Using the link you gave I understood what to do with connect. But the link didn't have download link for connect source code. I downloaded connect.c program but I am finding difficulties on compiling that code. Can please you tell me how to do that in windows 7? – Ragupathy Jan 15 '15 at 05:25
-
-
-
After having read the documentation, what specific questions do you have? What have you tried and failed? – Bill Shannon Apr 03 '18 at 17:01