1) POP3 messages are read-only 2) java.io.EOFException: EOF on socket 3) java.net.NoRouteToHostException: Operation timed out:
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   shahar_shalev
Posted On:   Sunday, March 9, 2003 08:23 AM

1) POP3 messages are read-only javax.mail.IllegalWriteException: POP3 messages are read-only, 2) java.io.EOFException: EOF on socket javax.mail.MessagingException: Open failed; 3) java.net.NoRouteToHostException: Operation timed out: no further information javax.mail.MessagingException: Operation timed out: no further information; first Exception accurse when I try to send a message that is already in my inbox and re Write the “to” field exception points to message.setFrom() and cant rewrite that field on an existing message second Exception accurse when receiving large ziped file throw pop3 it work fine for small txt file receiving third Exception accurse when trying to connect to my   More>>


1) POP3 messages are read-only
javax.mail.IllegalWriteException: POP3 messages are read-only,
2) java.io.EOFException: EOF on socket
javax.mail.MessagingException: Open failed;
3) java.net.NoRouteToHostException: Operation timed out: no further information
javax.mail.MessagingException: Operation timed out: no further information;

first Exception accurse when I try to send a message that is already in my inbox and re Write the “to” field exception points to message.setFrom() and cant rewrite that field on an existing message

second Exception accurse when receiving large ziped file throw pop3 it work fine for small txt file receiving
third Exception accurse when trying to connect to my host throw imap works fine when I connect with pop3
few more problems:
4) how can I work with several folders throw imap or pop3 in terms of handling messages between the different folders (copy,delete,setting and getting)
5) can I have physical folder and get set messages to her I did not succeed in fetching messages from a folder with out operate the store.connect( ) method first which is an expansive operation.
6) when I receive messages with my out look express they disappear from the
Javax.mail folder(inbox) who can I prevent this
7)what general changes do I need to do using imap instead of po3
the next code was making the above Exceptions

			
public void actionPerformed(ActionEvent e){
try{
if(!store.isConnected()){
//CONNECT IF NOT ALLREADY CONNECTED
store.connect(inputData.data.getHost(), inputData.data.getUserName(), inputData.data.getPassword());//host, username, password
}
System.out.println("SendReciveMail was pressed");
folder = store.getFolder("INBOX");
System.out.println("Folder name is " + folder.getName());
if(!folder.exists()){
folder.create( Folder.HOLDS_MESSAGES);
}
folder.open(Folder.READ_WRITE);// SECONDE EXCEPTION HERE

Message message[] = folder.getMessages();
for (int i=0, n=message.length; i
System.out.println(i + ": " + message[i].getFrom()[0]
+ " " + message[i].getSubject());
//openMessage.setMessage(message[i]);
//openMessage.actionPerformed(e);
}

// Close connection
folder.close(false);
store.close();
} catch(Exception ex) {
System.out.println(ex.getMessage());
ex.printStackTrace();
}

}
/************************************************************/
ANOTHER FUNCTION(sets the session props
and store one time at the beginning of the program
they are private data member shard by both functions )
public void initialData(){
// Get system properties
props = System.getProperties();
// Setup mail server
// props.put("mail.imap.host",inputData.data.getHost());//host
props.put("mail.smtp.host",inputData.data.getHost());//host

// Get session
session = Session.getDefaultInstance(props, null);

try {
// Get the store
store = session.getStore("pop3");
//store = session.getStore("imap");
if(!store.isConnected()){
//CONNECT IF NOT ALLREDY CONNECTED
store.connect(inputData.data.getHost(),
inputData.data.getUserName(),
inputData.data.getPassword());//host,
// username, password //MAKE THIRD
//EXCEPTION USING IMAP
}
} catch(Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}

}
/*******************************************************************/


all the data use by the function checked to be ok
write me to shaharke1@bezeqint.net    <<Less

Re: 1) POP3 messages are read-only 2) java.io.EOFException: EOF on socket 3) java.net.NoRouteToHostException: Operation timed out:

Posted By:   Christopher_Koenigsberg  
Posted On:   Monday, March 10, 2003 06:41 AM

Indeed, POP3 messages are read-only, as it says. That is, you cannot write to a POP3 mailbox, you can only read from it.



And to set Outlook Express to "leave messages on server", so they will still be there when you look at the same POP3 folder in your JavaMail client, look in the properties for the particular account, in OE.

About | Sitemap | Contact