/** * Return an {@link InputStream} which holds the full content of the message. This method * tries to optimize this call as far as possible * * @return messageInputStream * @throws MessagingException */ public synchronized InputStream getMessageInputStream() throws MessagingException{ if (!messageParsed && !isModified() && source != null) { try { return source.getInputStream(); } catch (IOException e) { throw new MessagingException("Unable to get inputstream", e); } } else { return new MimeMessageInputStream(this, false); } }
mailboxManager.createMailbox(inbox, mailboxSession); mailboxManager.getMailbox(MailboxPath.inbox(username), mailboxSession).appendMessage(new MimeMessageInputStream(mail.getMessage()), new Date(), mailboxSession, true, null); mailboxManager.endProcessingRequest(mailboxSession); response = new SMTPResponse(SMTPRetCode.MAIL_OK, DSNStatus.getStatus(DSNStatus.SUCCESS,DSNStatus.CONTENT_OTHER)+" Message received");