select storage_type from cr_items where item_id = :content_item_id select content, mime_type as v_content_type from cr_revisions where revision_id = :revision_id select mime_filename, mime_disposition, content_item_id as ci_id from acs_mail_multipart_parts where multipart_id = :content_item_id order by sequence_number select body_id from acs_mail_links where mail_link_id = :link_id select header_message_id, header_reply_to, header_subject, header_from, header_to, content_item_id from acs_mail_bodies where body_id = :body_id select header_name, header_content from acs_mail_body_headers where body_id = :body_id select message_id, envelope_from, envelope_to from acs_mail_queue_outgoing delete from acs_mail_queue_outgoing where message_id = :message_id and envelope_from = :envelope_from and envelope_to = :envelope_to delete from acs_mail_queue_messages where message_id not in (select message_id from acs_mail_queue_outgoing) and message_id not in (select message_id from acs_mail_queue_incoming) select multipart_kind from acs_mail_multiparts where multipart_id = :object_id select body_id from acs_mail_links where mail_link_id = :link_id