## KolabMailInfoDb KolabMailInfoDb — deal with MIME message parts and whole MIME messages |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    struct              KolabMailMimeBuilderClass;
    gboolean            kolab_mail_mime_builder_bringup     (KolabMailMimeBuilder *self,
                                                             GError **err);
    CamelMimeMessage *  kolab_mail_mime_builder_camel_new_from_conv
                                                            (KolabMailMimeBuilder *self,
                                                             const Kolab_conv_mail *kconvmail,
                                                             GCancellable *cancellable,
                                                             GError **err);
    gboolean            kolab_mail_mime_builder_camel_set_header
                                                            (KolabMailMimeBuilder *self,
                                                             CamelMimeMessage *message,
                                                             const KolabMailMimeBuilderHeaderInfo *headerinfo,
                                                             CamelMimeMessage *orig_message,
                                                             GError **err);
    gboolean            kolab_mail_mime_builder_configure   (KolabMailMimeBuilder *self,
                                                             KolabSettingsHandler *ksettings,
                                                             GError **err);
    Kolab_conv_mail *   kolab_mail_mime_builder_conv_new_from_camel
                                                            (KolabMailMimeBuilder *self,
                                                             const CamelMimeMessage *message,
                                                             GCancellable *cancellable,
                                                             GError **err);
    gboolean            kolab_mail_mime_builder_shutdown    (KolabMailMimeBuilder *self,
                                                             GError **err);

## Description

This class constructs MIME messages (or message parts) from Kolab_conv_mail data and vice versa. It also contains facility for data checksumming.

The MIME messages are read from and fed to the KolabMailImapClient as well as the KolabMailSideCache. They (need to) carry header information which are not part of Kolab_conv_mail, so header info needs to be (re)constructed from email data. In the backends, we do operate mainly on "subject" MIME header information, which carries the Kolab-UID, and the IMAP-UID for finding messages in KolabMailImapClient quickly.

Serialized MIME message parts are read from and fed to KolabMailSideCache. This is used for newly created PIM mails when in offline mode. No MIME header information needs to be stored, it will be created on-the-fly once the KolabMailSideCache contents gets synced in online mode.

## Details

### struct KolabMailMimeBuilderClass

    struct KolabMailMimeBuilderClass {
    	GObjectClass parent_class;
    };

### kolab_mail_mime_builder_bringup ()

    gboolean            kolab_mail_mime_builder_bringup     (KolabMailMimeBuilder *self,
                                                             GError **err);

### kolab_mail_mime_builder_camel_new_from_conv ()

    CamelMimeMessage *  kolab_mail_mime_builder_camel_new_from_conv
                                                            (KolabMailMimeBuilder *self,
                                                             const Kolab_conv_mail *kconvmail,
                                                             GCancellable *cancellable,
                                                             GError **err);

### kolab_mail_mime_builder_camel_set_header ()

    gboolean            kolab_mail_mime_builder_camel_set_header
                                                            (KolabMailMimeBuilder *self,
                                                             CamelMimeMessage *message,
                                                             const KolabMailMimeBuilderHeaderInfo *headerinfo,
                                                             CamelMimeMessage *orig_message,
                                                             GError **err);

### kolab_mail_mime_builder_configure ()

    gboolean            kolab_mail_mime_builder_configure   (KolabMailMimeBuilder *self,
                                                             KolabSettingsHandler *ksettings,
                                                             GError **err);

### kolab_mail_mime_builder_conv_new_from_camel ()

    Kolab_conv_mail *   kolab_mail_mime_builder_conv_new_from_camel
                                                            (KolabMailMimeBuilder *self,
                                                             const CamelMimeMessage *message,
                                                             GCancellable *cancellable,
                                                             GError **err);

### kolab_mail_mime_builder_shutdown ()

    gboolean            kolab_mail_mime_builder_shutdown    (KolabMailMimeBuilder *self,
                                                             GError **err);

## See Also

KolabMailAccess, KolabMailSynchronizer, KolabMailImapClient, KolabMailSideCache