title: store.connect() is not working for gmail imap on proxy
body: <p><code>store.connect()</code> is not working for gmail imap on proxy for my below code:</p>
  
  <pre><code>Properties props = new Properties();
  props.setProperty("mail.store.protocol", "imaps");
  Session session = Session.getInstance(props, null);
  Store store = session.getStore("imaps");
  store.connect("imap.gmail.com", email, pass);
  Folder inbox = store.getFolder("INBOX");
  inbox.open(Folder.READ_ONLY);
  </code></pre>
  
  <p>Getting below error:</p>
  
  <blockquote>
    <p>javax.mail.MessagingException: Connection refused: connect; nested
    exception is: java.net.ConnectException: Connection refused: connect</p>
  </blockquote>
  
  <p>Already tried:</p>
  
  <ol>
  <li><a href="http://developers.viafirma.com/en/proxy-connection-problems-connection-refused" rel="nofollow noreferrer">http://developers.viafirma.com/en/proxy-connection-problems-connection-refused</a></li>
  <li><a href="https://stackoverflow.com/questions/8428254/javamail-smtp-host-error">JavaMail SMTP-host error</a></li>
  <li><a href="http://javarevisited.blogspot.in/2013/02/java-net-ConnectException-Connection-refused.html" rel="nofollow noreferrer">http://javarevisited.blogspot.in/2013/02/java-net-ConnectException-Connection-refused.html</a></li>
  </ol>