Package org.apache.james.protocols.pop3

Examples of org.apache.james.protocols.pop3.POP3Response


        handlers.add(new UidlCmdHandler());
        handlers.add(new RsetCmdHandler());
        handlers.add(new DeleCmdHandler());
        handlers.add(new NoopCmdHandler());
        handlers.add(new RetrCmdHandler());
        handlers.add(new TopCmdHandler());
        handlers.add(new StatCmdHandler());
        handlers.add(new QuitCmdHandler());
        handlers.add(new WelcomeMessageHandler());
        handlers.add(new UnknownCmdHandler());
        handlers.add(new StlsCmdHandler());
View Full Code Here


        }
       
        handlers.add(new CapaCmdHandler());
        handlers.add(new UserCmdHandler());
        handlers.add(new ListCmdHandler());
        handlers.add(new UidlCmdHandler());
        handlers.add(new RsetCmdHandler());
        handlers.add(new DeleCmdHandler());
        handlers.add(new NoopCmdHandler());
        handlers.add(new RetrCmdHandler());
        handlers.add(new TopCmdHandler());
View Full Code Here

        handlers.add(new RetrCmdHandler());
        handlers.add(new TopCmdHandler());
        handlers.add(new StatCmdHandler());
        handlers.add(new QuitCmdHandler());
        handlers.add(new WelcomeMessageHandler());
        handlers.add(new UnknownCmdHandler());
        handlers.add(new StlsCmdHandler());
        handlers.add(new CommandDispatcher<POP3Session>());
      
        return handlers;
    }
View Full Code Here

        for (AbstractPassCmdHandler handler: authHandlers) {
            handlers.add(handler);
        }
       
        handlers.add(new CapaCmdHandler());
        handlers.add(new UserCmdHandler());
        handlers.add(new ListCmdHandler());
        handlers.add(new UidlCmdHandler());
        handlers.add(new RsetCmdHandler());
        handlers.add(new DeleCmdHandler());
        handlers.add(new NoopCmdHandler());
View Full Code Here

        handlers.add(new NoopCmdHandler());
        handlers.add(new RetrCmdHandler());
        handlers.add(new TopCmdHandler());
        handlers.add(new StatCmdHandler());
        handlers.add(new QuitCmdHandler());
        handlers.add(new WelcomeMessageHandler());
        handlers.add(new UnknownCmdHandler());
        handlers.add(new StlsCmdHandler());
        handlers.add(new CommandDispatcher<POP3Session>());
      
        return handlers;
View Full Code Here

        public final MessageMetaData meta;

        public Message(String headers, String body) {
            this.headers = headers;
            this.body = body;
            this.meta = new ImapMessageMetaData(UIDS.incrementAndGet(), headers.length() + body.length() + 2);
        }
View Full Code Here

        Response response = null;
        if (session.getHandlerState() == POP3Session.AUTHENTICATION_READY || session.getHandlerState() == POP3Session.AUTHENTICATION_USERSET) {
            return SIGN_OFF;
        }
        List<String> toBeRemoved = (List<String>) session.getAttachment(POP3Session.DELETED_UID_LIST, State.Transaction);
        Mailbox mailbox = session.getUserMailbox();
        try {
            String[] uids = toBeRemoved.toArray(new String[toBeRemoved.size()]);
            mailbox.remove(uids);
            response = SIGN_OFF;
        } catch (Exception ex) {
            response = SIGN_OFF_NOT_CLEAN;
            session.getLogger().error("Some deleted messages were not removed", ex);
        }
        try {
            mailbox.close();
        } catch (IOException e) {
            // ignore on close
        }
        return response;
    }
View Full Code Here

        String parameters = request.getArgument();
        POP3Response response = null;
        if (session.getHandlerState() == POP3Session.AUTHENTICATION_USERSET && parameters != null) {
            String passArg = parameters;
            try {
                Mailbox mailbox = mailboxManager.getMailbox(session, passArg);
                if (mailbox != null) {
                  session.setUserMailbox(mailbox);
                  stat(session);
               
                  StringBuilder responseBuffer = new StringBuilder(64).append("Welcome ").append(session.getUser());
View Full Code Here

            response = new POP3Response(POP3Response.OK_RESPONSE, "Apache James POP3 Server signing off.");
            response.setEndSession(true);
            return response;
        }
        List<Long> toBeRemoved = (List<Long>) session.getState().get(POP3Session.DELETED_UID_LIST);
        Mailbox mailbox = session.getUserMailbox();
        try {
            ;
            long uids[] = new long[toBeRemoved.size()];
            for (int i = 0;i < toBeRemoved.size(); i++) {
                uids[i] = toBeRemoved.get(i);
            }
            mailbox.remove(uids);
            response = new POP3Response(POP3Response.OK_RESPONSE, "Apache James POP3 Server signing off.");
        } catch (Exception ex) {
            response = new POP3Response(POP3Response.ERR_RESPONSE, "Some deleted messages were not removed");
            session.getLogger().error("Some deleted messages were not removed", ex);
        }    
        response.setEndSession(true);
        try {
            mailbox.close();
        } catch (IOException e) {
            // ignore on close
        }
        return response;
    }
View Full Code Here

     * @param pass
     * @return response
     */
    protected final Response doAuth(POP3Session session, String user, String pass) {
        try {
            Mailbox mailbox = auth(session, user, pass);

            if (mailbox != null) {
                session.setUserMailbox(mailbox);
                stat(session);

View Full Code Here

TOP

Related Classes of org.apache.james.protocols.pop3.POP3Response

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.