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?