title: javamail AuthenticationFailedException: EOF on socket
body: <p>I wrote a program to check mails with JavaMail. Here is the code:</p>
  
  <pre><code>private static Folder getFolder(String popHost, int openPort, MailAuthenticator auth) throws MessagingException{
      try{
          store.close();
      }catch(Exception e){
          System.out.println("Store konnte nicht geschlossen werden: "+e.getMessage());
      }
      Properties properties = System.getProperties();
      properties.setProperty("mail.store.protocol", "pop3");
      properties.setProperty("mail.pop3.host", popHost);
      properties.setProperty("mail.pop3.port", String.valueOf(openPort));
      properties.setProperty("mail.pop3.auth", "true");
      properties.setProperty( "mail.pop3.socketFactory.class",
              "javax.net.ssl.SSLSocketFactory" ); 
      Session session = Session.getInstance(properties, auth);
      session.setDebug(true);
      store = session.getStore( "pop3" );
      store.connect();
      return store.getFolder( "INBOX" );
  </code></pre>
  
  <p>It works perfectly on my PC, but it should run on my Raspberry Pi. On Raspberry <strong>store.connect()</strong> throws a AuthenticationFailedException:</p>
  
  <pre><code>DEBUG: setDebug: JavaMail version 1.5.5
  DEBUG: getProvider() returning   javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle]
  DEBUG POP3: mail.pop3.rsetbeforequit: false
  DEBUG POP3: mail.pop3.disabletop: false
  DEBUG POP3: mail.pop3.forgettopheaders: false
  DEBUG POP3: mail.pop3.cachewriteto: false
  DEBUG POP3: mail.pop3.filecache.enable: false
  DEBUG POP3: mail.pop3.keepmessagecontent: false
  DEBUG POP3: mail.pop3.starttls.enable: false
  DEBUG POP3: mail.pop3.starttls.required: false
  DEBUG POP3: mail.pop3.apop.enable: false
  DEBUG POP3: mail.pop3.disablecapa: false
  DEBUG POP3: connecting to host "pop.goneo.de", port 995, isSSL false
  &lt;EOF&gt;
  javax.mail.AuthenticationFailedException: EOF on socket
      at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:209)
      at javax.mail.Service.connect(Service.java:388)
      at javax.mail.Service.connect(Service.java:246)
      at javax.mail.Service.connect(Service.java:195)
      at MailInterface.getFolder(MailInterface.java:294)
      at MailInterface.getFolder(MailInterface.java:253)
      at MailWatch.checkMailAccount(MailWatch.java:75)
      at MailWatch.checkMails(MailWatch.java:46)
      at MailWatch.run(MailWatch.java:25)
  </code></pre>
  
  <p>Why can't my Raspberry connect to host, but my PC can? How can I fix it on Raspberry?</p>