Package com.ettrema.mail

Examples of com.ettrema.mail.Message


        if( inbox != null ) {
            int num = 1;
            Collection<MessageResource> messageResources = inbox.getMessages();
            if( messageResources != null ) {               
                for (MessageResource mr : messageResources) {
                    Message m = new Message(mr, num++);
                    popSession.messages.add(m);
                }
            }
            log.debug("session messages: " + popSession.messages.size());
        } else {
View Full Code Here


            }
            popSession.reply(session, ".");
        } else {
            String sNum = args[1];
            int num = Integer.parseInt(sNum);
            Message m = get(popSession, num);
            if (m == null) {
                popSession.reply(session, "-ERR no such message");
            } else {
                popSession.reply(session, "+OK " + m.hashCode());
            }
        }
    }
View Full Code Here

            }
            popSession.reply(session, ".");
        } else {
            String sNum = args[1];
            int num = Integer.parseInt(sNum);
            Message m = get(popSession, num);
            if (m == null) {
                popSession.reply(session, "-ERR no such message");
            } else {
                popSession.reply(session, "+OK " + m.size());
            }
        }
    }
View Full Code Here

    }

    public void retr(final IoSession session, PopSession popSession, String[] args) {
        String sNum = args[1];
        int num = Integer.parseInt(sNum);
        Message m = get(popSession, num);

        if (m == null) {
            popSession.reply(session, "-ERR no such message");
        } else {
            popSession.reply(session, "+OK " + m.size() + " octets");
            Session mailSess = null;
            ChunkWriter store = new ChunkWriter() {

                public void newChunk(int i, byte[] data) {
                    IoBuffer bb = IoBuffer.wrap(data);
                    session.write(bb);
                }
            };
            ChunkingOutputStream out = new ChunkingOutputStream(store, 1024);
            try {
                m.getResource().writeTo(out);
                out.flush();
            } catch (Exception e) {
                log.error("exception sending message", e);
            } finally {
                close(out);
View Full Code Here

    }

    public void dele(IoSession session, PopSession popSession, String[] args) {
        String sNum = args[1];
        int num = Integer.parseInt(sNum);
        Message mid = get(popSession, num);
        if (mid != null) {
            mid.markForDeletion();
            popSession.reply(session, "+OK");
            return;
        } else {
            popSession.reply(session, "-ERR no such message");
        }
View Full Code Here

TOP

Related Classes of com.ettrema.mail.Message

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.