Package com.icegreen.greenmail.store

Examples of com.icegreen.greenmail.store.SimpleStoredMessage


                conn.println("-ERR no such message");

                return;
            }

            SimpleStoredMessage msg = (SimpleStoredMessage) msgList.get(0);
            Flags flags = msg.getFlags();

            if (flags.contains(Flags.Flag.DELETED)) {
                conn.println("-ERR message already deleted");

                return;
View Full Code Here


                    conn.println("-ERR no such message");

                    return;
                }

                SimpleStoredMessage msg = (SimpleStoredMessage) msgList.get(0);
                conn.println("+OK " + msgNumStr + " " + msg.getUid());
            } else {
                messages = inbox.getNonDeletedMessages();

                conn.println("+OK");
                for (Iterator i = messages.iterator(); i.hasNext();) {
                    SimpleStoredMessage msg = (SimpleStoredMessage) i.next();
                    conn.println(inbox.getMsn(msg.getUid()) + " " + msg.getUid());
                }

                conn.println(".");
            }
        } catch (FolderException me) {
View Full Code Here

                    conn.println("-ERR no such message");

                    return;
                }

                SimpleStoredMessage msg = (SimpleStoredMessage) msgList.get(0);
                conn.println("+OK " + msgNumStr + " " + msg.getMimeMessage().getSize());
            } else {
                List messages = inbox.getNonDeletedMessages();
                conn.println("+OK");
                for (Iterator i = messages.iterator(); i.hasNext();) {
                    SimpleStoredMessage msg = (SimpleStoredMessage) i.next();
                    conn.println(inbox.getMsn(msg.getUid()) + " " + msg.getMimeMessage().getSize());
                }

                conn.println(".");
            }
        } catch (Exception me) {
View Full Code Here

    long sumMessageSizes(List messages)
            throws MailException {
        long total = 0;

        for (Iterator i = messages.iterator(); i.hasNext();) {
            SimpleStoredMessage msg = (SimpleStoredMessage) i.next();
            try {
                total += msg.getMimeMessage().getSize();
            } catch (MessagingException e) {
                throw new RuntimeException(e);
            }
        }
View Full Code Here

                conn.println("-ERR no such message");

                return;
            }

            SimpleStoredMessage msg = (SimpleStoredMessage) msgList.get(0);
            String email = GreenMailUtil.instance().getWholeMessage(msg.getMimeMessage());
            conn.println("+OK");
            conn.print(new StringReader(email));
            conn.println();
            conn.println(".");
            msg.getFlags().add(Flags.Flag.SEEN);
        } catch (Exception e) {
            conn.println("-ERR " + e);
        }
    }
View Full Code Here

     */
    public MimeMessage[] getReceivedMessages() {
        List msgs = managers.getImapHostManager().getAllMessages();
        MimeMessage[] ret = new MimeMessage[msgs.size()];
        for (int i = 0; i < msgs.size(); i++) {
            SimpleStoredMessage simpleStoredMessage = (SimpleStoredMessage) msgs.get(i);
            ret[i] = simpleStoredMessage.getMimeMessage();
        }
        return ret;
    }
View Full Code Here

                conn.println("-ERR no such message");

                return;
            }

            SimpleStoredMessage msg = (SimpleStoredMessage) msgList.get(0);

            int numLines = Integer.parseInt(cmdLine[2]);

            BufferedReader in = new BufferedReader(new StringReader(GreenMailUtil.instance().getWholeMessage(msg.getMimeMessage())));

            conn.println("+OK");

            copyHeaders(in, conn);
            copyLines(in, conn, numLines);
View Full Code Here

            long uid = uids[i];
            int msn = mailbox.getMsn(uid);

            if ((useUids && includes(idSet, uid)) ||
                    (!useUids && includes(idSet, msn))) {
                SimpleStoredMessage storedMessage = mailbox.getMessage(uid);
                String msgData = outputMessage(fetch, storedMessage, mailbox, useUids);
                response.fetchResponse(msn, msgData);
            }
        }
View Full Code Here

TOP

Related Classes of com.icegreen.greenmail.store.SimpleStoredMessage

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.