Search in sources :

Example 1 with ParsedMessageOptions

use of com.zimbra.cs.mime.ParsedMessageOptions in project zm-mailbox by Zimbra.

the class DumpsterTest method reanalyzeDumpsterItem.

@Test
public void reanalyzeDumpsterItem() throws Exception {
    DeliveryOptions opt = new DeliveryOptions();
    opt.setFolderId(Mailbox.ID_FOLDER_INBOX);
    Message msg = mbox.addMessage(null, new ParsedMessage("From: test@zimbra.com\r\nTo: test@zimbra.com".getBytes(), false), opt, null);
    mbox.delete(null, msg.mId, MailItem.Type.MESSAGE);
    msg = (Message) mbox.getItemById(null, msg.mId, MailItem.Type.MESSAGE, true);
    try {
        ParsedMessage pm = null;
        mbox.lock.lock();
        try {
            // force the pm's received-date to be the correct one
            ParsedMessageOptions messageOptions = new ParsedMessageOptions().setContent(msg.getMimeMessage(false)).setReceivedDate(msg.getDate()).setAttachmentIndexing(mbox.attachmentsIndexingEnabled()).setSize(msg.getSize()).setDigest(msg.getDigest());
            pm = new ParsedMessage(messageOptions);
        } finally {
            mbox.lock.release();
        }
        pm.setDefaultCharset(mbox.getAccount().getPrefMailDefaultCharset());
        mbox.reanalyze(msg.mId, MailItem.Type.MESSAGE, pm, msg.getSize());
    } catch (MailServiceException e) {
        Assert.fail("should not be throwing an exception");
    }
}
Also used : ParsedMessage(com.zimbra.cs.mime.ParsedMessage) ParsedMessageOptions(com.zimbra.cs.mime.ParsedMessageOptions) ParsedMessage(com.zimbra.cs.mime.ParsedMessage) Test(org.junit.Test)

Example 2 with ParsedMessageOptions

use of com.zimbra.cs.mime.ParsedMessageOptions in project zm-mailbox by Zimbra.

the class ZimbraLmtpBackend method deliverMessageToLocalMailboxes.

private void deliverMessageToLocalMailboxes(Blob blob, BlobInputStream bis, byte[] data, MimeMessage mm, LmtpEnvelope env) throws ServiceException, IOException {
    List<LmtpAddress> recipients = env.getLocalRecipients();
    String envSender = env.getSender().getEmailAddress();
    boolean shared = recipients.size() > 1;
    List<Integer> targetMailboxIds = new ArrayList<Integer>(recipients.size());
    Map<LmtpAddress, RecipientDetail> rcptMap = new HashMap<LmtpAddress, RecipientDetail>(recipients.size());
    try {
        // Examine attachments indexing option for all recipients and
        // prepare ParsedMessage versions needed.  Parsing is done before
        // attempting delivery to any recipient.  Therefore, parse error
        // will result in non-delivery to all recipients.
        // ParsedMessage for users with attachments indexing
        ParsedMessage pmAttachIndex = null;
        // ParsedMessage for users without attachments indexing
        ParsedMessage pmNoAttachIndex = null;
        // message id for logging
        String msgId = null;
        for (LmtpAddress recipient : recipients) {
            String rcptEmail = recipient.getEmailAddress();
            Account account;
            Mailbox mbox;
            boolean attachmentsIndexingEnabled;
            try {
                account = Provisioning.getInstance().get(AccountBy.name, rcptEmail);
                if (account == null) {
                    ZimbraLog.mailbox.warn("No account found delivering mail to " + rcptEmail);
                    continue;
                }
                mbox = MailboxManager.getInstance().getMailboxByAccount(account);
                if (mbox == null) {
                    ZimbraLog.mailbox.warn("No mailbox found delivering mail to " + rcptEmail);
                    continue;
                }
                attachmentsIndexingEnabled = mbox.attachmentsIndexingEnabled();
            } catch (ServiceException se) {
                if (se.isReceiversFault()) {
                    ZimbraLog.mailbox.info("Recoverable exception getting mailbox for " + rcptEmail, se);
                    rcptMap.put(recipient, new RecipientDetail(null, null, null, false, DeliveryAction.defer));
                } else {
                    ZimbraLog.mailbox.warn("Unrecoverable exception getting mailbox for " + rcptEmail, se);
                }
                continue;
            }
            if (account != null && mbox != null) {
                ParsedMessageOptions pmo;
                if (mm != null) {
                    pmo = new ParsedMessageOptions().setContent(mm).setDigest(blob.getDigest()).setSize(blob.getRawSize());
                } else {
                    pmo = new ParsedMessageOptions(blob, data);
                }
                ParsedMessage pm;
                if (attachmentsIndexingEnabled) {
                    if (pmAttachIndex == null) {
                        pmo.setAttachmentIndexing(true);
                        ZimbraLog.lmtp.debug("Creating ParsedMessage from %s with attachment indexing enabled", data == null ? "file" : "memory");
                        pmAttachIndex = new ParsedMessage(pmo);
                    }
                    pm = pmAttachIndex;
                } else {
                    if (pmNoAttachIndex == null) {
                        pmo.setAttachmentIndexing(false);
                        ZimbraLog.lmtp.debug("Creating ParsedMessage from %s with attachment indexing disabled", data == null ? "file" : "memory");
                        pmNoAttachIndex = new ParsedMessage(pmo);
                    }
                    pm = pmNoAttachIndex;
                }
                msgId = pm.getMessageID();
                if (account.isPrefMailLocalDeliveryDisabled()) {
                    ZimbraLog.lmtp.debug("Local delivery disabled for account %s", rcptEmail);
                    rcptMap.put(recipient, new RecipientDetail(account, mbox, pm, false, DeliveryAction.discard));
                    continue;
                }
                // For non-shared delivery (i.e. only one recipient),
                // always deliver regardless of backup mode.
                DeliveryAction da = DeliveryAction.deliver;
                boolean endSharedDelivery = false;
                if (shared) {
                    if (mbox.beginSharedDelivery()) {
                        endSharedDelivery = true;
                    } else {
                        // Skip delivery to mailboxes in backup mode.
                        da = DeliveryAction.defer;
                    }
                }
                rcptMap.put(recipient, new RecipientDetail(account, mbox, pm, endSharedDelivery, da));
                if (da == DeliveryAction.deliver) {
                    targetMailboxIds.add(mbox.getId());
                }
            }
        }
        ZimbraLog.removeAccountFromContext();
        if (ZimbraLog.lmtp.isInfoEnabled()) {
            ZimbraLog.lmtp.info("Delivering message: size=%s, nrcpts=%d, sender=%s, msgid=%s", env.getSize() == 0 ? "unspecified" : Integer.toString(env.getSize()) + " bytes", recipients.size(), env.getSender(), msgId == null ? "" : msgId);
        }
        DeliveryContext sharedDeliveryCtxt = new DeliveryContext(shared, targetMailboxIds);
        sharedDeliveryCtxt.setIncomingBlob(blob);
        // version each recipient needs.  Deliver!
        for (LmtpAddress recipient : recipients) {
            String rcptEmail = recipient.getEmailAddress();
            LmtpReply reply = LmtpReply.TEMPORARY_FAILURE;
            RecipientDetail rd = rcptMap.get(recipient);
            if (rd.account != null)
                ZimbraLog.addAccountNameToContext(rd.account.getName());
            if (rd.mbox != null)
                ZimbraLog.addMboxToContext(rd.mbox.getId());
            boolean success = false;
            try {
                if (rd != null) {
                    switch(rd.action) {
                        case discard:
                            ZimbraLog.lmtp.info("accepted and discarded message from=%s,to=%s: local delivery is disabled", envSender, rcptEmail);
                            if (rd.account.getPrefMailForwardingAddress() != null) {
                                // mail forwarding is set up
                                for (LmtpCallback callback : callbacks) {
                                    ZimbraLog.lmtp.debug("Executing callback %s", callback.getClass().getName());
                                    callback.forwardWithoutDelivery(rd.account, rd.mbox, envSender, rcptEmail, rd.pm);
                                }
                            }
                            reply = LmtpReply.DELIVERY_OK;
                            break;
                        case deliver:
                            Account account = rd.account;
                            Mailbox mbox = rd.mbox;
                            ParsedMessage pm = rd.pm;
                            List<ItemId> addedMessageIds = null;
                            ReentrantLock lock = mailboxDeliveryLocks.get(mbox.getId());
                            boolean acquiredLock;
                            try {
                                // Wait for the lock, up to the timeout
                                acquiredLock = lock.tryLock(LC.zimbra_mailbox_lock_timeout.intValue(), TimeUnit.SECONDS);
                            } catch (InterruptedException e) {
                                acquiredLock = false;
                            }
                            if (!acquiredLock) {
                                ZimbraLog.lmtp.info("try again for message from=%s,to=%s: another mail delivery in progress.", envSender, rcptEmail);
                                reply = LmtpReply.TEMPORARY_FAILURE;
                                break;
                            }
                            try {
                                if (dedupe(pm, mbox)) {
                                    // message was already delivered to this mailbox
                                    ZimbraLog.lmtp.info("Not delivering message with duplicate Message-ID %s", pm.getMessageID());
                                } else if (mbox.dedupeForSelfMsg(pm)) {
                                    ZimbraLog.mailbox.info("not delivering message, because it is a duplicate of sent message %s", pm.getMessageID());
                                } else if (recipient.getSkipFilters()) {
                                    msgId = pm.getMessageID();
                                    int folderId = Mailbox.ID_FOLDER_INBOX;
                                    if (recipient.getFolder() != null) {
                                        try {
                                            Folder folder = mbox.getFolderByPath(null, recipient.getFolder());
                                            folderId = folder.getId();
                                        } catch (ServiceException se) {
                                            if (se.getCode().equals(MailServiceException.NO_SUCH_FOLDER)) {
                                                Folder folder = mbox.createFolder(null, recipient.getFolder(), new Folder.FolderOptions().setDefaultView(MailItem.Type.MESSAGE));
                                                folderId = folder.getId();
                                            } else {
                                                throw se;
                                            }
                                        }
                                    }
                                    int flags = Flag.BITMASK_UNREAD;
                                    if (recipient.getFlags() != null) {
                                        flags = Flag.toBitmask(recipient.getFlags());
                                    }
                                    DeliveryOptions dopt = new DeliveryOptions().setFolderId(folderId);
                                    dopt.setFlags(flags).setTags(recipient.getTags()).setRecipientEmail(rcptEmail);
                                    Message msg = mbox.addMessage(null, pm, dopt, sharedDeliveryCtxt);
                                    addedMessageIds = Lists.newArrayList(new ItemId(msg));
                                } else if (!DebugConfig.disableIncomingFilter) {
                                    // Get msgid first, to avoid having to reopen and reparse the blob
                                    // file if Mailbox.addMessageInternal() closes it.
                                    pm.getMessageID();
                                    addedMessageIds = RuleManager.applyRulesToIncomingMessage(null, mbox, pm, (int) blob.getRawSize(), rcptEmail, env, sharedDeliveryCtxt, Mailbox.ID_FOLDER_INBOX, false, true);
                                } else {
                                    pm.getMessageID();
                                    DeliveryOptions dopt = new DeliveryOptions().setFolderId(Mailbox.ID_FOLDER_INBOX);
                                    dopt.setFlags(Flag.BITMASK_UNREAD).setRecipientEmail(rcptEmail);
                                    Message msg = mbox.addMessage(null, pm, dopt, sharedDeliveryCtxt);
                                    addedMessageIds = Lists.newArrayList(new ItemId(msg));
                                }
                                success = true;
                                if (addedMessageIds != null && addedMessageIds.size() > 0) {
                                    addToDedupeCache(pm, mbox);
                                }
                            } finally {
                                lock.unlock();
                            }
                            if (addedMessageIds != null && addedMessageIds.size() > 0) {
                                // Execute callbacks
                                for (LmtpCallback callback : callbacks) {
                                    for (ItemId id : addedMessageIds) {
                                        if (id.belongsTo(mbox)) {
                                            // Message was added to the local mailbox, as opposed to a mountpoint.
                                            ZimbraLog.lmtp.debug("Executing callback %s", callback.getClass().getName());
                                            try {
                                                Message msg = mbox.getMessageById(null, id.getId());
                                                callback.afterDelivery(account, mbox, envSender, rcptEmail, msg);
                                            } catch (Throwable t) {
                                                if (t instanceof OutOfMemoryError) {
                                                    Zimbra.halt("LMTP callback failed", t);
                                                } else {
                                                    ZimbraLog.lmtp.warn("LMTP callback threw an exception", t);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            reply = LmtpReply.DELIVERY_OK;
                            break;
                        case defer:
                            // Delivery to mailbox skipped.  Let MTA retry again later.
                            // This case happens for shared delivery to a mailbox in
                            // backup mode.
                            ZimbraLog.lmtp.info("try again for message from=%s,to=%s: mailbox skipped", envSender, rcptEmail);
                            reply = LmtpReply.TEMPORARY_FAILURE;
                            break;
                    }
                } else {
                    // Account or mailbox not found.
                    ZimbraLog.lmtp.info("rejecting message from=%s,to=%s: account or mailbox not found", envSender, rcptEmail);
                    reply = LmtpReply.PERMANENT_FAILURE;
                }
            } catch (DeliveryServiceException e) {
                ZimbraLog.lmtp.info("rejecting message from=%s,to=%s: sieve filter rule", envSender, rcptEmail);
                reply = LmtpReply.PERMANENT_MESSAGE_REFUSED;
            } catch (ServiceException e) {
                if (e.getCode().equals(MailServiceException.QUOTA_EXCEEDED)) {
                    ZimbraLog.lmtp.info("rejecting message from=%s,to=%s: overquota", envSender, rcptEmail);
                    if (config.isPermanentFailureWhenOverQuota()) {
                        reply = LmtpReply.PERMANENT_FAILURE_OVER_QUOTA;
                    } else {
                        reply = LmtpReply.TEMPORARY_FAILURE_OVER_QUOTA;
                    }
                } else if (e.isReceiversFault()) {
                    ZimbraLog.lmtp.info("try again for message from=%s,to=%s", envSender, rcptEmail, e);
                    reply = LmtpReply.TEMPORARY_FAILURE;
                } else {
                    ZimbraLog.lmtp.info("rejecting message from=%s,to=%s", envSender, rcptEmail, e);
                    reply = LmtpReply.PERMANENT_FAILURE;
                }
            } catch (Exception e) {
                reply = LmtpReply.TEMPORARY_FAILURE;
                ZimbraLog.lmtp.warn("try again for message from=%s,to=%s", envSender, rcptEmail, e);
            } finally {
                if (rd.action == DeliveryAction.deliver && !success) {
                    // Message was not delivered.  Remove it from the dedupe
                    // cache so we don't dedupe it on LMTP retry.
                    removeFromDedupeCache(msgId, rd.mbox);
                }
                recipient.setDeliveryStatus(reply);
                if (shared && rd != null && rd.esd) {
                    rd.mbox.endSharedDelivery();
                    rd.esd = false;
                }
            }
        }
        // If this message is being streamed from disk, cache it
        ParsedMessage mimeSource = pmAttachIndex != null ? pmAttachIndex : pmNoAttachIndex;
        MailboxBlob mblob = sharedDeliveryCtxt.getMailboxBlob();
        if (mblob != null && mimeSource != null) {
            if (bis == null) {
                bis = mimeSource.getBlobInputStream();
            }
            if (bis != null) {
                try {
                    // Update the MimeMessage with the blob that's stored inside the mailbox,
                    // since the incoming blob will be deleted.
                    Blob storedBlob = mblob.getLocalBlob();
                    bis.fileMoved(storedBlob.getFile());
                    MessageCache.cacheMessage(mblob.getDigest(), mimeSource.getOriginalMessage(), mimeSource.getMimeMessage());
                } catch (IOException e) {
                    ZimbraLog.lmtp.warn("Unable to cache message for " + mblob, e);
                }
            }
        }
    } finally {
        // called, we check and fix those here.
        if (shared) {
            for (RecipientDetail rd : rcptMap.values()) {
                if (rd.esd && rd.mbox != null)
                    rd.mbox.endSharedDelivery();
            }
        }
    }
}
Also used : Account(com.zimbra.cs.account.Account) ParsedMessage(com.zimbra.cs.mime.ParsedMessage) Message(com.zimbra.cs.mailbox.Message) MimeMessage(javax.mail.internet.MimeMessage) HashMap(java.util.HashMap) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) ArrayList(java.util.ArrayList) Folder(com.zimbra.cs.mailbox.Folder) ItemId(com.zimbra.cs.service.util.ItemId) DeliveryServiceException(com.zimbra.common.service.DeliveryServiceException) Mailbox(com.zimbra.cs.mailbox.Mailbox) DeliveryContext(com.zimbra.cs.mailbox.DeliveryContext) DeliveryOptions(com.zimbra.cs.mailbox.DeliveryOptions) ReentrantLock(java.util.concurrent.locks.ReentrantLock) Blob(com.zimbra.cs.store.Blob) MailboxBlob(com.zimbra.cs.store.MailboxBlob) ParsedMessageOptions(com.zimbra.cs.mime.ParsedMessageOptions) MailboxBlob(com.zimbra.cs.store.MailboxBlob) ParsedMessage(com.zimbra.cs.mime.ParsedMessage) IOException(java.io.IOException) MessagingException(javax.mail.MessagingException) LmtpProtocolException(com.zimbra.common.lmtp.LmtpProtocolException) ServiceException(com.zimbra.common.service.ServiceException) IOException(java.io.IOException) DeliveryServiceException(com.zimbra.common.service.DeliveryServiceException) MailServiceException(com.zimbra.cs.mailbox.MailServiceException) ServiceException(com.zimbra.common.service.ServiceException) DeliveryServiceException(com.zimbra.common.service.DeliveryServiceException) MailServiceException(com.zimbra.cs.mailbox.MailServiceException)

Example 3 with ParsedMessageOptions

use of com.zimbra.cs.mime.ParsedMessageOptions in project zm-mailbox by Zimbra.

the class Mailbox method addMessage.

public Message addMessage(OperationContext octxt, InputStream in, long sizeHint, Long receivedDate, DeliveryOptions dopt, DeliveryContext dctxt, ItemData id) throws IOException, ServiceException {
    int bufLen = Provisioning.getInstance().getLocalServer().getMailDiskStreamingThreshold();
    CopyInputStream cs = new CopyInputStream(in, sizeHint, bufLen, bufLen);
    in = cs;
    Blob blob = null;
    try {
        BufferStream bs = cs.getBufferStream();
        ParsedMessage pm = null;
        Rfc822ValidationInputStream validator = null;
        if (LC.zimbra_lmtp_validate_messages.booleanValue()) {
            validator = new Rfc822ValidationInputStream(cs, LC.zimbra_lmtp_max_line_length.longValue());
            in = validator;
        }
        blob = StoreManager.getInstance().storeIncoming(in);
        if (id != null && id.ud != null && id.ud.getBlobDigest() != null && !id.ud.getBlobDigest().isEmpty()) {
            blob.setDigest(id.ud.getBlobDigest());
        }
        if (validator != null && !validator.isValid()) {
            StoreManager.getInstance().delete(blob);
            throw ServiceException.INVALID_REQUEST("Message content is invalid.", null);
        }
        pm = new ParsedMessage(new ParsedMessageOptions(blob, bs.isPartial() ? null : bs.getBuffer(), receivedDate, attachmentsIndexingEnabled()));
        cs.release();
        if (dctxt == null) {
            dctxt = new DeliveryContext();
        }
        dctxt.setIncomingBlob(blob);
        return addMessage(octxt, pm, dopt, dctxt);
    } finally {
        cs.release();
        StoreManager.getInstance().quietDelete(blob);
    }
}
Also used : BufferStream(com.zimbra.common.util.BufferStream) StoreIncomingBlob(com.zimbra.cs.redolog.op.StoreIncomingBlob) StagedBlob(com.zimbra.cs.store.StagedBlob) MailboxBlob(com.zimbra.cs.store.MailboxBlob) Blob(com.zimbra.cs.store.Blob) ParsedMessageOptions(com.zimbra.cs.mime.ParsedMessageOptions) ParsedMessage(com.zimbra.cs.mime.ParsedMessage) CopyInputStream(com.zimbra.common.util.CopyInputStream) Rfc822ValidationInputStream(com.zimbra.common.mime.Rfc822ValidationInputStream) RefreshMountpoint(com.zimbra.cs.redolog.op.RefreshMountpoint) TargetConstraint(com.zimbra.cs.mailbox.MailItem.TargetConstraint) CreateMountpoint(com.zimbra.cs.redolog.op.CreateMountpoint)

Example 4 with ParsedMessageOptions

use of com.zimbra.cs.mime.ParsedMessageOptions in project zm-mailbox by Zimbra.

the class CreateMessage method redo.

@Override
public void redo() throws Exception {
    int mboxId = getMailboxId();
    Mailbox mbox = MailboxManager.getInstance().getMailboxById(mboxId);
    OperationContext octxt = getOperationContext();
    if (mTags == null && mTagIds != null) {
        mTags = TagUtil.tagIdStringToNames(mbox, octxt, mTagIds);
    }
    DeliveryContext dctxt = new DeliveryContext(mShared, Arrays.asList(mboxId));
    if (mMsgBodyType == MSGBODY_LINK) {
        Blob blob = StoreIncomingBlob.fetchBlob(mPath);
        if (blob == null)
            throw new RedoException("Missing link source blob " + mPath + " (digest=" + mDigest + ")", this);
        dctxt.setIncomingBlob(blob);
        ParsedMessage pm = null;
        try {
            ParsedMessageOptions opt = new ParsedMessageOptions().setContent(blob.getFile()).setReceivedDate(mReceivedDate).setAttachmentIndexing(mbox.attachmentsIndexingEnabled()).setSize(mMsgSize).setDigest(mDigest);
            pm = new ParsedMessage(opt);
            mbox.addMessage(octxt, pm, getDeliveryOptions(), dctxt);
        } catch (MailServiceException e) {
            if (e.getCode() == MailServiceException.ALREADY_EXISTS) {
                mLog.info("Message " + mMsgId + " is already in mailbox " + mboxId);
                return;
            } else {
                throw e;
            }
        } finally {
            if (pm != null) {
                ByteUtil.closeStream(pm.getBlobInputStream());
            }
        }
    } else {
        // mMsgBodyType == MSGBODY_INLINE
        // Just one recipient.  Blob data is stored inline.
        InputStream in = null;
        try {
            in = mData.getInputStream();
            if (mData.getLength() != mMsgSize) {
                in = new GZIPInputStream(in);
            }
            mbox.addMessage(octxt, in, mMsgSize, mReceivedDate, getDeliveryOptions(), dctxt);
        } catch (MailServiceException e) {
            if (e.getCode() == MailServiceException.ALREADY_EXISTS) {
                mLog.info("Message " + mMsgId + " is already in mailbox " + mboxId);
                return;
            } else {
                throw e;
            }
        } finally {
            ByteUtil.closeStream(in);
        }
    }
}
Also used : OperationContext(com.zimbra.cs.mailbox.OperationContext) GZIPInputStream(java.util.zip.GZIPInputStream) Blob(com.zimbra.cs.store.Blob) Mailbox(com.zimbra.cs.mailbox.Mailbox) ParsedMessageOptions(com.zimbra.cs.mime.ParsedMessageOptions) ParsedMessage(com.zimbra.cs.mime.ParsedMessage) GZIPInputStream(java.util.zip.GZIPInputStream) InputStream(java.io.InputStream) MailServiceException(com.zimbra.cs.mailbox.MailServiceException) DeliveryContext(com.zimbra.cs.mailbox.DeliveryContext) RedoException(com.zimbra.cs.redolog.RedoException)

Example 5 with ParsedMessageOptions

use of com.zimbra.cs.mime.ParsedMessageOptions in project zm-mailbox by Zimbra.

the class ExistingMessageHandler method getParsedMessage.

@Override
public ParsedMessage getParsedMessage() throws ServiceException {
    if (parsedMessage == null) {
        Message msg = getMessage();
        ParsedMessageOptions opt = new ParsedMessageOptions().setContent(msg.getMimeMessage()).setAttachmentIndexing(mailbox.attachmentsIndexingEnabled()).setSize(msg.getSize()).setDigest(msg.getDigest());
        parsedMessage = new ParsedMessage(opt);
    }
    return parsedMessage;
}
Also used : MimeMessage(javax.mail.internet.MimeMessage) Message(com.zimbra.cs.mailbox.Message) ParsedMessage(com.zimbra.cs.mime.ParsedMessage) ParsedMessageOptions(com.zimbra.cs.mime.ParsedMessageOptions) ParsedMessage(com.zimbra.cs.mime.ParsedMessage)

Aggregations

ParsedMessage (com.zimbra.cs.mime.ParsedMessage)6 ParsedMessageOptions (com.zimbra.cs.mime.ParsedMessageOptions)6 Blob (com.zimbra.cs.store.Blob)3 DeliveryContext (com.zimbra.cs.mailbox.DeliveryContext)2 MailServiceException (com.zimbra.cs.mailbox.MailServiceException)2 Mailbox (com.zimbra.cs.mailbox.Mailbox)2 Message (com.zimbra.cs.mailbox.Message)2 MailboxBlob (com.zimbra.cs.store.MailboxBlob)2 MimeMessage (javax.mail.internet.MimeMessage)2 LmtpProtocolException (com.zimbra.common.lmtp.LmtpProtocolException)1 Rfc822ValidationInputStream (com.zimbra.common.mime.Rfc822ValidationInputStream)1 DeliveryServiceException (com.zimbra.common.service.DeliveryServiceException)1 ServiceException (com.zimbra.common.service.ServiceException)1 BufferStream (com.zimbra.common.util.BufferStream)1 CopyInputStream (com.zimbra.common.util.CopyInputStream)1 Account (com.zimbra.cs.account.Account)1 DeliveryOptions (com.zimbra.cs.mailbox.DeliveryOptions)1 Folder (com.zimbra.cs.mailbox.Folder)1 TargetConstraint (com.zimbra.cs.mailbox.MailItem.TargetConstraint)1 OperationContext (com.zimbra.cs.mailbox.OperationContext)1