Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

EOF on socket when opening pop3 inbox

955077Aug 10 2012 — edited Aug 17 2012
I have a Java program that reads a pop3 inbox and sends appropriate response emails. The program was working fine but something somewhere changed and now I get the following Exception:
Exception in thread "main" javax.mail.MessagingException: Open failed;
  nested exception is:
	java.io.EOFException: EOF on socket
	at com.sun.mail.pop3.POP3Folder.open(POP3Folder.java:215)
I wrote a simple Class to reproduce the error:
    private void execute() throws MessagingException {
        Properties props = new Properties();
        props.put("mail.smtp.host", "mail.smtp.host");
        props.put("mail.store.protocol", "pop3");
        // Session session = Session.getInstance(props, null);
        Session session = Session.getDefaultInstance(props);
        Store store = session.getStore("pop3");
        store.connect("mail.myDomain.com", "myUser", "myPassword");
        Folder inbox = store.getFolder("INBOX");
        inbox.open(Folder.READ_ONLY);
    }
It connects to the store okay. The exception is thrown at the the line with store.getFolder("INBOX"). I've checked our firewall settings and email server settings (dovecot/postfix) and all seems well.

Anyone have a clue what this might be?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 14 2012
Added on Aug 10 2012
5 comments
11,904 views