Change encryption to work on OOM
* src/attachment.cpp (Attachment::Attachment(LPDISPATCH)): New. Construct an in memory representation of an attachment object. (Attachment::get_file_name): New, sometimes it differs from display name. (Attachment::copy_to): Move logic here from mail.cpp (Attachment::olAttachmentType): New enum. * src/cryptcontroller.cpp (CryptController::collect_data): Move out attachment handling. Use new data from mail object. * src/mail.cpp (copy_attachment_to_file): Moved into attachment class. (Mail::updateOOMData_o): Collect data of attachments, write out mail to tmp file to do serialization. (Mail::checkSyncCrypto_o): For now disable sync for attachments. (Mail::isMultipartRelated): New. Moved from mimemaker. (Mail::plainAttachments): New data object to carry attachment data. * src/mailitem-events.cpp (SEND): Directly encrypt. Don't wait for AfterWrite. * src/main.c (read_options): Remove syncEnc override. * src/mimemaker.cpp (write_attachments): Use mail object. (add_body_and_attachments): Use mail object.
by working only on the outlook object model and avoiding
a sync to MAPI which might cause a server sync depending
on the MAPIStore implementation.
This will also help us to allow attaching mails and other
outlook objects because we now have better control about this.
- GnuPG-Bug-Id: T5022