◆ JamesRemoteManager()
org.turro.elephant.james.JamesRemoteManager.JamesRemoteManager |
( |
String |
mailHost, |
|
|
int |
port, |
|
|
String |
user, |
|
|
String |
password |
|
) |
| |
◆ execute()
String org.turro.elephant.james.JamesRemoteManager.execute |
( |
JamesCommand |
command | ) |
|
Definition at line 47 of file JamesRemoteManager.java.
48 String returnString =
"An unknown error has occurred.";
50 Socket socket =
new Socket(mailHost, port);
51 InputStream is = socket.getInputStream();
52 InputStreamReader isr =
new InputStreamReader(is);
53 BufferedReader br =
new BufferedReader(isr);
54 OutputStream os = socket.getOutputStream();
55 OutputStreamWriter osw =
new OutputStreamWriter(os);
56 BufferedWriter bw =
new BufferedWriter(osw);
60 String infoString =
"OK: \r\n\r\n";
62 while ((line = br.readLine()) !=
null) {
65 if (line.indexOf(
"id") != -1) {
70 }
else if (line.indexOf(
"Password") != -1) {
76 if (line.indexOf(
"Welcome") != -1) {
78 bw.write(command.getCommand());
90 infoString += br.readLine() +
"\r\n";
101 returnString = (String) infoString;
108 catch (Exception e) {
109 if (command.getCommand().equals(
"shutdown")) {
110 returnString =
"OK: Shutdown";
112 Logger.getLogger(
JamesRemoteManager.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(returnString), e);
JamesRemoteManager(String mailHost, int port, String user, String password)
The documentation for this class was generated from the following file: