public ImapCheckThread()

in chatterbox-imap/chatterbox-imap-impl/src/main/java/org/apache/tomee/chatterbox/imap/adapter/ImapCheckThread.java [41:57]


    public ImapCheckThread(ImapResourceAdapter resourceAdapter) {
        this.resourceAdapter = resourceAdapter;
        final Properties properties = System.getProperties();
        session = Session.getDefaultInstance(properties, null);
        try {
            // Test the connection
            connect(session, resourceAdapter);
        } catch (AuthenticationFailedException e) {
            if ("imap.gmail.com".equals(resourceAdapter.getHost())) {
                LOGGER.log(Level.SEVERE, "Failed to Connect " + resourceAdapter + "  Ensure 'access to less secure apps' is turned on in your gmail account", e);
            } else {
                LOGGER.log(Level.SEVERE, "Failed to Connect " + resourceAdapter, e);
            }
        } catch (MessagingException e) {
            LOGGER.log(Level.SEVERE, "Failed to Connect " + resourceAdapter, e);
        }
    }