Package org.apache.james.core

Examples of org.apache.james.core.MailImpl.dispose()


                        " was not found on this server.");
                throw new MessagingException(errorBuffer.toString());
            }
            userInbox.store(mail);
        } finally {
            mail.dispose();
        }
    }

    /**
     * Return a new mail id.
View Full Code Here


            setIsReply(newMail, isReply(originalMail), originalMail);
   
            newMail.getMessage().saveChanges();
            getMailetContext().sendMail(newMail);
        } finally {
            newMail.dispose();
        }

        // ghosting the original mail
        if(!getPassThrough(originalMail)) {
            originalMail.setState(Mail.GHOST);
View Full Code Here

        verifyLastMail(sender, recipient, null);
       
        assertEquals(((String) mm.getContent()).trim(),((String) ((MimeMessage) m_mailServer.getLastMail()[2]).getContent()).trim());
       
        mail.dispose();
    }

   
    /**
     * This is useful code to run tests on javamail bugs
View Full Code Here

        verifyLastMail(sender, recipient, null);
       
        // THIS WOULD FAIL BECAUSE OF THE JAVAMAIL BUG
        // assertEquals(mm.getContent(),((MimeMessage) m_mailServer.getLastMail()[2]).getContent());
       
        mail.dispose();
    }
   
   
}
View Full Code Here

                }
                newMail.setRecipients(recipientsToAddForward);
                newMail.setAttribute(MARKER, Boolean.TRUE);
                getMailetContext().sendMail(newMail);
            } finally {
                newMail.dispose();
            }
        }

        // If there are no recipients left, Ghost the message
        if (recipients.size() == 0) {
View Full Code Here

                                        .append("using a different sender.");
                throw new MessagingException(logBuffer.toString());
            }
   
        } finally {
            newMail.dispose();
        }
       
        if(!getPassThrough(originalMail)) {
            originalMail.setState(Mail.GHOST);
        }
View Full Code Here

            setIsReply(newMail, isReply(originalMail), originalMail);
   
            newMail.getMessage().saveChanges();
            getMailetContext().sendMail(newMail);
        } finally {
            newMail.dispose();
        }

        // ghosting the original mail
        if(!getPassThrough(originalMail)) {
            originalMail.setState(Mail.GHOST);
View Full Code Here

                        " was not found on this server.");
                throw new MessagingException(errorBuffer.toString());
            }
            userInbox.store(mail);
        } finally {
            mail.dispose();
        }
    }

    /**
     * Return a new mail id.
View Full Code Here

                newMail.setRecipients(recipientsToAddForward);
                newMail.setAttribute(MARKER, Boolean.TRUE);
                getMailetContext().sendMail(newMail);
            } finally {
                newMail.dispose();
            }
        }

        // If there are no recipients left, Ghost the message
        if (recipients.size() == 0) {
View Full Code Here

                String logBuffer = getMailetName() + " mailet cannot forward " + originalMail.getName() + ". Invalid sender domain for " + newMail.getSender() + ". Consider using the Resend mailet " + "using a different sender.";
                throw new MessagingException(logBuffer);
            }

        } finally {
            newMail.dispose();
        }

        if (!getPassThrough(originalMail)) {
            originalMail.setState(Mail.GHOST);
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.