Package org.apache.james.protocols.pop3

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


            } catch (NumberFormatException nfe) {
                return SYNTAX_ERROR;
            }
            try {
               
                MessageMetaData data = MessageMetaDataUtils.getMetaData(session, num);
                if (data == null) {
                    StringBuilder responseBuffer = new StringBuilder(64).append("Message (").append(num).append(") does not exist.");
                    return  new POP3Response(POP3Response.ERR_RESPONSE, responseBuffer.toString());
                }
               
                List<Long> deletedUidList = (List<Long>) session.getAttachment(POP3Session.DELETED_UID_LIST, State.Transaction);

                Long uid = data.getUid();
                if (deletedUidList.contains(uid) == false) {

                    InputStream body = new CountingBodyInputStream(new ExtraDotInputStream(new CRLFTerminatedInputStream(session.getUserMailbox().getMessageBody(uid))), lines);
                    InputStream headers = session.getUserMailbox().getMessageHeaders(uid);
                    if (body != null && headers != null) {
View Full Code Here


                num = Integer.parseInt(parameters.trim());
            } catch (Exception e) {
                return SYNTAX_ERROR;
            }
            try {
                MessageMetaData data = MessageMetaDataUtils.getMetaData(session, num);

                if (data == null) {
                    StringBuilder responseBuffer = new StringBuilder(64).append("Message (").append(num).append(") does not exist.");
                    response = new POP3Response(POP3Response.ERR_RESPONSE, responseBuffer.toString());
                    return response;
                }
                List<Long> deletedUidList = (List<Long>) session.getAttachment(POP3Session.DELETED_UID_LIST, State.Transaction);

                Long uid = data.getUid();
                if (deletedUidList.contains(uid) == false) {
                    InputStream content = session.getUserMailbox().getMessage(uid);

                    if (content != null) {
                        InputStream in = new CRLFTerminatedInputStream(new ExtraDotInputStream(content));
View Full Code Here

                num = Integer.parseInt(request.getArgument());
            } catch (Exception e) {
                return SYNTAX_ERROR;
            }
            try {
                MessageMetaData meta = MessageMetaDataUtils.getMetaData(session, num);
                if (meta == null) {
                    StringBuilder responseBuffer = new StringBuilder(64).append("Message (").append(num).append(") does not exist.");
                    return  new POP3Response(POP3Response.ERR_RESPONSE, responseBuffer.toString());
                }
                List<Long> deletedUidList = (List<Long>) session.getAttachment(POP3Session.DELETED_UID_LIST, State.Transaction);

                Long uid = meta.getUid();

                if (deletedUidList.contains(uid)) {
                    StringBuilder responseBuffer = new StringBuilder(64).append("Message (").append(num).append(") already deleted.");
                    return new POP3Response(POP3Response.ERR_RESPONSE, responseBuffer.toString());
                } else {
View Full Code Here

        ProtocolServer server = null;
        try {
            String identifier = "id";
            TestPassCmdHandler factory = new TestPassCmdHandler();
           
            factory.add("valid", new MockMailbox(identifier, MESSAGE1, MESSAGE2));
            server = createServer(createProtocol(factory), address);
            server.bind();
           
            POP3Client client =  createClient();
            client.connect(address.getAddress().getHostAddress(), address.getPort());
View Full Code Here

        ProtocolServer server = null;
        try {
            String identifier = "id";
            TestPassCmdHandler factory = new TestPassCmdHandler();
           
            factory.add("valid", new MockMailbox(identifier, MESSAGE1, MESSAGE2));
            server = createServer(createProtocol(factory), address);
            server.bind();
           
            POP3Client client =  createClient();
           
View Full Code Here

            assertTrue(welcomeMessage.trim().matches("\\+OK \\<\\d+\\.\\d+@.+\\> .+"));
           
            int reply = client.sendCommand("APOP invalid invalid");
            assertEquals(POP3Reply.ERROR, reply);
           
            handler.add("valid", new MockMailbox("id"));
            reply = client.sendCommand("APOP valid valid");
            assertEquals(POP3Reply.OK, reply);
           
            assertTrue(client.logout());
          
View Full Code Here

        ProtocolServer server = null;
        try {
            String identifier = "id";
            TestPassCmdHandler handler = new TestPassCmdHandler();
           
            handler.add("valid", new MockMailbox(identifier));
            server = createServer(createProtocol(handler), address);
            server.bind();
           
            POP3Client client =  createClient();
            client.connect(address.getAddress().getHostAddress(), address.getPort());
View Full Code Here

        ProtocolServer server = null;
        try {
            String identifier = "id";
            TestPassCmdHandler handler = new TestPassCmdHandler();
           
            handler.add("valid", new MockMailbox(identifier, MESSAGE1, MESSAGE2));
            server = createServer(createProtocol(handler), address);
            server.bind();
           
            POP3Client client =  createClient();
            client.connect(address.getAddress().getHostAddress(), address.getPort());
View Full Code Here

        ProtocolServer server = null;
        try {
            String identifier = "id";
            TestPassCmdHandler factory = new TestPassCmdHandler();
           
            factory.add("valid", new MockMailbox(identifier, MESSAGE1, MESSAGE2));
            server = createServer(createProtocol(factory), address);
            server.bind();
           
            POP3Client client =  createClient();
            client.connect(address.getAddress().getHostAddress(), address.getPort());
View Full Code Here

        ProtocolServer server = null;
        try {
            String identifier = "id";
            TestPassCmdHandler factory = new TestPassCmdHandler();
           
            factory.add("valid", new MockMailbox(identifier, MESSAGE1, MESSAGE2));
            server = createServer(createProtocol(factory), address);
            server.bind();
           
            POP3Client client =  createClient();
            client.connect(address.getAddress().getHostAddress(), address.getPort());
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.