Java POP3 server question

G

Guest

Hi all,

I have written this code to see how the mail application response to
my pop3 commands, but it doesn't work at all.

How I want it to work is to print out the pop3 request command from
the mail application eg outlook express etc... but it doesn't seem to
print out any command at all and just does nothing... can anyone help
please.


import java.io.*;
import java.net.*;
import javax.mail.*;
import java.util.*;
import javax.mail.event.*;
import javax.mail.internet.*;

public class SimpleProxy
{
public static void main(String args[])
{
try{
ServerSocket server = new ServerSocket(8189);
Socket incoming = server.accept();
System.out.println("Waiting!");

BufferedReader reader = new BufferedReader
(new InputStreamReader(incoming.getInputStream()));

PrintWriter out = new PrintWriter
(incoming.getOutputStream(), true);

String line = reader.readLine();

System.out.println(line);




}catch(Exception ex)
{
ex.printStackTrace();
}
}


}
 
T

Thomas Schodt

You could try
telnet localhost 8189
and type in the request you would expect outlook to issue.
Have you configured outlook to connect to a non-standard port?
 
G

Gary M

Hi all,

I have written this code to see how the mail application response to
my pop3 commands, but it doesn't work at all.

How I want it to work is to print out the pop3 request command from
the mail application eg outlook express etc... but it doesn't seem to
print out any command at all and just does nothing... can anyone help
please.

You are listening on 8189. I hope you changed outlook's POP3 port
from 110 to 8189 ?

Gary
 
T

Thomas G. Marshall

Thomas Schodt said:
You could try
telnet localhost 8189
and type in the request you would expect outlook to issue.
Have you configured outlook to connect to a non-standard port?


Be warned about something here. If you're typing, then you're fine.

But if you decide to build a bunch of data and pipe it into telnet to see
the results:

cat data | telnet <somewhere>

You can run into trouble, because telnet dies the moment that its stdin
closes. You'll need to do someting similar to this (in uxix shells):

(cat data; sleep 99999) | telnet <somewhere>

Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top