From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Thu, 19 Jun 2025 10:25:55 +0200
Subject: [PATCH] Adapt to libcamel API changes in 3.57.1

The evolution-data-server 3.57.1 release contains API changes in libcamel,
which are incompatible with the previous versions. Bump the libcamel version
requirement, update the camel-1.2.vapi file and modify the sources accordingly.
---
 meson.build                                   |    2 +-
 src/Backend/MoveOperation.vala                |    9 +-
 .../ConversationItemModel.vala                |   30 +-
 src/ConversationList/ConversationList.vala    |   42 +-
 src/MessageList/MessageList.vala              |   22 +-
 vapi/camel-1.2.vapi                           | 1129 ++++++++++-------
 6 files changed, 733 insertions(+), 501 deletions(-)

diff --git a/meson.build b/meson.build
index e7f8d8405a8a..7af2e2b4bfd5 100644
--- a/meson.build
+++ b/meson.build
@@ -15,7 +15,7 @@ gobject_dep = dependency('gobject-2.0')
 granite_dep = dependency('granite', version: '>= 6.0.0')
 gee_dep = dependency('gee-0.8')
 handy_dep = dependency('libhandy-1', version: '>=1.1.90')
-camel_dep = dependency('camel-1.2', version: '>= 3.28')
+camel_dep = dependency('camel-1.2', version: '>= 3.57.1')
 libedataserver_dep = dependency('libedataserver-1.2', version: '>= 3.28')
 libedataserverui_dep = dependency('libedataserverui-1.2', version: '>= 3.28')
 if libedataserverui_dep.version().version_compare('>=3.45.1')
diff --git a/src/Backend/MoveOperation.vala b/src/Backend/MoveOperation.vala
index 0149461bfc7f..951a3ccdd1b1 100644
--- a/src/Backend/MoveOperation.vala
+++ b/src/Backend/MoveOperation.vala
@@ -189,36 +189,35 @@ public class Mail.MoveOperation : Object {
             var vee_folder = (Camel.VeeFolder)src_folder;
 
             store = null;
-            unowned Camel.Folder? orig_folder = null;
 
             foreach (unowned Camel.MessageInfo message in moved_messages) {
-                orig_folder = vee_folder.get_vee_uid_folder (message.uid);
+                Camel.Folder? orig_folder = vee_folder.dup_vee_uid_folder (message.uid);
                 if (orig_folder != null) {
                     if (store != null && orig_folder.get_parent_store () != store) {
                         // Don't know which archive folder to use when messages are from
                         // multiple accounts/stores
                         store = null;
                         break;
                     }
 
                     store = (Camel.Store)orig_folder.get_parent_store ();
                 }
             }
         }
 
         if (store != null) {
             return Backend.Session.get_default ().get_archive_folder_uri_for_service (store);
         }
 
         return null;
     }
 
     private async void collect_thread_messages (Camel.FolderThreadNode thread) {
-        moved_messages.add (thread.message);
-        unowned Camel.FolderThreadNode? child = (Camel.FolderThreadNode?) thread.child;
+        moved_messages.add ((Camel.MessageInfo?) thread.get_item ());
+        unowned Camel.FolderThreadNode? child = (Camel.FolderThreadNode?) thread.get_child ();
         while (child != null) {
             yield collect_thread_messages (child);
-            child = (Camel.FolderThreadNode?) child.next;
+            child = (Camel.FolderThreadNode?) child.get_next ();
         }
     }
 
diff --git a/src/ConversationList/ConversationItemModel.vala b/src/ConversationList/ConversationItemModel.vala
index d299b9cfe7b2..6badbefae53d 100644
--- a/src/ConversationList/ConversationItemModel.vala
+++ b/src/ConversationList/ConversationItemModel.vala
@@ -46,199 +46,199 @@ public class Mail.ConversationItemModel : GLib.Object {
 
             unowned Camel.FolderThreadNode? current_node = node;
             while (current_node != null) {
-                weak Camel.MessageInfo? message = current_node.message;
+                weak Camel.MessageInfo? message = (Camel.MessageInfo?) current_node.get_item ();
                 if (message != null) {
                     var address = new Camel.InternetAddress ();
                     if (address.decode (message.from) > 0) {
                         unowned string? ia_name;
                         unowned string? ia_address;
 
                         string sender;
                         address.get (0, out ia_name, out ia_address);
                         if (ia_name != null && ia_name != "") {
                             sender = ia_name;
                         } else {
                             sender = ia_address;
                         }
 
                         if (!(sender in senders)) {
                             senders += sender;
                         }
                     }
                 }
 
-                current_node = (Camel.FolderThreadNode?) current_node.child;
+                current_node = (Camel.FolderThreadNode?) current_node.get_child ();
             }
 
             if (senders.length > 0) {
                 return string.joinv (_(", "), senders);
             }
 
             return _("Unknown");
         }
     }
 
     public string to {
         owned get {
             string[] recipients = {};
 
             unowned Camel.FolderThreadNode? current_node = node;
             while (current_node != null) {
-                weak Camel.MessageInfo? message = current_node.message;
+                weak Camel.MessageInfo? message = (Camel.MessageInfo?) current_node.get_item ();
                 if (message != null) {
                     var address = new Camel.InternetAddress ();
                     if (address.decode (message.to) > 0) {
                         unowned string? ia_name;
                         unowned string? ia_address;
 
                         string recipient;
                         address.get (0, out ia_name, out ia_address);
                         if (ia_name != null && ia_name != "") {
                             recipient = ia_name;
                         } else {
                             recipient = ia_address;
                         }
 
                         if (!(recipient in recipients)) {
                             recipients += recipient;
                         }
                     }
                 }
 
-                current_node = (Camel.FolderThreadNode?) current_node.child;
+                current_node = (Camel.FolderThreadNode?) current_node.get_child ();
             }
 
             if (recipients.length > 0) {
                 return string.joinv (_(", "), recipients);
             }
 
             return _("Unknown");
         }
     }
 
     public string subject {
         get {
-            weak Camel.MessageInfo? message = node.message;
+            weak Camel.MessageInfo? message = (Camel.MessageInfo?) node.get_item ();
             if (message == null) {
                 return _("Unknown");
             }
 
             return message.subject;
         }
     }
 
     public bool flagged {
         get {
-            weak Camel.MessageInfo? message = node.message;
+            weak Camel.MessageInfo? message = (Camel.MessageInfo?) node.get_item ();
             if (message == null) {
                 return false;
             }
 
             return Camel.MessageFlags.FLAGGED in (int)message.flags;
         }
     }
 
     public bool forwarded {
         get {
-            weak Camel.MessageInfo? message = node.message;
+            weak Camel.MessageInfo? message = (Camel.MessageInfo?) node.get_item ();
             if (message == null) {
                 return false;
             }
 
             return Camel.MessageFlags.FORWARDED in (int)message.flags;
         }
     }
 
     public bool replied {
         get {
-            weak Camel.MessageInfo? message = node.message;
+            weak Camel.MessageInfo? message = (Camel.MessageInfo?) node.get_item ();
             if (message == null) {
                 return false;
             }
 
             return Camel.MessageFlags.ANSWERED in (int)message.flags;
         }
     }
 
     public bool replied_all {
         get {
-            weak Camel.MessageInfo? message = node.message;
+            weak Camel.MessageInfo? message = (Camel.MessageInfo?) node.get_item ();
             if (message == null) {
                 return false;
             }
 
             return Camel.MessageFlags.ANSWERED_ALL in (int)message.flags;
         }
     }
 
     public bool unread {
         get {
             return has_thread_flag (node, Camel.MessageFlags.SEEN);
         }
     }
 
     public bool deleted {
         get {
-            weak Camel.MessageInfo? message = node.message;
+            weak Camel.MessageInfo? message = (Camel.MessageInfo?) node.get_item ();
             if (message == null) {
                 return false;
             }
 
             return Camel.MessageFlags.DELETED in (int)message.flags;
         }
     }
 
     public ConversationItemModel (Camel.FolderInfoFlags folder_info_flags, Camel.FolderThreadNode node, Camel.FolderThread thread, string service_uid) {
         Object (service_uid: service_uid, node: node, thread: thread, folder_info_flags: folder_info_flags);
     }
 
     construct {
         timestamp = get_newest_timestamp (node, -1);
     }
 
     public bool is_older_than (Camel.FolderThreadNode other_node) {
         var other_timestamp = get_newest_timestamp (other_node, -1);
 
         return (timestamp < other_timestamp);
     }
 
     private static uint count_thread_messages (Camel.FolderThreadNode node) {
         uint i = 1;
-        for (unowned Camel.FolderThreadNode? child = node.child; child != null; child = child.next) {
+        for (unowned Camel.FolderThreadNode? child = node.get_child (); child != null; child = child.get_next ()) {
             i += count_thread_messages (child);
         }
 
         return i;
     }
 
     private static int64 get_newest_timestamp (Camel.FolderThreadNode? node, int64 highest = -1) {
         int64 time = highest;
         if (node == null) {
             return time;
         }
 
-        weak Camel.MessageInfo? message = node.message;
+        weak Camel.MessageInfo? message = (Camel.MessageInfo?) node.get_item ();
         if (message != null) {
             time = int64.max (time, message.date_received);
             time = int64.max (time, message.date_sent);
         }
 
-        for (unowned Camel.FolderThreadNode? child = node.child; child != null; child = child.next) {
+        for (unowned Camel.FolderThreadNode? child = node.get_child (); child != null; child = child.get_next ()) {
             time = get_newest_timestamp (child, time);
         }
 
         return time;
     }
 
     private static bool has_thread_flag (Camel.FolderThreadNode? node, Camel.MessageFlags flag) {
         if (node == null) {
             return false;
         }
 
-        var has_flag = !(flag in (int)node.message.flags);
+        var has_flag = !(flag in (int)((Camel.MessageInfo?) node.get_item ()).flags);
 
         if (!has_flag) {
-            for (unowned Camel.FolderThreadNode? child = node.child; child != null; child = child.next) {
+            for (unowned Camel.FolderThreadNode? child = node.get_child (); child != null; child = child.get_next ()) {
                 has_flag = has_thread_flag (child, flag);
                 if (has_flag) {
                     break;
diff --git a/src/ConversationList/ConversationList.vala b/src/ConversationList/ConversationList.vala
index 2c3159db706d..af5d764fb8f6 100644
--- a/src/ConversationList/ConversationList.vala
+++ b/src/ConversationList/ConversationList.vala
@@ -213,11 +213,11 @@ public class Mail.ConversationList : Gtk.Box {
             return;
         }
 
-        if (!(flag in (int)node.message.flags)) {
-            node.message.set_flags (flag, ~0);
+        if (!(flag in (int)((Camel.MessageInfo?) node.get_item ()).flags)) {
+            ((Camel.MessageInfo?) node.get_item ()).set_flags (flag, ~0);
         }
 
-        for (unowned Camel.FolderThreadNode? child = node.child; child != null; child = child.next) {
+        for (unowned Camel.FolderThreadNode? child = node.get_child (); child != null; child = child.get_next ()) {
             set_thread_flag (child, flag);
         }
     }
@@ -269,17 +269,17 @@ public class Mail.ConversationList : Gtk.Box {
 
                                 var search_result_uids = get_search_result_uids (current_account.service.uid);
                                 if (search_result_uids != null) {
-                                    var thread = new Camel.FolderThread (folder, search_result_uids, false);
+                                    var thread = new Camel.FolderThread (folder, (GLib.GenericArray<string>?) search_result_uids, Camel.FolderThreadFlags.NONE);
                                     threads[current_account.service.uid] = thread;
 
-                                    weak Camel.FolderThreadNode? child = thread.tree;
+                                    weak Camel.FolderThreadNode? child = thread.get_tree ();
                                     while (child != null) {
                                         if (cancellable.is_cancelled ()) {
                                             break;
                                         }
 
                                         add_conversation_item (folder_info_flags[current_account.service.uid], child, thread, current_account.service.uid);
-                                        child = child.next;
+                                        child = child.get_next ();
                                     }
                                 }
                             } catch (Error e) {
@@ -326,141 +326,143 @@ public class Mail.ConversationList : Gtk.Box {
                     return;
                 }
 
-                threads[service_uid] = new Camel.FolderThread (folders[service_uid], search_result_uids, false);
+                threads[service_uid] = new Camel.FolderThread (folders[service_uid], (GLib.GenericArray<string>?) search_result_uids, Camel.FolderThreadFlags.NONE);
 
                 var removed = 0;
                 change_info.get_removed_uids ().foreach ((uid) => {
                     var item = conversations[uid];
                     if (item != null) {
                         conversations.unset (uid);
                         list_store.remove (item);
                         removed++;
                     }
                 });
 
-                unowned Camel.FolderThreadNode? child = threads[service_uid].tree;
+                unowned Camel.FolderThreadNode? child = threads[service_uid].get_tree ();
                 while (child != null) {
                     if (cancellable.is_cancelled ()) {
                         return;
                     }
 
-                    var item = conversations[child.message.uid];
+                    var item = conversations[((Camel.MessageInfo?) child.get_item ()).uid];
                     if (item == null) {
                         add_conversation_item (folder_info_flags[service_uid], child, threads[service_uid], service_uid);
                     } else {
                         if (item.is_older_than (child)) {
-                            conversations.unset (child.message.uid);
+                            conversations.unset (((Camel.MessageInfo?) child.get_item ()).uid);
                             list_store.remove (item);
                             removed++;
                             add_conversation_item (folder_info_flags[service_uid], child, threads[service_uid], service_uid);
                         };
                     }
 
-                    child = child.next;
+                    child = child.get_next ();
                 }
 
                 list_store.items_changed (0, removed, list_store.get_n_items ());
             }
         }
     }
 
-    private GenericArray<string>? get_search_result_uids (string service_uid) {
+    private GenericArray<weak string>? get_search_result_uids (string service_uid) {
         var style_context = filter_button.get_style_context ();
         if (hide_read_switch.active || hide_unstarred_switch.active) {
             if (!style_context.has_class (Granite.STYLE_CLASS_ACCENT)) {
                 style_context.add_class (Granite.STYLE_CLASS_ACCENT);
             }
         } else if (style_context.has_class (Granite.STYLE_CLASS_ACCENT)) {
             style_context.remove_class (Granite.STYLE_CLASS_ACCENT);
         }
 
         lock (folders) {
             if (folders[service_uid] == null) {
                 return null;
             }
 
             var has_current_search_query = search_entry.text.strip () != "";
             if (!has_current_search_query && !hide_read_switch.active && !hide_unstarred_switch.active) {
-                return folders[service_uid].get_uids ();
+                return folders[service_uid].dup_uids ();
             }
 
             string[] current_search_expressions = {};
 
             if (hide_read_switch.active) {
                 current_search_expressions += """(not (system-flag "Seen"))""";
             }
 
             if (hide_unstarred_switch.active) {
                 current_search_expressions += """(system-flag "Flagged")""";
             }
 
             if (has_current_search_query) {
                 var sb = new StringBuilder ();
                 Camel.SExp.encode_string (sb, search_entry.text);
                 var encoded_query = sb.str;
 
                 current_search_expressions += """(or (header-contains "From" %s)(header-contains "Subject" %s)(body-contains %s))"""
                 .printf (encoded_query, encoded_query, encoded_query);
             }
 
             string search_query = "(match-all (and " + string.joinv ("", current_search_expressions) + "))";
 
             try {
-                return folders[service_uid].search_by_expression (search_query, cancellable);
+                GenericArray<weak string>? uids = null;
+                folders[service_uid].search_sync (search_query, out uids, cancellable);
+                return uids;
             } catch (Error e) {
                 if (!(e is GLib.IOError.CANCELLED)) {
                     warning ("Error while searching: %s", e.message);
                 }
 
-                return folders[service_uid].get_uids ();
+                return folders[service_uid].dup_uids ();
             }
         }
     }
 
     private void add_conversation_item (Camel.FolderInfoFlags folder_info_flags, Camel.FolderThreadNode child, Camel.FolderThread thread, string service_uid) {
         var item = new ConversationItemModel (folder_info_flags, child, thread, service_uid);
-        conversations[child.message.uid] = item;
+        conversations[((Camel.MessageInfo?) child.get_item ()).uid] = item;
         list_store.add (item);
     }
 
     private static bool filter_function (GLib.Object obj) {
         if (obj is ConversationItemModel) {
             var conversation_item = (ConversationItemModel)obj;
             return !conversation_item.deleted && !conversation_item.hidden;
         } else {
             return false;
         }
     }
 
     private static int thread_sort_function (ConversationItemModel item1, ConversationItemModel item2) {
         return (int)(item2.timestamp - item1.timestamp);
     }
 
     public void mark_read_selected_messages () {
         var selected_rows = list_box.get_selected_rows ();
         foreach (var row in selected_rows) {
-            (((ConversationItemModel)row).node).message.set_flags (Camel.MessageFlags.SEEN, ~0);
+            ((Camel.MessageInfo?) (((ConversationItemModel)row).node).get_item ()).set_flags (Camel.MessageFlags.SEEN, ~0);
         }
     }
 
     public void mark_star_selected_messages () {
         var selected_rows = list_box.get_selected_rows ();
         foreach (var row in selected_rows) {
-            (((ConversationItemModel)row).node).message.set_flags (Camel.MessageFlags.FLAGGED, ~0);
+            ((Camel.MessageInfo?) (((ConversationItemModel)row).node).get_item ()).set_flags (Camel.MessageFlags.FLAGGED, ~0);
         }
     }
 
     public void mark_unread_selected_messages () {
         var selected_rows = list_box.get_selected_rows ();
         foreach (var row in selected_rows) {
-            (((ConversationItemModel)row).node).message.set_flags (Camel.MessageFlags.SEEN, 0);
+            ((Camel.MessageInfo?) (((ConversationItemModel)row).node).get_item ()).set_flags (Camel.MessageFlags.SEEN, 0);
         }
     }
 
     public void mark_unstar_selected_messages () {
         var selected_rows = list_box.get_selected_rows ();
         foreach (var row in selected_rows) {
-            (((ConversationItemModel)row).node).message.set_flags (Camel.MessageFlags.FLAGGED, 0);
+            ((Camel.MessageInfo?) (((ConversationItemModel)row).node).get_item ()).set_flags (Camel.MessageFlags.FLAGGED, 0);
         }
     }
 
diff --git a/src/MessageList/MessageList.vala b/src/MessageList/MessageList.vala
index e0fa96d02389..ed493b3cc900 100644
--- a/src/MessageList/MessageList.vala
+++ b/src/MessageList/MessageList.vala
@@ -179,46 +179,46 @@ public class Mail.MessageList : Gtk.Box {
          */
         can_move_thread (true);
 
-        var store = node.message.summary.folder.parent_store;
+        var store = ((Camel.MessageInfo?) node.get_item ()).summary.folder.parent_store;
         folder_popover.set_store (store);
 
-        var item = new MessageListItem (node.message);
+        var item = new MessageListItem ((Camel.MessageInfo?) node.get_item ());
         list_box.add (item);
-        messages.set (node.message.uid, item);
-        if (node.child != null) {
-            go_down ((Camel.FolderThreadNode?) node.child);
+        messages.set (((Camel.MessageInfo?) node.get_item ()).uid, item);
+        if (node.get_child () != null) {
+            go_down ((Camel.FolderThreadNode?) node.get_child ());
         }
 
         var children = list_box.get_children ();
         var num_children = children.length ();
         if (num_children > 0) {
             var child = list_box.get_row_at_index ((int) num_children - 1);
             if (child != null && child is MessageListItem) {
                 var list_item = (MessageListItem) child;
                 list_item.expanded = true;
                 can_reply (list_item.loaded);
                 list_item.notify["loaded"].connect (() => {
                     can_reply (list_item.loaded);
                 });
             }
         }
 
-        if (node.message != null && Camel.MessageFlags.DRAFT in (int) node.message.flags) {
+        if (node.get_item () != null && Camel.MessageFlags.DRAFT in (int) ((Camel.MessageInfo?) node.get_item ()).flags) {
             compose.begin (Composer.Type.DRAFT, "");
         }
     }
 
     private void go_down (Camel.FolderThreadNode node) {
         unowned Camel.FolderThreadNode? current_node = node;
         while (current_node != null) {
-            var item = new MessageListItem (current_node.message);
+            var item = new MessageListItem ((Camel.MessageInfo?) current_node.get_item ());
             list_box.add (item);
-            messages.set (current_node.message.uid, item);
-            if (current_node.next != null) {
-                go_down ((Camel.FolderThreadNode?) current_node.next);
+            messages.set (((Camel.MessageInfo?) current_node.get_item ()).uid, item);
+            if (current_node.get_next () != null) {
+                go_down ((Camel.FolderThreadNode?) current_node.get_next ());
             }
 
-            current_node = (Camel.FolderThreadNode?) current_node.child;
+            current_node = (Camel.FolderThreadNode?) current_node.get_child ();
         }
     }
 
diff --git a/vapi/camel-1.2.vapi b/vapi/camel-1.2.vapi
index d637f88d9135..b367e66be21f 100644
--- a/vapi/camel-1.2.vapi
+++ b/vapi/camel-1.2.vapi
@@ -95,48 +95,49 @@ namespace Camel {
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_cipher_context_get_type ()")]
 	public class CipherContext : GLib.Object {
 		[CCode (has_construct_function = false)]
-		public CipherContext (Camel.Session session);
+		public CipherContext (Camel.Session? session);
 		[Version (since = "3.0")]
 		public async Camel.CipherValidity decrypt (Camel.MimePart ipart, Camel.MimePart opart, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.0")]
 		public virtual Camel.CipherValidity decrypt_sync (Camel.MimePart ipart, Camel.MimePart opart, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.0")]
-		public async bool encrypt (string userid, GLib.GenericArray<string> recipients, Camel.MimePart ipart, Camel.MimePart opart, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		public async bool encrypt (string? userid, GLib.GenericArray<string> recipients, Camel.MimePart ipart, Camel.MimePart opart, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.0")]
-		public virtual bool encrypt_sync (string userid, GLib.GenericArray<string> recipients, Camel.MimePart ipart, Camel.MimePart opart, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		public virtual bool encrypt_sync (string? userid, GLib.GenericArray<string> recipients, Camel.MimePart ipart, Camel.MimePart opart, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		public static GLib.Quark error_quark ();
 		[Version (since = "2.32")]
-		public unowned Camel.Session get_session ();
+		public unowned Camel.Session? get_session ();
 		public virtual unowned string hash_to_id (Camel.CipherHash hash);
 		public virtual Camel.CipherHash id_to_hash (string id);
 		[Version (since = "3.0")]
 		public async bool sign (string userid, Camel.CipherHash hash, Camel.MimePart ipart, Camel.MimePart opart, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.0")]
 		public virtual bool sign_sync (string userid, Camel.CipherHash hash, Camel.MimePart ipart, Camel.MimePart opart, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.0")]
 		public async Camel.CipherValidity verify (Camel.MimePart ipart, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		public virtual Camel.CipherValidity verify_sync (Camel.MimePart ipart, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		public Camel.Session session { get; construct; }
 	}
 	[CCode (cheader_filename = "camel/camel.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "camel_cipher_validity_get_type ()")]
 	[Compact]
 	public class CipherValidity {
 		public weak GLib.Queue children;
 		[CCode (has_construct_function = false)]
 		public CipherValidity ();
 		public int add_certinfo (Camel.CipherValidityMode mode, string name, string email);
 		[Version (since = "2.30")]
-		public int add_certinfo_ex (Camel.CipherValidityMode mode, string name, string email, [CCode (destroy_notify_pos = 4.5)] owned void* cert_data, Camel.CipherCloneFunc? cert_data_clone);
+		public int add_certinfo_ex (Camel.CipherValidityMode mode, string name, string email, void* cert_data, GLib.DestroyNotify? cert_data_free, Camel.CipherCloneFunc? cert_data_clone);
 		public void clear ();
 		public Camel.CipherValidity clone ();
 		public void envelope (Camel.CipherValidity valid);
 		public void free ();
 		[Version (since = "3.22")]
 		public void* get_certinfo_property (Camel.CipherValidityMode mode, int info_index, string name);
-		public string get_description ();
+		public unowned string get_description ();
 		public bool get_valid ();
 		public void init ();
 		[Version (since = "3.22")]
-		public void set_certinfo_property (Camel.CipherValidityMode mode, int info_index, string name, [CCode (destroy_notify_pos = 4.5)] owned void* value, Camel.CipherCloneFunc? value_clone);
+		public void set_certinfo_property (Camel.CipherValidityMode mode, int info_index, string name, void* value, GLib.DestroyNotify? value_free, Camel.CipherCloneFunc? value_clone);
 		public void set_description (string description);
 		public void set_valid (bool valid);
 	}
@@ -178,141 +179,129 @@ namespace Camel {
 	[Version (since = "2.24")]
 	public class DB : GLib.Object {
 		[CCode (has_construct_function = false)]
-		[Version (since = "3.24")]
+		[Version (since = "3.57.1")]
 		public DB (string filename) throws GLib.Error;
-		public int abort_transaction () throws GLib.Error;
-		public int add_to_transaction (string query) throws GLib.Error;
-		public int begin_transaction () throws GLib.Error;
-		public static void camel_mir_free (Camel.MIRecord? record);
-		public int clear_folder_summary (string folder_name) throws GLib.Error;
-		public int command (string stmt) throws GLib.Error;
-		public int count_deleted_message_info (string table_name, out uint32 count) throws GLib.Error;
-		public int count_junk_message_info (string table_name, out uint32 count) throws GLib.Error;
-		public int count_junk_not_deleted_message_info (string table_name, uint32 count) throws GLib.Error;
-		[Version (since = "2.26")]
-		public int count_message_info (string query, out uint32 count) throws GLib.Error;
-		public int count_total_message_info (string table_name, out uint32 count) throws GLib.Error;
-		public int count_unread_message_info (string table_name, out uint32 count) throws GLib.Error;
-		public int count_visible_message_info (string table_name, out uint32 count) throws GLib.Error;
-		public int count_visible_unread_message_info (string table_name, out uint32 count) throws GLib.Error;
-		public int create_folders_table () throws GLib.Error;
-		public int delete_folder (string folder_name) throws GLib.Error;
-		public int delete_uid (string folder_name, string uid) throws GLib.Error;
-		public int delete_uids (string folder_name, GLib.List<string> uids) throws GLib.Error;
-		public int end_transaction () throws GLib.Error;
-		[Version (since = "2.26")]
-		public int flush_in_memory_transactions (string folder_name) throws GLib.Error;
+		[Version (since = "3.57.1")]
+		public bool abort_transaction () throws GLib.Error;
+		[Version (since = "3.57.1")]
+		public bool begin_transaction () throws GLib.Error;
+		[Version (since = "3.57.1")]
+		public bool end_transaction () throws GLib.Error;
+		public static GLib.Quark error_quark ();
+		[Version (since = "3.57.1")]
+		public bool exec_select (string stmt, Camel.DBSelectCB callback) throws GLib.Error;
+		[Version (since = "3.57.1")]
+		public bool exec_statement (string stmt) throws GLib.Error;
 		public static void free_sqlized_string (string? string);
-		[Version (since = "3.4")]
-		public static Camel.DBKnownColumnNames get_column_ident (ref GLib.HashTable<void*,void*> hash, int index, [CCode (array_length_cname = "ncols", array_length_pos = 2.5)] string[] col_names);
-		public static string? get_column_name (string raw_name);
 		[Version (since = "3.24")]
 		public unowned string get_filename ();
-		public GLib.GenericArray<string>? get_folder_deleted_uids (string folder_name) throws GLib.Error;
-		public GLib.GenericArray<string>? get_folder_junk_uids (string folder_name) throws GLib.Error;
-		public int get_folder_uids (string folder_name, string? sort_by, string? collate, GLib.HashTable<string,uint32> hash) throws GLib.Error;
+		[Version (since = "3.57.1")]
+		public bool has_table (string table_name);
+		[Version (since = "3.57.1")]
+		public bool has_table_with_column (string table_name, string column_name);
 		[Version (since = "3.16")]
 		public bool maybe_run_maintenance () throws GLib.Error;
-		public int prepare_message_info_table (string folder_name) throws GLib.Error;
-		public int read_folder_info_record (string folder_name, out Camel.FIRecord record) throws GLib.Error;
-		public int read_message_info_record_with_uid (string folder_name, string uid, [CCode (delegate_target_pos = 2.5)] Camel.DBSelectCB callback) throws GLib.Error;
-		public int read_message_info_records (string folder_name, [CCode (delegate_target_pos = 1.5, scope = "async")] Camel.DBSelectCB callback) throws GLib.Error;
+		[Version (since = "3.57.1")]
+		public bool open (string filename) throws GLib.Error;
+		[Version (since = "3.57.1")]
+		public void reader_lock ();
+		[Version (since = "3.57.1")]
+		public void reader_unlock ();
 		[Version (since = "3.24")]
 		public static void release_cache_memory ();
-		public int rename_folder (string old_folder_name, string new_folder_name) throws GLib.Error;
-		[Version (since = "2.28")]
-		public int reset_folder_version (string folder_name, int reset_version) throws GLib.Error;
-		public int select (string stmt, Camel.DBSelectCB callback) throws GLib.Error;
-		public int set_collate (string col, string collate, Camel.DBCollate func);
+		public bool set_collate (string col, string collate, Camel.DBCollate func);
 		public static string sqlize_string (string string);
-		[Version (since = "2.26")]
-		public int start_in_memory_transactions () throws GLib.Error;
-		public int transaction_command (GLib.List<string> qry_list) throws GLib.Error;
-		public int write_folder_info_record (Camel.FIRecord record) throws GLib.Error;
-		public int write_message_info_record (string folder_name, Camel.MIRecord record) throws GLib.Error;
+		[Version (since = "3.57.1")]
+		public static void sqlize_to_statement (GLib.StringBuilder stmt, string? str, Camel.DBSqlizeFlags flags);
+		[Version (since = "3.57.1")]
+		public void writer_lock ();
+		[Version (since = "3.57.1")]
+		public void writer_unlock ();
 	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_data_cache_get_type ()")]
 	public class DataCache : GLib.Object {
 		[CCode (has_construct_function = false)]
 		public DataCache (string path) throws GLib.Error;
 		public GLib.IOStream add (string path, string key) throws GLib.Error;
 		[Version (since = "3.2")]
 		public void clear (string path);
 		[Version (since = "3.26")]
 		public void foreach_remove (string path, Camel.DataCacheRemoveFunc func);
 		public GLib.IOStream @get (string path, string key) throws GLib.Error;
 		[Version (since = "3.24")]
 		public bool get_expire_enabled ();
 		[Version (since = "2.26")]
 		public string get_filename (string path, string key);
 		[Version (since = "2.32")]
 		public unowned string get_path ();
 		public int remove (string path, string key) throws GLib.Error;
-		public void set_expire_access (long when);
-		public void set_expire_age (long when);
+		public void set_expire_access (time_t when);
+		public void set_expire_age (time_t when);
 		[Version (since = "3.24")]
 		public void set_expire_enabled (bool expire_enabled);
 		[Version (since = "2.32")]
 		public void set_path (string path);
 		public bool expire_enabled { get; set construct; }
 		public string path { get; set construct; }
 	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_data_wrapper_get_type ()")]
 	public class DataWrapper : GLib.Object {
 		[CCode (has_construct_function = false)]
 		public DataWrapper ();
 		[Version (since = "3.24")]
 		public size_t calculate_decoded_size_sync (GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.24")]
 		public size_t calculate_size_sync (GLib.Cancellable? cancellable = null) throws GLib.Error;
+		[Version (since = "3.46")]
+		public bool construct_from_data_sync (void* data, ssize_t data_len, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.12")]
 		public async bool construct_from_input_stream (GLib.InputStream input_stream, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.12")]
 		public virtual bool construct_from_input_stream_sync (GLib.InputStream input_stream, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.0")]
 		public async bool construct_from_stream (Camel.Stream stream, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.0")]
 		public virtual bool construct_from_stream_sync (Camel.Stream stream, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.12")]
 		public async ssize_t decode_to_output_stream (GLib.OutputStream output_stream, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.12")]
 		public virtual ssize_t decode_to_output_stream_sync (GLib.OutputStream output_stream, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.0")]
 		public async ssize_t decode_to_stream (Camel.Stream stream, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.0")]
 		public virtual ssize_t decode_to_stream_sync (Camel.Stream stream, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.2")]
 		public unowned GLib.ByteArray get_byte_array ();
 		[Version (since = "3.24")]
 		public Camel.TransferEncoding get_encoding ();
 		public virtual string get_mime_type ();
-		public virtual unowned Camel.ContentType get_mime_type_field ();
+		public virtual unowned Camel.ContentType? get_mime_type_field ();
 		public virtual bool is_offline ();
 		[Version (since = "3.24")]
 		public void set_encoding (Camel.TransferEncoding encoding);
 		public virtual void set_mime_type (string mime_type);
 		public virtual void set_mime_type_field (Camel.ContentType? mime_type);
 		[Version (since = "3.24")]
 		public void set_offline (bool offline);
 		[Version (since = "3.24")]
 		public void take_mime_type_field (owned Camel.ContentType? mime_type);
 		[Version (since = "3.12")]
 		public async ssize_t write_to_output_stream (GLib.OutputStream output_stream, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.12")]
 		public virtual ssize_t write_to_output_stream_sync (GLib.OutputStream output_stream, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.0")]
 		public async ssize_t write_to_stream (Camel.Stream stream, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.0")]
 		public virtual ssize_t write_to_stream_sync (Camel.Stream stream, GLib.Cancellable? cancellable = null) throws GLib.Error;
 	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_filter_driver_get_type ()")]
 	public class FilterDriver : GLib.Object {
 		[CCode (has_construct_function = false)]
 		public FilterDriver (Camel.Session session);
 		public void add_rule (string name, string match, string action);
-		public int filter_folder (Camel.Folder folder, Camel.UIDCache cache, GLib.GenericArray<string> uids, bool remove, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		public int filter_folder (Camel.Folder folder, Camel.UIDCache cache, GLib.GenericArray<string>? uids, bool remove, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		public int filter_mbox (string mbox, string? original_source_url, GLib.Cancellable? cancellable = null) throws GLib.Error;
-		public int filter_message (Camel.MimeMessage message, Camel.MessageInfo info, string uid, Camel.Folder source, string store_uid, string original_store_uid, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		public int filter_message (Camel.MimeMessage? message, Camel.MessageInfo? info, string? uid, Camel.Folder? source, string? store_uid, string? original_store_uid, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		public void flush () throws GLib.Error;
 		public bool remove_rule_by_name (string name);
 		public void set_default_folder (Camel.Folder? def);
@@ -351,90 +340,91 @@ namespace Camel {
 		public virtual bool append_message_sync (Camel.MimeMessage message, Camel.MessageInfo? info, out string? appended_uid, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "2.28")]
 		public virtual int cmp_uids (string uid1, string uid2);
-		[Version (since = "2.26")]
-		public virtual uint32 count_by_expression (string expression, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		public void @delete ();
 		[NoWrapper]
 		public virtual void delete_ ();
 		[Version (since = "3.8")]
 		public string dup_description ();
 		[Version (since = "3.8")]
 		public string dup_display_name ();
 		[Version (since = "3.8")]
 		public string dup_full_name ();
+		[Version (since = "3.57.1")]
+		public virtual bool dup_headers_sync (string uid, out Camel.NameValueArray out_headers, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		[Version (since = "3.57.1")]
+		public virtual GLib.GenericArray<weak string> dup_uids ();
+		[Version (since = "3.57.1")]
+		public virtual GLib.GenericArray<weak string> dup_uncached_uids (GLib.GenericArray<string> uids) throws GLib.Error;
 		[Version (since = "3.0")]
 		public async bool expunge (int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.0")]
 		public virtual bool expunge_sync (GLib.Cancellable? cancellable = null) throws GLib.Error;
-		public void free_deep (GLib.GenericArray<string> array);
-		public void free_shallow (GLib.GenericArray<string> array);
-		public virtual void free_summary (GLib.GenericArray<Camel.MessageInfo> array);
-		public virtual void free_uids (GLib.GenericArray<string> array);
 		public virtual void freeze ();
 		public int get_deleted_message_count ();
 		[Version (since = "2.32")]
 		public unowned string get_description ();
 		[Version (since = "3.2")]
 		public unowned string get_display_name ();
 		[Version (since = "2.26")]
 		public virtual string get_filename (string uid) throws GLib.Error;
 		[Version (since = "3.24")]
 		public uint32 get_flags ();
 		[Version (since = "3.24")]
 		public unowned Camel.FolderSummary get_folder_summary ();
 		[Version (since = "2.32")]
 		public int get_frozen_count ();
+		[Version (since = "3.46")]
+		public virtual unowned string get_full_display_name ();
 		public unowned string get_full_name ();
 		[Version (since = "3.32")]
 		public Camel.ThreeState get_mark_seen ();
 		[Version (since = "3.32")]
 		public int get_mark_seen_timeout ();
 		[Version (since = "3.0")]
 		public async unowned Camel.MimeMessage get_message (string message_uid, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.24")]
 		public virtual Camel.MimeMessage? get_message_cached (string message_uid, GLib.Cancellable? cancellable = null);
 		public virtual int get_message_count ();
 		[Version (deprecated = true)]
 		public virtual uint32 get_message_flags (string uid);
-		public virtual Camel.MessageInfo get_message_info (string uid);
+		public virtual Camel.MessageInfo? get_message_info (string uid);
 		[Version (since = "3.0")]
 		public virtual unowned Camel.MimeMessage get_message_sync (string message_uid, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (deprecated = true)]
 		public virtual bool get_message_user_flag (string uid, string name);
 		[Version (deprecated = true)]
 		public virtual unowned string get_message_user_tag (string uid, string name);
 		public unowned Camel.Store get_parent_store ();
 		public virtual uint32 get_permanent_flags ();
 		[Version (since = "3.2")]
 		public async Camel.FolderQuotaInfo get_quota_info (int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.2")]
 		public virtual Camel.FolderQuotaInfo get_quota_info_sync (GLib.Cancellable? cancellable = null) throws GLib.Error;
-		public virtual unowned GLib.GenericArray<string> get_summary ();
-		public virtual unowned GLib.GenericArray<string> get_uids ();
-		[Version (since = "2.26")]
-		public virtual unowned GLib.GenericArray<string> get_uncached_uids (GLib.GenericArray<string> uids) throws GLib.Error;
 		[Version (deprecated = true)]
 		public int get_unread_message_count ();
 		[NoWrapper]
 		public virtual bool has_search_capability ();
 		public bool has_summary_capability ();
 		public virtual bool is_frozen ();
 		[Version (since = "2.32")]
 		public void @lock ();
 		[Version (since = "3.22")]
 		public virtual void prepare_content_refresh ();
 		[Version (since = "3.4")]
 		public async bool purge_message_cache (string start_uid, string end_uid, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.4")]
 		public virtual bool purge_message_cache_sync (string start_uid, string end_uid, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.2")]
 		public async bool refresh_info (int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.0")]
 		public virtual bool refresh_info_sync (GLib.Cancellable? cancellable = null) throws GLib.Error;
 		public virtual void rename (string new_name);
-		public virtual GLib.GenericArray<string> search_by_expression (string expression, GLib.Cancellable? cancellable = null) throws GLib.Error;
-		public virtual GLib.GenericArray<string> search_by_uids (string expression, GLib.GenericArray<string> uids, GLib.Cancellable? cancellable = null) throws GLib.Error;
-		public virtual void search_free (GLib.GenericArray<string> result);
+		[Version (since = "3.57.1")]
+		public virtual bool search_body_sync (GLib.GenericArray<string> words, out GLib.GenericArray<weak string> out_uids, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		[Version (since = "3.57.1")]
+		public virtual bool search_header_sync (string header_name, GLib.GenericArray<string>? words, out GLib.GenericArray<weak string> out_uids, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		[Version (since = "3.57.1")]
+		public virtual bool search_sync (string expression, out GLib.GenericArray<weak string>? out_uids, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "2.32")]
 		public void set_description (string description);
 		[Version (since = "3.2")]
@@ -469,9 +459,9 @@ namespace Camel {
 		public void take_folder_summary (owned Camel.FolderSummary summary);
 		public virtual void thaw ();
 		[Version (since = "3.0")]
-		public async bool transfer_messages_to (GLib.GenericArray<string> message_uids, Camel.Folder destination, bool delete_originals, int io_priority, GLib.Cancellable? cancellable = null, out GLib.GenericArray<string>? transferred_uids) throws GLib.Error;
+		public async bool transfer_messages_to (GLib.GenericArray<string> message_uids, Camel.Folder destination, bool delete_originals, int io_priority, GLib.Cancellable? cancellable = null, out GLib.GenericArray<weak string>? transferred_uids) throws GLib.Error;
 		[Version (since = "3.0")]
-		public virtual bool transfer_messages_to_sync (GLib.GenericArray<string> message_uids, Camel.Folder destination, bool delete_originals, out GLib.GenericArray<string>? transferred_uids, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		public virtual bool transfer_messages_to_sync (GLib.GenericArray<string> message_uids, Camel.Folder destination, bool delete_originals, out GLib.GenericArray<weak string>? transferred_uids, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "2.32")]
 		public void @unlock ();
 		public string description { get; set construct; }
@@ -551,187 +541,173 @@ namespace Camel {
 		public Camel.FolderQuotaInfo clone ();
 		public void free ();
 	}
-	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_folder_search_get_type ()")]
-	public class FolderSearch : GLib.Object {
-		[CCode (has_construct_function = false)]
-		public FolderSearch ();
-		[Version (since = "2.26")]
-		public uint32 count (string expr, GLib.Cancellable? cancellable = null) throws GLib.Error;
-		public void free_result (GLib.GenericArray<string>? result);
-		[Version (since = "3.24")]
-		public unowned Camel.MessageInfo? get_current_message_info ();
-		[Version (since = "3.24")]
-		public unowned GLib.GenericArray<string> get_current_summary ();
-		[Version (since = "3.24")]
-		public unowned Camel.Folder get_folder ();
-		[Version (since = "3.24")]
-		public bool get_only_cached_messages ();
-		[Version (since = "3.24")]
-		public unowned GLib.GenericArray<string> get_summary ();
-		public bool get_summary_empty ();
-		public GLib.GenericArray<string> search (string expr, GLib.GenericArray<string> uids, GLib.Cancellable? cancellable = null) throws GLib.Error;
-		public void set_body_index (Camel.Index? body_index);
-		[Version (since = "3.24")]
-		public void set_current_message_info (Camel.MessageInfo? info);
-		public void set_folder (Camel.Folder folder);
-		[Version (since = "3.24")]
-		public void set_only_cached_messages (bool only_cached_messages);
-		public void set_summary (GLib.GenericArray<string> summary);
-		[Version (since = "3.24")]
-		public void take_current_message_info (Camel.MessageInfo? info);
-		[Version (since = "3.2")]
-		public static long util_add_months (long t, int months);
-		[Version (since = "3.30")]
-		public static int util_compare_date (int64 datetime1, int64 datetime2);
-		[Version (since = "3.40")]
-		public static uint64 util_hash_message_id (string message_id, bool needs_decode);
-		[Version (since = "3.30")]
-		public static long util_make_time (int argc, Camel.SExpResult argv);
-	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_folder_summary_get_type ()")]
 	public class FolderSummary : GLib.Object {
 		[CCode (has_construct_function = false)]
 		public FolderSummary (Camel.Folder folder);
 		public void add (Camel.MessageInfo info, bool force_keep_uid);
 		[Version (since = "2.24")]
 		public bool check_uid (string uid);
 		public bool clear () throws GLib.Error;
 		public uint count ();
+		[Version (since = "3.57.1")]
+		public GLib.GenericArray<weak string> dup_changed ();
+		[Version (since = "3.57.1")]
+		public GLib.GenericArray<weak string> dup_uids ();
 		[CCode (vfunc_name = "message_info_from_uid")]
 		[Version (since = "3.4")]
 		public virtual Camel.MessageInfo? @get (string uid);
 		[Version (since = "3.4")]
-		public GLib.GenericArray<string> get_array ();
-		[Version (since = "2.24")]
-		public GLib.GenericArray<string> get_changed ();
-		[Version (since = "3.4")]
 		public uint32 get_deleted_count ();
 		[Version (since = "3.24")]
 		public uint32 get_flags ();
 		[Version (since = "3.4")]
 		public unowned Camel.Folder get_folder ();
 		[Version (since = "3.6")]
 		public GLib.HashTable<weak string,int> get_hash ();
 		[Version (since = "3.4")]
-		public unowned Camel.Index get_index ();
+		public unowned Camel.Index? get_index ();
 		[Version (since = "3.12")]
 		public uint32 get_info_flags (string uid);
 		[Version (since = "3.4")]
 		public uint32 get_junk_count ();
 		[Version (since = "3.4")]
 		public uint32 get_junk_not_deleted_count ();
 		[Version (since = "3.4")]
 		public uint32 get_next_uid ();
 		[Version (since = "3.4")]
 		public uint32 get_saved_count ();
 		[Version (since = "3.24")]
 		public int64 get_timestamp ();
 		[Version (since = "3.4")]
 		public uint32 get_unread_count ();
 		[Version (since = "3.24")]
 		public uint32 get_version ();
 		[Version (since = "3.4")]
 		public uint32 get_visible_count ();
 		[Version (since = "3.24")]
 		public bool header_load ([CCode (type = "_CamelStore*")] Camel.Store store, string folder_name) throws GLib.Error;
 		[CCode (vfunc_name = "summary_header_load")]
 		[NoWrapper]
-		public virtual bool header_load_impl ([CCode (type = "_CamelFIRecord*")] Camel.FIRecord fir);
+		public virtual bool header_load_impl (Camel.StoreDBFolderRecord record);
 		[Version (since = "3.24")]
 		public bool header_save () throws GLib.Error;
-		[CCode (vfunc_name = "summary_header_save")]
-		[NoWrapper]
-		public virtual Camel.FIRecord? header_save_impl () throws GLib.Error;
 		[CCode (vfunc_name = "message_info_new_from_headers")]
 		[Version (since = "3.24")]
 		public virtual Camel.MessageInfo info_new_from_headers (Camel.NameValueArray headers);
 		[CCode (vfunc_name = "message_info_new_from_message")]
 		public virtual Camel.MessageInfo info_new_from_message (Camel.MimeMessage message);
 		[CCode (vfunc_name = "message_info_new_from_parser")]
 		public virtual Camel.MessageInfo info_new_from_parser (Camel.MimeParser parser);
 		[Version (since = "3.24")]
 		public bool load () throws GLib.Error;
 		[Version (since = "2.32")]
 		public void @lock ();
 		public uint32 next_uid ();
 		public virtual string next_uid_string ();
 		[Version (since = "2.26")]
 		public Camel.MessageInfo? peek_loaded (string uid);
 		[Version (since = "2.32")]
 		public void prepare_fetch_all () throws GLib.Error;
 		[CCode (vfunc_name = "prepare_fetch_all")]
 		[NoWrapper]
 		public virtual void prepare_fetch_all_v ();
 		public bool remove (Camel.MessageInfo info);
 		public bool remove_uid (string uid);
 		[Version (since = "3.6")]
-		public bool remove_uids (GLib.List<string> uids);
-		[Version (since = "3.6")]
-		public bool replace_flags (Camel.MessageInfo info);
+		public bool remove_uids (GLib.GenericArray<string> uids);
+		[Version (since = "3.57.1")]
+		public bool replace_flags (string uid, uint32 new_flags);
 		[Version (since = "3.24")]
 		public bool save () throws GLib.Error;
 		[Version (since = "3.24")]
 		public void set_flags (uint32 flags);
-		public void set_index (Camel.Index index);
+		public void set_index (Camel.Index? index);
 		public void set_next_uid (uint32 uid);
 		[Version (since = "3.24")]
 		public void set_timestamp (int64 timestamp);
 		[Version (since = "3.24")]
 		public void set_version (uint32 version);
+		[NoWrapper]
+		public virtual bool summary_header_save (Camel.StoreDBFolderRecord inout_record) throws GLib.Error;
 		public void touch ();
 		[Version (since = "2.32")]
 		public void @unlock ();
 		public uint deleted_count { get; }
 		public Camel.Folder folder { get; construct; }
 		public uint junk_count { get; }
 		public uint junk_not_deleted_count { get; }
 		public uint saved_count { get; }
 		public uint unread_count { get; }
 		public uint visible_count { get; }
 		public signal void changed ();
+		[Version (since = "3.57.1")]
+		public signal void info_flags_changed (string uid, uint new_flags);
 	}
-	[CCode (cheader_filename = "camel/camel.h", lower_case_csuffix = "folder_thread_messages", ref_function = "camel_folder_thread_messages_ref", type_id = "camel_folder_thread_messages_get_type ()", unref_function = "camel_folder_thread_messages_unref")]
-	[Compact]
-	public class FolderThread {
-		public Camel.Folder folder;
-		public Camel.MemChunk node_chunks;
-		public uint32 refcount;
-		public uint32 subject;
-		public GLib.GenericArray<Camel.MessageInfo> summary;
-		public Camel.FolderThreadNode tree;
+	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_folder_thread_get_type ()")]
+	public class FolderThread : GLib.Object {
 		[CCode (has_construct_function = false)]
-		public FolderThread (Camel.Folder folder, GLib.GenericArray<string> uids, bool thread_subject);
-		public void apply (GLib.GenericArray<string> uids);
-		public Camel.FolderThread @ref ();
-		public void unref ();
+		[Version (since = "3.57.1")]
+		public FolderThread (Camel.Folder folder, GLib.GenericArray<string>? uids, Camel.FolderThreadFlags flags);
+		public uint dump ();
+		[Version (since = "3.57.1")]
+		public unowned Camel.FolderThreadNode get_tree ();
 	}
 	[CCode (cheader_filename = "camel/camel.h", has_type_id = false)]
 	[Compact]
 	public class FolderThreadNode {
-		public weak Camel.FolderThreadNode? child;
-		public weak Camel.MessageInfo? message;
-		public weak Camel.FolderThreadNode? next;
-		public uint32 order;
-		public weak Camel.FolderThreadNode? parent;
-		public uint32 re;
-		public weak string root_subject;
-		[CCode (cname = "camel_folder_threaded_messages_dump")]
-		public int dump ();
+		[Version (since = "3.57.1")]
+		public unowned Camel.FolderThreadNode? get_child ();
+		[Version (since = "3.57.1")]
+		public void* get_item ();
+		[Version (since = "3.57.1")]
+		public unowned Camel.FolderThreadNode? get_next ();
+		[Version (since = "3.57.1")]
+		public unowned Camel.FolderThreadNode? get_parent ();
 	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_gpg_context_get_type ()")]
 	public class GpgContext : Camel.CipherContext {
 		[CCode (has_construct_function = false, type = "CamelCipherContext*")]
-		public GpgContext (Camel.Session session);
+		public GpgContext (Camel.Session? session);
 		[Version (since = "2.32")]
 		public bool get_always_trust ();
+		[Version (since = "3.50")]
+		public bool get_key_data_info_sync (uint8 data, size_t data_size, uint32 flags, out GLib.SList<Camel.GpgKeyInfo> out_infos, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		[Version (since = "3.46")]
+		public bool get_locate_keys ();
 		[Version (since = "3.20")]
 		public bool get_prefer_inline ();
+		[Version (since = "3.50")]
+		public bool get_public_key_info_sync (string keyid, uint32 flags, out GLib.SList<Camel.GpgKeyInfo> out_infos, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		[Version (since = "3.50")]
+		public bool get_public_key_sync (string keyid, uint32 flags, out uint8 out_data, out size_t out_data_size, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		[Version (since = "3.50")]
+		public bool has_public_key_sync (string keyid, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		[Version (since = "3.50")]
+		public bool import_key_sync (uint8 data, size_t data_size, uint32 flags, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		public void set_always_trust (bool always_trust);
+		[Version (since = "3.50")]
+		public bool set_key_trust_sync (string keyid, Camel.GpgTrust trust, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		[Version (since = "3.46")]
+		public void set_locate_keys (bool locate_keys);
 		[Version (since = "3.20")]
 		public void set_prefer_inline (bool prefer_inline);
 		public bool always_trust { get; set construct; }
+		public bool locate_keys { get; set construct; }
 		public bool prefer_inline { get; set construct; }
 	}
+	[CCode (cheader_filename = "camel/camel.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "camel_gpg_key_info_get_type ()")]
+	[Compact]
+	[Version (since = "3.50")]
+	public class GpgKeyInfo {
+		public Camel.GpgKeyInfo? copy ();
+		public void free ();
+		public int64 get_creation_date ();
+		public unowned string get_fingerprint ();
+		public unowned string get_id ();
+		public Camel.GpgTrust get_trust ();
+		public unowned GLib.SList<string> get_user_ids ();
+	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_html_parser_get_type ()")]
 	public class HTMLParser : GLib.Object {
 		[CCode (has_construct_function = false)]
@@ -781,16 +757,24 @@ namespace Camel {
 		public Camel.HeaderParam? next;
 		public string value;
 		[CCode (cname = "camel_header_param_list_decode")]
+		[Version (replacement = "HeaderParam.list_decode")]
 		public static Camel.HeaderParam? decode (string? @in);
 		[CCode (cname = "camel_header_param_list_format")]
+		[Version (replacement = "HeaderParam.list_format")]
 		public string format ();
 		[CCode (cname = "camel_header_param_list_format_append", instance_pos = 1.5)]
+		[Version (replacement = "HeaderParam.list_format_append")]
 		public void format_append (GLib.StringBuilder @out);
 		[CCode (cname = "camel_header_param_list_free")]
 		[DestroysInstance]
+		[Version (replacement = "HeaderParam.list_free")]
 		public void free ();
 		[CCode (cname = "camel_header_param")]
 		public unowned string get_value (string name);
+		public static void* list_decode (string? @in);
+		public static string list_format (void* @params);
+		public static void list_format_append (GLib.StringBuilder @out, void* @params);
+		public static void list_free (void* @params);
 	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_index_get_type ()")]
 	public class Index : GLib.Object {
@@ -842,13 +826,15 @@ namespace Camel {
 		[CCode (has_construct_function = false)]
 		public InternetAddress ();
 		public int add (string name, string address);
-		public static string encode_address (int len, string name, string addr);
+		public static string encode_address (int? len, string name, string addr);
 		[Version (since = "3.16")]
 		public void ensure_ascii_domains ();
 		public int find_address (string address, out unowned string? namep);
 		public int find_name (string name, out unowned string? addressp);
 		public static string format_address (string name, string addr);
 		public bool @get (int index, out unowned string? namep, out unowned string? addressp);
+		[Version (since = "3.44")]
+		public bool sanitize_ascii_domain ();
 	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_key_file_get_type ()")]
 	public class KeyFile : GLib.Object {
@@ -907,8 +893,8 @@ namespace Camel {
 		[Version (since = "3.24")]
 		public virtual unowned Camel.NameValueArray get_headers ();
 		public virtual void remove_header (string name);
-		public virtual void set_content (Camel.DataWrapper content);
-		public virtual void set_header (string name, string value);
+		public virtual void set_content (Camel.DataWrapper? content);
+		public virtual void set_header (string name, string? value);
 		public Camel.DataWrapper content { get; set; }
 	}
 	[CCode (cheader_filename = "camel/camel.h", has_type_id = false)]
@@ -936,43 +922,50 @@ namespace Camel {
 		[CCode (has_construct_function = false)]
 		public MessageContentInfo ();
 		[Version (since = "3.24")]
-		public Camel.MessageContentInfo copy ();
+		public Camel.MessageContentInfo? copy ();
 		public void dump (int depth);
 		public void free ();
 		[CCode (has_construct_function = false)]
 		public MessageContentInfo.from_headers (Camel.NameValueArray headers);
 		[CCode (has_construct_function = false)]
 		public MessageContentInfo.from_message (Camel.MimePart mime_part);
 		[CCode (has_construct_function = false)]
 		public MessageContentInfo.from_parser (Camel.MimeParser parser);
 		public bool traverse (Camel.MessageContentInfoTraverseCallback func);
 	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_message_info_get_type ()")]
 	public abstract class MessageInfo : GLib.Object {
 		[CCode (has_construct_function = false)]
 		protected MessageInfo ();
 		[Version (since = "3.24")]
 		public virtual Camel.MessageInfo clone (Camel.FolderSummary? assign_summary);
 		[Version (since = "3.24")]
 		public void dump ();
 		[Version (since = "3.24")]
 		public Camel.NameValueArray? dup_headers ();
 		[Version (since = "3.42")]
 		public unowned string? dup_preview ();
 		[Version (since = "3.24")]
 		public GLib.Array<uint64>? dup_references ();
 		[Version (since = "3.24")]
-		public virtual Camel.NamedFlags dup_user_flags ();
+		public virtual Camel.NamedFlags? dup_user_flags ();
 		[Version (since = "3.42")]
 		public string? dup_user_header (string name);
 		[Version (since = "3.42")]
 		public Camel.NameValueArray? dup_user_headers ();
 		[Version (since = "3.24")]
 		public string? dup_user_tag (string name);
 		[Version (since = "3.24")]
 		public virtual Camel.NameValueArray? dup_user_tags ();
+		[Version (since = "3.57.1")]
+		public string encode_user_flags ();
+		[Version (since = "3.57.1")]
+		public string encode_user_tags ();
 		[Version (since = "3.24")]
 		public void freeze_notifications ();
+		[CCode (has_construct_function = false)]
+		[Version (since = "3.54")]
+		public MessageInfo.from_message (Camel.FolderSummary? summary, Camel.MimeMessage message);
 		[Version (since = "3.24")]
 		public bool get_abort_notifications ();
 		[Version (since = "3.24")]
@@ -1024,17 +1017,17 @@ namespace Camel {
 		[Version (since = "3.24")]
 		public virtual unowned Camel.NameValueArray? get_user_tags ();
 		[Version (since = "3.24")]
-		public virtual bool load (Camel.MIRecord? record, string bdata_ptr);
+		public virtual bool load (Camel.StoreDBMessageRecord record, string bdata_ptr);
 		[Version (since = "3.24")]
 		public unowned string pooldup_uid ();
 		[Version (since = "3.24")]
 		public void property_lock ();
 		[Version (since = "3.24")]
 		public void property_unlock ();
 		[Version (since = "3.24")]
 		public Camel.FolderSummary? ref_summary ();
 		[Version (since = "3.24")]
-		public virtual bool save (Camel.MIRecord? record, GLib.StringBuilder bdata_str);
+		public virtual bool save (Camel.StoreDBMessageRecord record, GLib.StringBuilder bdata_str);
 		[Version (since = "3.24")]
 		public void set_abort_notifications (bool abort_notifications);
 		[Version (since = "3.24")]
@@ -1155,8 +1148,12 @@ namespace Camel {
 		public void backup ([CCode (array_length_cname = "length", array_length_pos = 1.1, array_length_type = "gsize")] uint8[] data);
 		public virtual void complete ([CCode (array_length_cname = "len", array_length_pos = 1.5, array_length_type = "gsize")] uint8[] @in, size_t prespace, [CCode (array_length_cname = "outlen", array_length_pos = 3.5, array_length_type = "gsize")] out uint8[] @out, out size_t outprespace);
 		public virtual void filter ([CCode (array_length_cname = "len", array_length_pos = 1.5, array_length_type = "gsize")] uint8[] @in, size_t prespace, [CCode (array_length_cname = "outlen", array_length_pos = 3.5, array_length_type = "gsize")] out uint8[] @out, out size_t outprespace);
+		[Version (since = "3.52")]
+		public bool get_request_stop ();
 		public static Camel.MimeFilter @new ();
 		public virtual void reset ();
+		[Version (since = "3.52")]
+		public void set_request_stop (bool request_stop);
 		public void set_size (size_t size, int keep);
 	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_mime_filter_basic_get_type ()")]
@@ -1228,6 +1225,18 @@ namespace Camel {
 		[CCode (has_construct_function = false, type = "CamelMimeFilter*")]
 		public MimeFilterPgp ();
 	}
+	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_mime_filter_preview_get_type ()")]
+	public class MimeFilterPreview : Camel.MimeFilter {
+		[CCode (has_construct_function = false, type = "CamelMimeFilter*")]
+		[Version (since = "3.52")]
+		public MimeFilterPreview (uint limit);
+		[Version (since = "3.52")]
+		public uint get_limit ();
+		[Version (since = "3.52")]
+		public unowned string? get_text ();
+		[Version (since = "3.52")]
+		public void set_limit (uint limit);
+	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_mime_filter_progress_get_type ()")]
 	[Version (since = "2.24")]
 	public class MimeFilterProgress : Camel.MimeFilter {
@@ -1263,60 +1272,60 @@ namespace Camel {
 		public void dump (int body);
 		public void encode_8bit_parts ();
 		[Version (since = "3.34")]
-		public void foreach_part ();
-		public long get_date (out int offset);
-		public long get_date_received (out int offset);
+		public void foreach_part (Camel.ForeachPartFunc callback);
+		public time_t get_date (out int offset);
+		public time_t get_date_received (out int offset);
 		public unowned Camel.InternetAddress? get_from ();
 		public unowned string? get_message_id ();
 		public unowned Camel.MimePart? get_part_by_content_id (string content_id);
 		public unowned Camel.InternetAddress? get_recipients (string type);
 		public unowned Camel.InternetAddress? get_reply_to ();
 		public unowned string? get_source ();
 		public unowned string? get_subject ();
 		public bool has_8bit_parts ();
 		[Version (since = "2.28")]
 		public bool has_attachment ();
 		public void set_best_encoding (Camel.BestencRequired required, Camel.BestencEncoding enctype);
-		public void set_date (long date, int offset);
+		public void set_date (time_t date, int offset);
 		public void set_from (Camel.InternetAddress? from);
 		public void set_message_id (string? message_id);
 		public void set_recipients (string type, Camel.InternetAddress? recipients);
 		public void set_reply_to (Camel.InternetAddress? reply_to);
 		public void set_source (string? source_uid);
 		public void set_subject (string? subject);
 	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_mime_parser_get_type ()")]
 	public class MimeParser : GLib.Object {
 		[CCode (has_construct_function = false)]
 		public MimeParser ();
 		[NoWrapper]
 		public virtual void content ();
-		public Camel.ContentType content_type ();
+		public Camel.ContentType? content_type ();
 		public void drop_step ();
 		[Version (since = "3.24")]
-		public Camel.NameValueArray dup_headers ();
+		public Camel.NameValueArray? dup_headers ();
 		public int errno ();
 		[Version (since = "2.22")]
 		public int filter_add (Camel.MimeFilter mf);
 		[Version (since = "2.22")]
 		public void filter_remove (int id);
 		[Version (since = "2.22")]
-		public unowned string from_line ();
-		public unowned string header (string name, int offset);
+		public unowned string? from_line ();
+		public unowned string? header (string name, int offset);
 		[Version (since = "3.12")]
 		public void init_with_bytes (GLib.Bytes bytes);
 		public int init_with_fd (int fd);
 		[Version (since = "3.12")]
 		public void init_with_input_stream (GLib.InputStream input_stream);
 		public int init_with_stream (Camel.Stream stream) throws GLib.Error;
 		[NoWrapper]
 		public virtual void message (void* headers);
 		[NoWrapper]
 		public virtual void part ();
 		[Version (since = "2.22")]
-		public unowned string postface ();
+		public unowned string? postface ();
 		[Version (since = "2.22")]
-		public unowned string preface ();
+		public unowned string? preface ();
 		public void push_state (Camel.MimeParserState newstate, string boundary);
 		public ssize_t read ([CCode (array_length = false)] out uint8[] databuffer, ssize_t len) throws GLib.Error;
 		public void scan_from (bool scan_from);
@@ -1347,46 +1356,50 @@ namespace Camel {
 		public async bool construct_from_parser (Camel.MimeParser parser, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.0")]
 		public virtual bool construct_from_parser_sync (Camel.MimeParser parser, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		[Version (since = "3.52")]
+		public virtual string? generate_preview (Camel.GeneratePreviewFunc? func);
 		[Version (since = "2.30")]
-		public unowned Camel.ContentDisposition get_content_disposition ();
-		public unowned string get_content_id ();
-		public unowned GLib.List<string> get_content_languages ();
-		public unowned string get_content_location ();
-		public unowned string get_content_md5 ();
-		public unowned Camel.ContentType get_content_type ();
-		public unowned string get_description ();
-		public unowned string get_disposition ();
+		public unowned Camel.ContentDisposition? get_content_disposition ();
+		public unowned string? get_content_id ();
+		public unowned GLib.List<string>? get_content_languages ();
+		public unowned string? get_content_location ();
+		public unowned string? get_content_md5 ();
+		public unowned Camel.ContentType? get_content_type ();
+		public unowned string? get_description ();
+		public unowned string? get_disposition ();
 		public Camel.TransferEncoding get_encoding ();
-		public unowned string get_filename ();
+		public unowned string? get_filename ();
 		public void set_content ([CCode (array_length_cname = "length", array_length_pos = 1.5)] uint8[]? data, string? type);
-		public void set_content_id (string contentid);
-		public void set_content_languages (GLib.List<string> content_languages);
-		public void set_content_location (string location);
-		public void set_content_md5 (string md5sum);
-		public void set_content_type (string content_type);
+		public void set_content_id (string? contentid);
+		public void set_content_languages (owned GLib.List<string>? content_languages);
+		public void set_content_location (string? location);
+		public void set_content_md5 (string? md5sum);
+		public void set_content_type (string? content_type);
 		public void set_description (string description);
-		public void set_disposition (string disposition);
+		public void set_disposition (string? disposition);
 		public void set_encoding (Camel.TransferEncoding encoding);
-		public void set_filename (string filename);
+		public void set_filename (string? filename);
 		public string content_id { get; set; }
 		public string content_md5 { get; set; }
 		public string description { get; set; }
 		public string disposition { get; set; }
 	}
 	[CCode (cheader_filename = "camel/camel.h", has_type_id = false)]
 	[Compact]
 	[Version (since = "2.24")]
 	public class MsgPort {
 	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_multipart_get_type ()")]
 	public class Multipart : Camel.DataWrapper {
 		[CCode (has_construct_function = false)]
 		public Multipart ();
 		public virtual void add_part (Camel.MimePart part);
 		public virtual int construct_from_parser (Camel.MimeParser parser);
+		[Version (since = "3.52")]
+		public virtual string? generate_preview (Camel.GeneratePreviewFunc? func);
 		public virtual unowned string get_boundary ();
 		public virtual uint get_number ();
-		public virtual unowned Camel.MimePart get_part (uint index);
+		public virtual unowned Camel.MimePart? get_part (uint index);
 		[Version (since = "3.12")]
 		public unowned string get_postface ();
 		[Version (since = "3.12")]
@@ -1504,9 +1517,9 @@ namespace Camel {
 		[Version (since = "3.22")]
 		public bool can_downsync ();
 		[Version (since = "3.0")]
-		public async bool downsync (string expression, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		public async bool downsync (string? expression, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.0")]
-		public virtual bool downsync_sync (string expression, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		public virtual bool downsync_sync (string? expression, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "2.32")]
 		public Camel.ThreeState get_offline_sync ();
 		[Version (since = "2.32")]
@@ -1563,6 +1576,8 @@ namespace Camel {
 		[CCode (has_construct_function = false, type = "GCancellable*")]
 		public Operation ();
 		public static void cancel_all ();
+		[Version (since = "3.52")]
+		public static string? dup_message (GLib.Cancellable? cancellable = null);
 		[CCode (has_construct_function = false, type = "GCancellable*")]
 		[Version (since = "3.24")]
 		public Operation.proxy (GLib.Cancellable? cancellable = null);
@@ -1621,43 +1636,43 @@ namespace Camel {
 		public static void encode_string (GLib.StringBuilder string, string v_string);
 		public unowned string? error ();
 		public unowned Camel.SExpResult? eval ();
-		public bool evaluate_occur_times (long start, long end);
+		public bool evaluate_occur_times (time_t start, time_t end);
 		public void fatal_error (string why, ...);
 		public void input_file (int fd);
 		public void input_text (string text, int len);
 		public int parse ();
 		public unowned Camel.SExpTerm? parse_value ();
 		public void remove_symbol (uint scope, string name);
 		public void result_free (Camel.SExpResult? result);
 		public Camel.SExpResult? result_new (int type);
 		public void resultv_free ([CCode (array_length_cname = "argc", array_length_pos = 0.5)] Camel.SExpResult[] argv);
 		public int set_scope (uint scope);
 		public Camel.SExpResult? term_eval (Camel.SExpTerm term);
-		[Version (since = "2.26")]
-		public static string to_sql_sexp (string sexp);
 	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_smime_context_get_type ()")]
 	public class SMIMEContext : Camel.CipherContext {
 		[CCode (has_construct_function = false, type = "CamelCipherContext*")]
 		public SMIMEContext (Camel.Session session);
 		public uint32 describe_part ([CCode (type = "_CamelMimePart*")] Camel.MimePart part);
 		public void set_encrypt_key (bool use, string key);
 		public void set_sign_mode (Camel.SMIMESign type);
+		[Version (since = "3.52")]
+		public static unowned string? util_nss_error_to_string (int nss_error_code);
 	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_sasl_get_type ()")]
 	public abstract class Sasl : GLib.Object {
 		public class weak Camel.ServiceAuthType? auth_type;
 		[CCode (has_construct_function = false)]
 		protected Sasl ();
 		public static unowned Camel.ServiceAuthType? authtype (string mechanism);
 		public static GLib.List<weak Camel.ServiceAuthType?> authtype_list (bool include_plain);
 		[Version (since = "3.0")]
-		public async GLib.ByteArray challenge (GLib.ByteArray token, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		public async GLib.ByteArray? challenge (GLib.ByteArray? token, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.0")]
 		public async string challenge_base64 (string token, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.0")]
 		public string challenge_base64_sync (string token, GLib.Cancellable? cancellable = null) throws GLib.Error;
-		public virtual GLib.ByteArray challenge_sync (GLib.ByteArray token, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		public virtual GLib.ByteArray? challenge_sync (GLib.ByteArray? token, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[CCode (cname = "camel_sasl_new")]
 		public static Camel.Sasl? for_service (string service_name, string mechanism, Camel.Service service);
 		public bool get_authenticated ();
@@ -1761,108 +1776,112 @@ namespace Camel {
 		[Version (since = "3.6")]
 		public virtual bool disconnect_sync (bool clean, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.12")]
-		public string dup_display_name ();
+		public string? dup_display_name ();
 		[Version (since = "3.12")]
 		public string dup_password ();
 		[Version (since = "3.2")]
 		public Camel.ServiceConnectionStatus get_connection_status ();
 		[Version (since = "3.2")]
-		public unowned string get_display_name ();
+		public unowned string? get_display_name ();
 		public virtual string get_name (bool brief);
 		[Version (since = "3.4")]
 		public unowned string get_password ();
 		public Camel.Provider get_provider ();
 		[Version (since = "3.2")]
 		public unowned string get_uid ();
 		[Version (since = "3.4")]
 		public unowned string get_user_cache_dir ();
 		[Version (since = "3.2")]
 		public unowned string get_user_data_dir ();
 		[Version (since = "3.4")]
 		public void migrate_files ();
 		[Version (since = "3.2")]
 		public Camel.URL new_camel_url ();
 		[Version (since = "3.2")]
 		public async GLib.List<weak Camel.ServiceAuthType?> query_auth_types (int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		public virtual GLib.List<weak Camel.ServiceAuthType?> query_auth_types_sync (GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.12")]
 		public void queue_task (GLib.Task task, [CCode (scope = "async")] GLib.TaskThreadFunc task_func);
 		[Version (since = "3.12")]
-		public GLib.ProxyResolver ref_proxy_resolver ();
+		public GLib.ProxyResolver? ref_proxy_resolver ();
 		[Version (since = "3.8")]
 		public Camel.Session ref_session ();
 		[Version (since = "3.6")]
 		public Camel.Settings ref_settings ();
 		[Version (since = "3.2")]
-		public void set_display_name (string display_name);
+		public void set_display_name (string? display_name);
 		[Version (since = "3.4")]
 		public void set_password (string password);
 		[Version (since = "3.12")]
-		public void set_proxy_resolver (GLib.ProxyResolver proxy_resolver);
+		public void set_proxy_resolver (GLib.ProxyResolver? proxy_resolver);
 		[Version (since = "3.2")]
-		public void set_settings (Camel.Settings settings);
+		public void set_settings (Camel.Settings? settings);
 		public Camel.ServiceConnectionStatus connection_status { get; }
 		public string display_name { get; set construct; }
 		public string password { get; set construct; }
 		public Camel.Provider provider { owned get; construct; }
 		[NoAccessorMethod]
 		public GLib.ProxyResolver proxy_resolver { owned get; set; }
 		[NoAccessorMethod]
 		public Camel.Session session { owned get; construct; }
 		[NoAccessorMethod]
 		public Camel.Settings settings { owned get; set construct; }
 		public string uid { get; construct; }
+		[NoAccessorMethod]
+		public bool with_proxy_resolver { construct; }
 	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_session_get_type ()")]
 	public class Session : GLib.Object {
 		[CCode (has_construct_function = false)]
 		protected Session ();
 		[Version (since = "3.2")]
 		public virtual Camel.Service add_service (string uid, string protocol, Camel.ProviderType type) throws GLib.Error;
+		[Version (since = "3.44")]
+		public virtual bool addressbook_contains_sync (string book_uid, string email_address, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.4")]
 		public async bool authenticate (Camel.Service service, string? mechanism, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.4")]
 		public virtual bool authenticate_sync (Camel.Service service, string? mechanism, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		public virtual bool forget_password (Camel.Service service, string item) throws GLib.Error;
 		[Version (since = "3.6")]
 		public async bool forward_to (Camel.Folder folder, Camel.MimeMessage message, string address, int io_priority, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.6")]
 		public virtual bool forward_to_sync (Camel.Folder folder, Camel.MimeMessage message, string address, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		public virtual unowned Camel.FilterDriver get_filter_driver (string type, Camel.Folder? for_folder) throws GLib.Error;
 		[Version (since = "3.2")]
-		public unowned Camel.JunkFilter get_junk_filter ();
+		public unowned Camel.JunkFilter? get_junk_filter ();
 		[Version (since = "2.22")]
 		public unowned GLib.HashTable<string,string> get_junk_headers ();
 		[Version (since = "3.28")]
 		public virtual bool get_oauth2_access_token_sync (Camel.Service service, out string? out_access_token, out int out_expires_in, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		public bool get_online ();
 		public virtual string get_password (Camel.Service service, string prompt, string item, uint32 flags) throws GLib.Error;
 		[Version (since = "3.30")]
 		public virtual bool get_recipient_certificates_sync (uint32 flags, GLib.GenericArray<string> recipients, out GLib.SList<string> out_certificates, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.4")]
 		public unowned string get_user_cache_dir ();
 		[Version (since = "3.2")]
 		public unowned string get_user_data_dir ();
 		[Version (since = "3.6")]
 		public uint idle_add (int priority, owned GLib.SourceFunc function);
 		[Version (since = "3.2")]
 		public GLib.List<Camel.Service> list_services ();
 		[Version (since = "2.22")]
 		public virtual bool lookup_addressbook (string name);
 		[Version (since = "3.8")]
 		public GLib.MainContext ref_main_context ();
 		[Version (since = "3.22")]
 		public GLib.NetworkMonitor ref_network_monitor ();
 		[Version (since = "3.6")]
-		public Camel.Service ref_service (string uid);
+		public Camel.Service? ref_service (string uid);
 		[Version (since = "3.6")]
-		public Camel.Service ref_service_by_url (Camel.URL url, Camel.ProviderType type);
+		public Camel.Service? ref_service_by_url (Camel.URL url, Camel.ProviderType type);
 		[Version (since = "3.2")]
 		public virtual void remove_service (Camel.Service service);
 		[Version (since = "3.2")]
 		public void remove_services ();
 		[Version (since = "3.2")]
-		public void set_junk_filter (Camel.JunkFilter junk_filter);
+		public void set_junk_filter (Camel.JunkFilter? junk_filter);
 		[Version (since = "2.22")]
 		public void set_junk_headers ([CCode (array_length_cname = "len", array_length_pos = 2.1)] string[] headers, [CCode (array_length = false)] string[] values);
 		[Version (since = "3.22")]
@@ -1917,8 +1936,8 @@ namespace Camel {
 		public GLib.GenericArray<Camel.Folder> dup_opened_folders ();
 		[Version (since = "3.40")]
 		public virtual bool get_can_auto_save_changes ();
-		[Version (since = "3.24")]
-		public unowned Camel.DB get_db ();
+		[Version (since = "3.57.1")]
+		public unowned Camel.StoreDB get_db ();
 		[Version (since = "3.24")]
 		public uint32 get_flags ();
 		[Version (since = "3.0")]
@@ -1974,54 +1993,159 @@ namespace Camel {
 		[HasEmitter]
 		public virtual signal void folder_renamed (string old_name, Camel.FolderInfo folder_info);
 	}
+	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_store_db_get_type ()")]
+	[Version (since = "3.57.1")]
+	public class StoreDB : Camel.DB {
+		[CCode (has_construct_function = false)]
+		public StoreDB (string filename, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		public bool clear_folder (string folder_name) throws GLib.Error;
+		public bool count_messages (string folder_name, Camel.StoreDBCountKind kind, out uint32 out_count) throws GLib.Error;
+		public bool delete_folder (string folder_name) throws GLib.Error;
+		public bool delete_message (string folder_name, string uid) throws GLib.Error;
+		public bool delete_messages (string folder_name, GLib.GenericArray<string> uids) throws GLib.Error;
+		public GLib.GenericArray<weak string> dup_deleted_uids (string folder_name) throws GLib.Error;
+		public GLib.GenericArray<weak string> dup_junk_uids (string folder_name) throws GLib.Error;
+		public string? dup_string_key (string key);
+		public GLib.HashTable<weak string,uint32> dup_uids_with_flags (string folder_name) throws GLib.Error;
+		public uint32 get_folder_id (string folder_name);
+		public int get_int_key (string key, int def_value);
+		public bool read_folder (string folder_name, out Camel.StoreDBFolderRecord out_record) throws GLib.Error;
+		public bool read_message (string folder_name, string uid, out Camel.StoreDBMessageRecord out_record) throws GLib.Error;
+		public bool read_messages (string folder_name, Camel.StoreDBReadMessagesFunc func) throws GLib.Error;
+		public bool rename_folder (string old_folder_name, string new_folder_name) throws GLib.Error;
+		public bool set_int_key (string key, int value) throws GLib.Error;
+		public bool set_string_key (string key, string value) throws GLib.Error;
+		public static unowned string? util_get_column_for_header_name (string header_name);
+		public bool write_folder (string folder_name, Camel.StoreDBFolderRecord record) throws GLib.Error;
+		public bool write_message (string folder_name, Camel.StoreDBMessageRecord record) throws GLib.Error;
+	}
+	[CCode (cheader_filename = "camel/camel.h", ref_function = "camel_store_info_ref", type_id = "camel_store_info_get_type ()", unref_function = "camel_store_info_unref")]
+	[Compact]
+	public class StoreInfo {
+		public uint32 flags;
+		public int refcount;
+		public weak Camel.StoreSummary summary;
+		public uint32 total;
+		public uint32 unread;
+		[Version (since = "3.46")]
+		public unowned string get_name ();
+		[Version (since = "3.46")]
+		public unowned string get_path ();
+		[Version (deprecated = true, deprecated_since = "3.46")]
+		public static unowned string name (Camel.StoreSummary summary, Camel.StoreInfo info);
+		[Version (deprecated = true, deprecated_since = "3.46")]
+		public static unowned string path (Camel.StoreSummary summary, Camel.StoreInfo info);
+		[Version (since = "3.46")]
+		public Camel.StoreInfo @ref ();
+		[Version (deprecated = true, deprecated_since = "3.46")]
+		public static void set_string (Camel.StoreSummary summary, Camel.StoreInfo info, int type, string value);
+		[Version (since = "3.46")]
+		public void set_value (int type, string value);
+		[Version (since = "3.46")]
+		public void unref ();
+	}
+	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_store_search_get_type ()")]
+	[Version (since = "3.57.1")]
+	public class StoreSearch : GLib.Object {
+		[CCode (has_construct_function = false)]
+		public StoreSearch (Camel.Store store);
+		public void add_folder (Camel.Folder folder);
+		public void add_match_index (Camel.StoreSearchIndex index);
+		public bool add_match_threads_items_sync (ref GLib.GenericArray<weak Camel.StoreSearchThreadItem> inout_items, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		public GLib.GenericArray<weak string>? dup_additional_columns ();
+		public unowned string? get_expression ();
+		public bool get_items_sync (out GLib.GenericArray<weak Camel.StoreSearchItem?> out_items, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		public Camel.MatchThreadsKind get_match_threads_kind (out Camel.FolderThreadFlags out_flags);
+		public unowned Camel.Store get_store ();
+		public bool get_uids_sync (string folder_name, out GLib.GenericArray<weak string> out_uids, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		public GLib.GenericArray<weak Camel.Folder> list_folders ();
+		public GLib.GenericArray<weak Camel.StoreSearchIndex> list_match_indexes ();
+		public bool rebuild_sync (GLib.Cancellable? cancellable = null) throws GLib.Error;
+		public Camel.StoreSearchIndex? ref_result_index ();
+		public void remove_folder (Camel.Folder folder);
+		public void remove_match_index (Camel.StoreSearchIndex index);
+		public void set_additional_columns (GLib.GenericArray<string>? colnames);
+		public void set_expression (string? expression);
+		public void set_result_index (Camel.StoreSearchIndex? index);
+		public Camel.Store store { get; construct; }
+	}
+	[CCode (cheader_filename = "camel/camel.h", ref_function = "camel_store_search_index_ref", type_id = "camel_store_search_index_get_type ()", unref_function = "camel_store_search_index_unref")]
+	[Compact]
+	[Version (since = "3.57.1")]
+	public class StoreSearchIndex {
+		[CCode (has_construct_function = false)]
+		public StoreSearchIndex ();
+		public void add (Camel.Store store, uint32 folder_id, string uid);
+		public void apply_match_threads (GLib.GenericArray<Camel.StoreSearchThreadItem> items, Camel.MatchThreadsKind kind, Camel.FolderThreadFlags flags, GLib.Cancellable? cancellable = null);
+		public bool contains (Camel.Store store, uint32 folder_id, string uid);
+		public void move_from_existing (Camel.StoreSearchIndex src);
+		public Camel.StoreSearchIndex @ref ();
+		public bool remove (Camel.Store store, uint32 folder_id, string uid);
+		[DestroysInstance]
+		public void unref ();
+	}
+	[CCode (cheader_filename = "camel/camel.h", has_type_id = false)]
+	[Compact]
+	[Version (since = "3.57.1")]
+	public class StoreSearchThreadItem {
+		public uint32 get_folder_id ();
+		public uint64 get_message_id ();
+		public unowned GLib.Array<uint64>? get_references ();
+		public unowned Camel.Store get_store ();
+		public unowned string get_subject ();
+		public unowned string get_uid ();
+	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_store_settings_get_type ()")]
 	[Version (since = "3.2")]
 	public class StoreSettings : Camel.Settings {
 		[CCode (has_construct_function = false)]
 		protected StoreSettings ();
 		public bool get_filter_inbox ();
 		[Version (since = "3.40")]
 		public int get_store_changes_interval ();
 		public void set_filter_inbox (bool filter_inbox);
 		[Version (since = "3.40")]
 		public void set_store_changes_interval (int interval);
 		public bool filter_inbox { get; set construct; }
 		public int store_changes_interval { get; set construct; }
 	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_store_summary_get_type ()")]
 	public class StoreSummary : GLib.Object {
 		[CCode (has_construct_function = false)]
 		public StoreSummary ();
-		public void add (Camel.StoreInfo info);
+		public void add (owned Camel.StoreInfo info);
 		public unowned Camel.StoreInfo? add_from_path (string path);
-		public GLib.GenericArray<Camel.StoreInfo?> array ();
-		public void array_free (GLib.GenericArray<Camel.StoreInfo?> array);
+		public GLib.GenericArray<Camel.StoreInfo> array ();
+		[Version (deprecated = true, deprecated_since = "3.46")]
+		public void array_free (owned GLib.GenericArray<Camel.StoreInfo> array);
 		[Version (since = "3.4")]
 		public bool connect_folder_summary (string path, Camel.FolderSummary folder_summary);
 		public int count ();
 		[Version (since = "3.4")]
 		public bool disconnect_folder_summary (Camel.FolderSummary folder_summary);
-		public unowned Camel.StoreInfo? info_new ();
-		public Camel.StoreInfo? info_ref (Camel.StoreInfo info);
-		public void info_unref (Camel.StoreInfo info);
+		public Camel.StoreInfo info_new ();
+		[Version (deprecated = true, deprecated_since = "3.46")]
+		public Camel.StoreInfo info_ref (Camel.StoreInfo info);
+		[Version (deprecated = true, deprecated_since = "3.46")]
+		public void info_unref (owned Camel.StoreInfo info);
 		public int load ();
-		public unowned Camel.StoreInfo? path (string path);
+		public Camel.StoreInfo? path (string path);
 		public void remove (Camel.StoreInfo info);
 		public void remove_path (string path);
 		public int save ();
 		public void set_filename (string filename);
 		[Version (since = "3.24")]
 		public void sort (GLib.CompareDataFunc compare_func);
 		[NoWrapper]
-		public virtual void store_info_free (Camel.StoreInfo info);
+		public virtual void store_info_free (owned Camel.StoreInfo info);
 		[NoWrapper]
-		public virtual unowned Camel.StoreInfo? store_info_load ([CCode (type = "FILE*")] GLib.FileStream file);
+		public virtual Camel.StoreInfo store_info_load ([CCode (type = "FILE*")] GLib.FileStream file);
 		[NoWrapper]
-		public virtual unowned Camel.StoreInfo? store_info_new (string path);
+		public virtual Camel.StoreInfo store_info_new (string path);
 		[NoWrapper]
 		public virtual int store_info_save ([CCode (type = "FILE*")] GLib.FileStream file, Camel.StoreInfo info);
 		[NoWrapper]
-		public virtual void store_info_set_string (Camel.StoreInfo info, int type, string value);
+		public virtual void store_info_set_value (Camel.StoreInfo info, int type, string value);
 		[NoWrapper]
 		public virtual int summary_header_load ([CCode (type = "FILE*")] GLib.FileStream file);
 		[NoWrapper]
@@ -2140,10 +2264,14 @@ namespace Camel {
 	public abstract class Transport : Camel.Service, GLib.Initable {
 		[CCode (has_construct_function = false)]
 		protected Transport ();
+		[Version (since = "3.50")]
+		public bool get_request_dsn ();
 		[Version (since = "3.0")]
 		public async bool send_to (Camel.MimeMessage message, Camel.Address from, Camel.Address recipients, int io_priority, GLib.Cancellable? cancellable = null, out bool out_sent_message_saved) throws GLib.Error;
 		[Version (since = "3.0")]
 		public virtual bool send_to_sync (Camel.MimeMessage message, Camel.Address from, Camel.Address recipients, out bool out_sent_message_saved, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		[Version (since = "3.50")]
+		public void set_request_dsn (bool request_dsn);
 	}
 	[CCode (cheader_filename = "camel/camel.h", has_type_id = false)]
 	[Compact]
@@ -2171,12 +2299,12 @@ namespace Camel {
 		public Camel.URL copy ();
 		public static void decode (string part);
 		public static string decode_path (string path);
-		public static string encode (string part, string escape_extra);
+		public static string encode (string part, string? escape_extra);
 		public bool equal (Camel.URL u2);
 		public static bool file_end (string @in, string pos, string inend, Camel.UrlMatch match);
 		public static bool file_start (string @in, string pos, string inend, Camel.UrlMatch match);
 		public void free ();
-		public unowned string get_param (string name);
+		public unowned string? get_param (string name);
 		public uint hash ();
 		public Camel.URL new_with_base (string url_string);
 		public void set_authmech (string authmech);
@@ -2205,120 +2333,58 @@ namespace Camel {
 		[Version (since = "3.24")]
 		public Camel.VTrashFolderType get_folder_type ();
 	}
-	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_vee_data_cache_get_type ()")]
-	[Version (since = "3.6")]
-	public class VeeDataCache : GLib.Object {
-		[CCode (has_construct_function = false)]
-		public VeeDataCache ();
-		public void add_subfolder (Camel.Folder subfolder);
-		public bool contains_message_info_data (Camel.Folder folder, string orig_message_uid);
-		public void foreach_message_info_data (Camel.Folder fromfolder, Camel.ForeachInfoData func);
-		public Camel.VeeMessageInfoData get_message_info_data (Camel.Folder folder, string orig_message_uid);
-		public Camel.VeeMessageInfoData? get_message_info_data_by_vuid (string vee_message_uid);
-		public Camel.VeeSubfolderData get_subfolder_data (Camel.Folder folder);
-		public void remove_message_info_data (Camel.VeeMessageInfoData mi_data);
-		public void remove_subfolder (Camel.Folder subfolder);
-	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_vee_folder_get_type ()")]
 	public class VeeFolder : Camel.Folder {
 		[CCode (has_construct_function = false, type = "CamelFolder*")]
 		public VeeFolder (Camel.Store parent_store, string full, uint32 flags);
-		public virtual void add_folder (Camel.Folder subfolder, GLib.Cancellable? cancellable = null);
-		[Version (since = "3.6")]
-		public void add_vuid ([CCode (type = "_CamelVeeMessageInfoData*")] Camel.VeeMessageInfoData mi_data, Camel.FolderChangeInfo? changes);
+		[Version (since = "3.57.1")]
+		public bool add_folder_sync (Camel.Folder subfolder, Camel.VeeFolderOpFlags op_flags, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		public void @construct (uint32 flags);
-		[NoWrapper]
-		public virtual void folder_changed (Camel.Folder subfolder, Camel.FolderChangeInfo changes);
+		[Version (since = "3.57.1")]
+		public GLib.GenericArray<weak Camel.Folder> dup_folders ();
+		[Version (since = "3.6")]
+		public Camel.Folder? dup_vee_uid_folder (string vee_message_uid);
 		[Version (since = "3.6")]
 		public bool get_auto_update ();
 		[Version (since = "3.6")]
 		public unowned string get_expression ();
 		[Version (since = "3.24")]
 		public uint32 get_flags ();
 		public unowned Camel.Folder get_location (Camel.VeeMessageInfo vinfo, out string? realuid);
-		[Version (since = "3.6")]
-		public unowned Camel.Folder? get_vee_uid_folder (string vee_message_uid);
-		[Version (since = "3.2")]
-		public void ignore_next_changed_event (Camel.Folder subfolder);
-		[Version (since = "3.38")]
-		public void propagate_skipped_changes ();
-		public virtual void rebuild_folder (Camel.Folder subfolder, GLib.Cancellable? cancellable = null);
-		[Version (since = "3.28")]
-		public GLib.List<Camel.Folder> ref_folders ();
-		public virtual void remove_folder (Camel.Folder subfolder, GLib.Cancellable? cancellable = null);
-		[Version (since = "3.12")]
-		public void remove_from_ignore_changed_event (Camel.Folder subfolder);
-		[Version (since = "3.6")]
-		public void remove_vuid ([CCode (type = "_CamelVeeMessageInfoData*")] Camel.VeeMessageInfoData mi_data, Camel.FolderChangeInfo? changes);
+		[Version (since = "3.57.1")]
+		public bool remove_folder_sync (Camel.Folder subfolder, Camel.VeeFolderOpFlags op_flags, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		[Version (since = "3.6")]
 		public void set_auto_update (bool auto_update);
-		[Version (since = "3.6")]
-		public virtual void set_expression (string expression);
-		public void set_folders (GLib.List<Camel.Folder> folders, GLib.Cancellable? cancellable = null);
+		[Version (since = "3.57.1")]
+		public bool set_expression_sync (string expression, Camel.VeeFolderOpFlags op_flags, GLib.Cancellable? cancellable = null) throws GLib.Error;
+		[Version (since = "3.57.1")]
+		public bool set_folders_sync (GLib.GenericArray<Camel.Folder> folders, Camel.VeeFolderOpFlags op_flags, GLib.Cancellable? cancellable = null) throws GLib.Error;
 		public bool auto_update { get; set; }
+		public signal void rebuild_run_test_signal ();
+		public signal void rebuild_schedule_test_signal ();
+		public signal void vee_setup_changed ();
 	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_vee_message_info_get_type ()")]
 	public class VeeMessageInfo : Camel.MessageInfo {
 		[CCode (has_construct_function = false, type = "CamelMessageInfo*")]
 		[Version (since = "3.24")]
 		public VeeMessageInfo (Camel.FolderSummary summary, Camel.FolderSummary original_summary, string vuid);
 		[Version (since = "3.24")]
 		public unowned Camel.Folder get_original_folder ();
 		[Version (since = "3.24")]
 		public unowned Camel.FolderSummary get_original_summary ();
 	}
-	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_vee_message_info_data_get_type ()")]
-	[Version (since = "3.6")]
-	public class VeeMessageInfoData : GLib.Object {
-		[CCode (has_construct_function = false)]
-		public VeeMessageInfoData (Camel.VeeSubfolderData subfolder_data, string orig_message_uid);
-		public unowned string get_orig_message_uid ();
-		public unowned Camel.VeeSubfolderData get_subfolder_data ();
-		public unowned string get_vee_message_uid ();
-	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_vee_store_get_type ()")]
 	public class VeeStore : Camel.Store, GLib.Initable {
 		[CCode (has_construct_function = false)]
-		public VeeStore ();
-		[Version (since = "3.6")]
-		public bool get_unmatched_enabled ();
-		[Version (since = "3.6")]
-		public unowned Camel.VeeFolder get_unmatched_folder ();
-		[Version (since = "3.6")]
-		public unowned Camel.VeeFolder get_vee_data_cache ();
-		[Version (since = "3.6")]
-		public void note_subfolder_unused (Camel.Folder subfolder, Camel.VeeFolder unused_by);
-		[Version (since = "3.6")]
-		public void note_subfolder_used (Camel.Folder subfolder, Camel.VeeFolder used_by);
-		[Version (since = "3.6")]
-		public void note_vuid_unused (Camel.VeeMessageInfoData mi_data, Camel.VeeFolder unused_by);
-		[Version (since = "3.6")]
-		public void note_vuid_used (Camel.VeeMessageInfoData mi_data, Camel.VeeFolder used_by);
-		[Version (since = "3.6")]
-		public void rebuild_unmatched_folder (GLib.Cancellable? cancellable = null) throws GLib.Error;
-		[Version (since = "3.6")]
-		public void set_unmatched_enabled (bool is_enabled);
+		protected VeeStore ();
+		[NoAccessorMethod]
 		public bool unmatched_enabled { get; set; }
 	}
-	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_vee_subfolder_data_get_type ()")]
-	[Version (since = "3.6")]
-	public class VeeSubfolderData : GLib.Object {
-		[CCode (has_construct_function = false)]
-		public VeeSubfolderData (Camel.Folder folder);
-		public unowned Camel.Folder get_folder ();
-		public unowned string get_folder_id ();
-	}
 	[CCode (cheader_filename = "camel/camel.h", type_id = "camel_vee_summary_get_type ()")]
 	public class VeeSummary : Camel.FolderSummary {
 		[CCode (has_construct_function = false, type = "CamelFolderSummary*")]
 		public VeeSummary (Camel.Folder parent);
-		public Camel.VeeMessageInfo add (Camel.VeeMessageInfoData mi_data);
-		[Version (since = "3.6")]
-		public GLib.HashTable<weak string,int> get_uids_for_subfolder (Camel.Folder subfolder);
-		[Version (since = "3.6")]
-		public void remove (string vuid, Camel.Folder subfolder);
-		[Version (since = "3.6")]
-		public void replace_flags (string uid);
 	}
 	[CCode (cheader_filename = "camel/camel.h", ref_function = "camel_weak_ref_group_ref", type_id = "camel_weak_ref_group_get_type ()", unref_function = "camel_weak_ref_group_unref")]
 	[Compact]
@@ -2354,49 +2420,49 @@ namespace Camel {
 		public abstract uint16 get_default_port (Camel.NetworkSecurityMethod method);
 		[Version (since = "3.8")]
 		public bool get_host_reachable ();
-		public abstract unowned string get_service_name (Camel.NetworkSecurityMethod method);
+		public abstract unowned string? get_service_name (Camel.NetworkSecurityMethod method);
 		[NoWrapper]
 		public abstract unowned GLib.SocketConnectable new_connectable ();
 		[Version (since = "3.8")]
 		public GLib.SocketConnectable ref_connectable ();
 		[Version (since = "3.8")]
-		public void set_connectable (GLib.SocketConnectable connectable);
+		public void set_connectable (GLib.SocketConnectable? connectable);
 		[Version (since = "3.12")]
-		public GLib.IOStream starttls (GLib.IOStream base_stream) throws GLib.Error;
+		public GLib.IOStream? starttls (GLib.IOStream base_stream) throws GLib.Error;
 		[NoAccessorMethod]
 		public abstract GLib.SocketConnectable connectable { owned get; set; }
 		[ConcreteAccessor]
 		public abstract bool host_reachable { get; }
 	}
 	[CCode (cheader_filename = "camel/camel.h", type_cname = "CamelNetworkSettingsInterface", type_id = "camel_network_settings_get_type ()")]
 	[Version (since = "3.2")]
 	public interface NetworkSettings : Camel.Settings {
 		[Version (since = "3.4")]
-		public string dup_auth_mechanism ();
+		public string? dup_auth_mechanism ();
 		[Version (since = "3.4")]
 		public string dup_host ();
 		[Version (since = "3.16")]
 		public string dup_host_ensure_ascii ();
 		[Version (since = "3.4")]
 		public string dup_user ();
 		[Version (since = "3.4")]
-		public unowned string get_auth_mechanism ();
+		public unowned string? get_auth_mechanism ();
 		[Version (since = "3.4")]
 		public unowned string get_host ();
 		[Version (since = "3.4")]
 		public uint16 get_port ();
 		public Camel.NetworkSecurityMethod get_security_method ();
 		[Version (since = "3.4")]
 		public unowned string get_user ();
 		[Version (since = "3.4")]
-		public void set_auth_mechanism (string auth_mechanism);
+		public void set_auth_mechanism (string? auth_mechanism);
 		[Version (since = "3.4")]
-		public void set_host (string host);
+		public void set_host (string? host);
 		[Version (since = "3.4")]
 		public void set_port (uint16 port);
 		public void set_security_method (Camel.NetworkSecurityMethod method);
 		[Version (since = "3.4")]
-		public void set_user (string user);
+		public void set_user (string? user);
 		[ConcreteAccessor]
 		public abstract string auth_mechanism { get; set construct; }
 		[ConcreteAccessor]
@@ -2462,80 +2528,32 @@ namespace Camel {
 		public void* get_property (string name);
 		[CCode (cname = "camel_cipher_certinfo_set_property")]
 		[Version (since = "3.22")]
-		public void set_property (string name, [CCode (destroy_notify_pos = 2.5)] owned void* value, Camel.CipherCloneFunc? value_clone);
+		public void set_property (string name, void* value, GLib.DestroyNotify? value_free, Camel.CipherCloneFunc? value_clone);
 	}
 	[CCode (cheader_filename = "camel/camel.h", has_type_id = false)]
 	public struct CipherCertInfoProperty {
 		public weak string name;
 		public void* value;
 		public weak GLib.DestroyNotify value_free;
 		public weak Camel.CipherCloneFunc value_clone;
 	}
 	[CCode (cheader_filename = "camel/camel.h", has_type_id = false)]
-	[Version (since = "2.24")]
-	public struct FIRecord {
-		public weak string folder_name;
-		public uint32 version;
-		public uint32 flags;
-		public uint32 nextuid;
-		public int64 timestamp;
-		public uint32 saved_count;
-		public uint32 unread_count;
-		public uint32 deleted_count;
-		public uint32 junk_count;
-		public uint32 visible_count;
-		public uint32 jnd_count;
-		public weak string bdata;
-	}
-	[CCode (cheader_filename = "camel/camel.h", has_type_id = false)]
 	public struct KeyBlock {
 		public Camel._block_t next;
 		public uint32 used;
 		[CCode (array_length = false, cname = "u.keys")]
 		public weak void*[] u_keys;
 		[CCode (array_length = false, cname = "u.keydata")]
 		public weak char u_keydata[1016];
 	}
 	[CCode (cheader_filename = "camel/camel.h", has_type_id = false)]
 	public struct KeyRootBlock {
 		public Camel._block_t first;
 		public Camel._block_t last;
 		public Camel._key_t free;
 	}
 	[CCode (cheader_filename = "camel/camel.h", has_type_id = false)]
 	[Version (since = "2.24")]
-	public struct MIRecord {
-		public weak string uid;
-		public uint32 flags;
-		public uint32 msg_type;
-		public uint32 dirty;
-		public bool read;
-		public bool deleted;
-		public bool replied;
-		public bool important;
-		public bool junk;
-		public bool attachment;
-		public uint32 size;
-		public int64 dsent;
-		public int64 dreceived;
-		public weak string subject;
-		public weak string from;
-		public weak string to;
-		public weak string cc;
-		public weak string mlist;
-		public weak string followup_flag;
-		public weak string followup_completed_on;
-		public weak string followup_due_by;
-		public weak string part;
-		public weak string labels;
-		public weak string usertags;
-		public weak string cinfo;
-		public weak string bdata;
-		public weak string userheaders;
-		public weak string preview;
-	}
-	[CCode (cheader_filename = "camel/camel.h", has_type_id = false)]
-	[Version (since = "2.24")]
 	public struct Msg {
 		public weak Camel.MsgPort reply_port;
 	}
@@ -2589,90 +2607,132 @@ namespace Camel {
 	public struct SExpResult {
 		public Camel.SExpResultType type;
 		public bool time_generator;
-		public long occuring_start;
-		public long occuring_end;
+		public time_t occuring_start;
+		public time_t occuring_end;
+		public void* user_data;
+		public weak GLib.DestroyNotify free_user_data;
 		[CCode (cname = "value.ptrarray")]
 		public weak GLib.GenericArray<void*> value_ptrarray;
 		[CCode (cname = "value.number")]
 		public int value_number;
 		[CCode (cname = "value.string")]
 		public weak string value_string;
 		[CCode (cname = "value.boolean")]
 		public int value_boolean;
 		[CCode (cname = "value.time")]
-		public long value_time;
+		public time_t value_time;
 	}
 	[CCode (cheader_filename = "camel/camel.h", has_type_id = false)]
 	[Version (since = "3.4")]
 	public struct SExpSymbol {
 		public int type;
 		public weak string name;
 		public void* data;
 	}
 	[CCode (cheader_filename = "camel/camel.h", has_type_id = false)]
 	[Version (since = "3.4")]
 	public struct SExpTerm {
 		public Camel.SExpTermType type;
 		[CCode (cname = "value.string")]
 		public weak string value_string;
 		[CCode (cname = "value.number")]
 		public int value_number;
 		[CCode (cname = "value.boolean")]
 		public int value_boolean;
 		[CCode (cname = "value.time")]
-		public long value_time;
+		public time_t value_time;
 		[CCode (cname = "value.var")]
 		public Camel.SExpSymbol value_var;
 		[CCode (cname = "value.func.sym")]
 		public Camel.SExpSymbol value_func_sym;
 		[CCode (array_length = false, cname = "value.func.terms")]
 		public Camel.SExpTerm[] value_func_terms;
 		[CCode (cname = "value.func.termcount")]
 		public int value_func_termcount;
 	}
 	[CCode (cheader_filename = "camel/camel.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "camel_service_auth_type_get_type ()")]
 	public struct ServiceAuthType {
 		public weak string name;
 		public weak string description;
 		public weak string authproto;
 		public bool need_password;
 		[Version (since = "3.24")]
 		public Camel.ServiceAuthType? copy ();
 		[Version (since = "3.24")]
 		public void free ();
 	}
 	[CCode (cheader_filename = "camel/camel.h", has_type_id = false)]
-	public struct StoreInfo {
-		public int refcount;
-		public weak string path;
+	[Version (since = "3.57.1")]
+	public struct StoreDBFolderRecord {
+		public weak string folder_name;
+		public uint32 version;
 		public uint32 flags;
-		public uint32 unread;
-		public uint32 total;
-		public static unowned string name (Camel.StoreSummary summary, Camel.StoreInfo info);
-		public static void set_string (Camel.StoreSummary summary, Camel.StoreInfo info, int type, string value);
+		public uint32 nextuid;
+		public int64 timestamp;
+		public uint32 saved_count;
+		public uint32 unread_count;
+		public uint32 deleted_count;
+		public uint32 junk_count;
+		public uint32 visible_count;
+		public uint32 jnd_count;
+		public weak string bdata;
+		public uint32 folder_id;
+		public void clear ();
+	}
+	[CCode (cheader_filename = "camel/camel.h", has_type_id = false)]
+	[Version (since = "3.57.1")]
+	public struct StoreDBMessageRecord {
+		public uint32 folder_id;
+		public weak string uid;
+		public uint32 flags;
+		public uint32 msg_type;
+		public uint32 dirty;
+		public uint32 size;
+		public int64 dsent;
+		public int64 dreceived;
+		public weak string subject;
+		public weak string from;
+		public weak string to;
+		public weak string cc;
+		public weak string mlist;
+		public weak string part;
+		public weak string labels;
+		public weak string usertags;
+		public weak string cinfo;
+		public weak string bdata;
+		public weak string userheaders;
+		public weak string preview;
+		public void clear ();
+	}
+	[CCode (cheader_filename = "camel/camel.h", has_type_id = false)]
+	[Version (since = "3.57.1")]
+	public struct StoreSearchItem {
+		public uint32 folder_id;
+		public weak string uid;
+		public unowned string? get_additional_value (uint32 index);
+		public uint32 get_n_additional_values ();
 	}
 	[CCode (cheader_filename = "camel/camel.h", has_type_id = false)]
 	public struct SummaryMessageID {
 		[CCode (cname = "id.id")]
 		public uint64 id_id;
 		[CCode (array_length = false, cname = "id.hash")]
 		public weak uint8 id_hash[8];
 		[CCode (cname = "id.part.hi")]
 		public uint32 id_part_hi;
 		[CCode (cname = "id.part.lo")]
 		public uint32 id_part_lo;
 	}
 	[CCode (cheader_filename = "camel/camel.h", has_type_id = false)]
 	public struct UIDCache {
 		public weak string filename;
 		public weak GLib.HashTable<void*,void*> uids;
 		public uint level;
 		public size_t expired;
 		public size_t size;
 		public int fd;
 		public void destroy ();
-		public static void free_uids (owned GLib.GenericArray<string> uids);
-		public GLib.GenericArray<string> get_new_uids (GLib.GenericArray<string> uids);
+		public GLib.GenericArray<weak string> dup_new_uids (GLib.GenericArray<string> uids);
 		public bool save ();
 		public void save_uid (string uid);
 	}
@@ -2782,6 +2842,12 @@ namespace Camel {
 		ULTIMATE,
 		TEMPORARY
 	}
+	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_CIPHER_CONTEXT_ERROR_KEY_NOT_", has_type_id = false)]
+	[Version (since = "3.50")]
+	public enum CipherContextError {
+		[CCode (cname = "CAMEL_CIPHER_CONTEXT_ERROR_KEY_NOT_FOUND")]
+		CIPHER_CONTEXT_ERROR_KEY_NOT_FOUND
+	}
 	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_CIPHER_HASH_", has_type_id = false)]
 	public enum CipherHash {
 		DEFAULT,
@@ -2821,47 +2887,18 @@ namespace Camel {
 		INSENSITIVE,
 		SENSITIVE
 	}
-	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_DB_COLUMN_", has_type_id = false)]
-	[Version (since = "3.4")]
-	public enum DBKnownColumnNames {
-		UNKNOWN,
-		ATTACHMENT,
-		BDATA,
-		CINFO,
-		DELETED,
-		DELETED_COUNT,
-		DRECEIVED,
-		DSENT,
-		FLAGS,
-		FOLDER_NAME,
-		FOLLOWUP_COMPLETED_ON,
-		FOLLOWUP_DUE_BY,
-		FOLLOWUP_FLAG,
-		IMPORTANT,
-		JND_COUNT,
-		JUNK,
-		JUNK_COUNT,
-		LABELS,
-		MAIL_CC,
-		MAIL_FROM,
-		MAIL_TO,
-		MLIST,
-		NEXTUID,
-		PART,
-		PREVIEW,
-		READ,
-		REPLIED,
-		SAVED_COUNT,
-		SIZE,
-		SUBJECT,
-		TIME,
-		UID,
-		UNREAD_COUNT,
-		USERHEADERS,
-		USERTAGS,
-		VERSION,
-		VISIBLE_COUNT,
-		VUID
+	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_DB_ERROR_", has_type_id = false)]
+	[Version (since = "3.44")]
+	public enum DBError {
+		[CCode (cname = "CAMEL_DB_ERROR_CORRUPT")]
+		DB_ERROR_CORRUPT
+	}
+	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_DB_SQLIZE_FLAG_", type_id = "camel_db_sqlize_flags_get_type ()")]
+	[Flags]
+	[Version (since = "3.57.1")]
+	public enum DBSqlizeFlags {
+		FULL,
+		ESCAPE_ONLY
 	}
 	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_FETCH_HEADERS_", type_id = "camel_fetch_headers_type_get_type ()")]
 	[Version (since = "3.2")]
@@ -2923,6 +2960,24 @@ namespace Camel {
 		DIRTY,
 		IN_MEMORY_ONLY
 	}
+	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_FOLDER_THREAD_FLAG_", type_id = "camel_folder_thread_flags_get_type ()")]
+	[Flags]
+	[Version (since = "3.57.1")]
+	public enum FolderThreadFlags {
+		NONE,
+		SUBJECT,
+		SORT
+	}
+	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_GPG_TRUST_", type_id = "camel_gpg_trust_get_type ()")]
+	[Version (since = "3.50")]
+	public enum GpgTrust {
+		NONE,
+		UNKNOWN,
+		NEVER,
+		MARGINAL,
+		FULL,
+		ULTIMATE
+	}
 	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_HTML_PARSER_", has_type_id = false)]
 	public enum HTMLParserState {
 		DATA,
@@ -2958,6 +3013,15 @@ namespace Camel {
 		READ,
 		WRITE
 	}
+	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_MATCH_THREADS_KIND_", type_id = "camel_match_threads_kind_get_type ()")]
+	[Version (since = "3.57.1")]
+	public enum MatchThreadsKind {
+		NONE,
+		ALL,
+		REPLIES,
+		REPLIES_AND_PARENTS,
+		SINGLE
+	}
 	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_MEMPOOL_ALIGN_", has_type_id = false)]
 	[Version (since = "2.32")]
 	public enum MemPoolFlags {
@@ -3088,7 +3152,8 @@ namespace Camel {
 		LABEL,
 		HIDDEN,
 		OPTIONS,
-		PLACEHOLDER
+		PLACEHOLDER,
+		ADVANCED_SECTION_START
 	}
 	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_PROVIDER_", type_id = "camel_provider_flags_get_type ()")]
 	[Flags]
@@ -3204,18 +3269,31 @@ namespace Camel {
 		ASCENDING,
 		DESCENDING
 	}
+	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_STORE_DB_COUNT_KIND_", type_id = "camel_store_db_count_kind_get_type ()")]
+	[Version (since = "3.57.1")]
+	public enum StoreDBCountKind {
+		TOTAL,
+		UNREAD,
+		JUNK,
+		DELETED,
+		NOT_JUNK_NOT_DELETED,
+		NOT_JUNK_NOT_DELETED_UNREAD,
+		JUNK_NOT_DELETED
+	}
 	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_STORE_", type_id = "camel_store_flags_get_type ()")]
 	[Flags]
 	public enum StoreFlags {
 		VTRASH,
 		VJUNK,
 		PROXY,
 		IS_MIGRATING,
 		REAL_JUNK_FOLDER,
 		CAN_EDIT_FOLDERS,
 		USE_CACHE_DIR,
 		CAN_DELETE_FOLDERS_AT_ONCE,
-		SUPPORTS_INITIAL_SETUP
+		SUPPORTS_INITIAL_SETUP,
+		IS_BUILTIN,
+		USE_TEMP_DIR
 	}
 	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_STORE_FOLDER_", type_id = "camel_store_get_folder_flags_get_type ()")]
 	[Flags]
@@ -3327,155 +3405,159 @@ namespace Camel {
 		JUNK,
 		LAST
 	}
+	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_VEE_FOLDER_OP_FLAG_", type_id = "camel_vee_folder_op_flags_get_type ()")]
+	[Flags]
+	[Version (since = "3.57.1")]
+	public enum VeeFolderOpFlags {
+		NONE,
+		SKIP_REBUILD,
+		SKIP_EMIT
+	}
 	[CCode (cheader_filename = "camel/camel.h", cname = "camel_search_flags_t", cprefix = "CAMEL_SEARCH_MATCH_", has_type_id = false)]
 	[Flags]
 	public enum _search_flags_t {
 		START,
 		END,
 		REGEX,
 		ICASE,
 		NEWLINE
 	}
 	[CCode (cheader_filename = "camel/camel.h", cname = "camel_search_match_t", cprefix = "CAMEL_SEARCH_MATCH_", has_type_id = false)]
 	public enum _search_match_t {
 		EXACT,
 		CONTAINS,
 		WORD,
 		STARTS,
 		ENDS,
-		SOUNDEX
+		SOUNDEX,
+		REGEX_SINGLELINE,
+		REGEX_MULTILINE
 	}
 	[CCode (cheader_filename = "camel/camel.h", cname = "camel_search_t", cprefix = "CAMEL_SEARCH_TYPE_", has_type_id = false)]
 	public enum _search_t {
 		ASIS,
 		ENCODED,
 		ADDRESS,
 		ADDRESS_ENCODED,
 		MLIST
 	}
 	[CCode (cheader_filename = "camel/camel.h", cname = "camel_search_word_t", cprefix = "CAMEL_SEARCH_WORD_", has_type_id = false)]
 	public enum _search_word_t {
 		SIMPLE,
 		COMPLEX,
 		@8BIT
 	}
-	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_ERROR_")]
+	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_ERROR_", has_type_id = false)]
 	[Version (since = "2.32")]
 	public errordomain Error {
 		[CCode (cname = "CAMEL_ERROR_GENERIC")]
 		ERROR_GENERIC;
 		public static GLib.Quark quark ();
 	}
-	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_FOLDER_ERROR_")]
+	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_FOLDER_ERROR_", type_id = "camel_folder_error_get_type ()")]
 	[Version (since = "2.32")]
 	public errordomain FolderError {
 		INVALID,
 		INVALID_STATE,
 		NON_EMPTY,
 		NON_UID,
 		INSUFFICIENT_PERMISSION,
 		INVALID_PATH,
 		INVALID_UID,
 		SUMMARY_INVALID;
 		public static GLib.Quark quark ();
 	}
-	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_SERVICE_ERROR_")]
+	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_SERVICE_ERROR_", type_id = "camel_service_error_get_type ()")]
 	[Version (since = "2.32")]
 	public errordomain ServiceError {
 		INVALID,
 		URL_INVALID,
 		UNAVAILABLE,
 		CANT_AUTHENTICATE,
 		NOT_CONNECTED;
 		public static GLib.Quark quark ();
 	}
-	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_STORE_ERROR_")]
+	[CCode (cheader_filename = "camel/camel.h", cprefix = "CAMEL_STORE_ERROR_", type_id = "camel_store_error_get_type ()")]
 	[Version (since = "2.32")]
 	public errordomain StoreError {
 		INVALID,
 		NO_FOLDER;
 		public static GLib.Quark quark ();
 	}
 	[CCode (cheader_filename = "camel/camel.h", has_target = false)]
 	public delegate void* CipherCloneFunc (void* value);
 	[CCode (cheader_filename = "camel/camel.h", has_target = false)]
 	public delegate void* CopyFunc (void* object);
 	[CCode (cheader_filename = "camel/camel.h", has_target = false)]
 	[Version (since = "2.24")]
 	public delegate int DBCollate (void* enc, int length1, void* data1, int length2, void* data2);
 	[CCode (cheader_filename = "camel/camel.h", instance_pos = 0.9)]
-	[Version (since = "2.24")]
-	public delegate int DBSelectCB ([CCode (array_length_cname = "ncol", array_length_pos = 0.666667)] string[] colvalues, [CCode (array_length_cname = "ncol", array_length_pos = 0.666667)] string[] colnames);
+	[Version (since = "3.57.1")]
+	public delegate bool DBSelectCB ([CCode (array_length_cname = "ncol", array_length_pos = 0.666667)] string[] colvalues, [CCode (array_length_cname = "ncol", array_length_pos = 0.666667)] string[] colnames);
 	[CCode (cheader_filename = "camel/camel.h", instance_pos = 2.9)]
 	[Version (since = "3.26")]
 	public delegate bool DataCacheRemoveFunc (Camel.DataCache cdc, string filename);
 	[CCode (cheader_filename = "camel/camel.h", instance_pos = 2.9)]
 	public delegate unowned Camel.Folder FilterGetFolderFunc (Camel.FilterDriver driver, string uri) throws GLib.Error;
 	[CCode (cheader_filename = "camel/camel.h", instance_pos = 2.9)]
 	public delegate void FilterPlaySoundFunc (Camel.FilterDriver driver, string filename);
 	[CCode (cheader_filename = "camel/camel.h", instance_pos = 3.9)]
 	public delegate void FilterShellFunc (Camel.FilterDriver driver, int argc, string argv);
 	[CCode (cheader_filename = "camel/camel.h", instance_pos = 4.9)]
 	public delegate void FilterStatusFunc (Camel.FilterDriver driver, void* status, int pc, string desc);
 	[CCode (cheader_filename = "camel/camel.h", instance_pos = 1.9)]
 	public delegate void FilterSystemBeepFunc (Camel.FilterDriver driver);
-	[CCode (cheader_filename = "camel/camel.h", instance_pos = 2.9)]
-	public delegate void ForeachInfoData (Camel.VeeMessageInfoData mi_data, Camel.Folder subfolder);
+	[CCode (cheader_filename = "camel/camel.h", has_target = false)]
+	public delegate int64 FolderThreadInt64Func (void* item);
+	[CCode (cheader_filename = "camel/camel.h", has_target = false)]
+	public delegate unowned string FolderThreadStrFunc (void* item);
+	[CCode (cheader_filename = "camel/camel.h", has_target = false)]
+	public delegate uint64 FolderThreadUint64Func (void* item);
+	[CCode (cheader_filename = "camel/camel.h", has_target = false)]
+	public delegate void FolderThreadVoidFunc (void* item);
 	[CCode (cheader_filename = "camel/camel.h", instance_pos = 3.9)]
 	[Version (since = "3.34")]
 	public delegate bool ForeachPartFunc (Camel.MimeMessage message, Camel.MimePart part, Camel.MimePart? parent_part);
+	[CCode (cheader_filename = "camel/camel.h", instance_pos = 1.9)]
+	[Version (since = "3.52")]
+	public delegate string? GeneratePreviewFunc (void* part);
 	[CCode (cheader_filename = "camel/camel.h", instance_pos = 2.9)]
 	public delegate string IndexNorm (Camel.Index index, string word);
 	[CCode (cheader_filename = "camel/camel.h", instance_pos = 2.9)]
 	[Version (since = "3.36")]
 	public delegate bool MessageContentInfoTraverseCallback (Camel.MessageContentInfo ci, int depth);
 	[CCode (cheader_filename = "camel/camel.h", has_target = false)]
 	public delegate int ProviderAutoDetectFunc (Camel.URL url, out GLib.HashTable<string,string>? auto_detected) throws GLib.Error;
 	[CCode (cheader_filename = "camel/camel.h", instance_pos = 2.9)]
 	[Version (since = "3.4")]
 	public delegate unowned Camel.SExpResult? SExpFunc (Camel.SExp sexp, [CCode (array_length_cname = "argc", array_length_pos = 1.5)] Camel.SExpResult[] argv);
 	[CCode (cheader_filename = "camel/camel.h", instance_pos = 2.9)]
 	[Version (since = "3.4")]
 	public delegate unowned Camel.SExpResult? SExpIFunc (Camel.SExp sexp, [CCode (array_length_cname = "argc", array_length_pos = 1.5)] Camel.SExpTerm[] argv);
 	[CCode (cheader_filename = "camel/camel.h", instance_pos = 2.9)]
 	[Version (since = "3.2")]
 	public delegate void SessionCallback (Camel.Session session, GLib.Cancellable? cancellable) throws GLib.Error;
+	[CCode (cheader_filename = "camel/camel.h", instance_pos = 2.9)]
+	[Version (since = "3.57.1")]
+	public delegate bool StoreDBReadMessagesFunc (Camel.StoreDB storedb, Camel.StoreDBMessageRecord record);
 	[CCode (cheader_filename = "camel/camel.h", has_target = false)]
 	public delegate void TextIndexFunc (Camel.TextIndex idx, string word, string buffer);
 	[CCode (cheader_filename = "camel/camel.h", has_target = false)]
 	public delegate bool UrlScanFunc (string @in, string pos, string inend, Camel.UrlMatch match);
 	[CCode (cheader_filename = "camel/camel.h", cname = "AI_CANONNAME")]
 	public const int AI_CANONNAME;
 	[CCode (cheader_filename = "camel/camel.h", cname = "AI_NUMERICHOST")]
 	public const int AI_NUMERICHOST;
 	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_BLOCK_SIZE")]
 	public const int BLOCK_SIZE;
 	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_BLOCK_SIZE_BITS")]
 	public const int BLOCK_SIZE_BITS;
 	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_CIPHER_CERT_INFO_PROPERTY_PHOTO_FILENAME")]
 	[Version (since = "3.22")]
 	public const string CIPHER_CERT_INFO_PROPERTY_PHOTO_FILENAME;
 	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_CIPHER_CERT_INFO_PROPERTY_SIGNERS_ALT_EMAILS")]
 	[Version (since = "3.28")]
 	public const string CIPHER_CERT_INFO_PROPERTY_SIGNERS_ALT_EMAILS;
-	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_DB_FILE")]
-	[Version (since = "2.24")]
-	public const string DB_FILE;
-	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_DB_FREE_CACHE_SIZE")]
-	[Version (since = "2.24")]
-	public const int DB_FREE_CACHE_SIZE;
-	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_DB_IN_MEMORY_DB")]
-	[Version (since = "2.26")]
-	public const string DB_IN_MEMORY_DB;
-	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_DB_IN_MEMORY_TABLE")]
-	[Version (since = "2.26")]
-	public const string DB_IN_MEMORY_TABLE;
-	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_DB_IN_MEMORY_TABLE_LIMIT")]
-	[Version (since = "2.26")]
-	public const int DB_IN_MEMORY_TABLE_LIMIT;
-	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_DB_SLEEP_INTERVAL")]
-	[Version (since = "2.24")]
-	public const int DB_SLEEP_INTERVAL;
 	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_DEBUG_IMAP")]
 	public const string DEBUG_IMAP;
 	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_DEBUG_IMAP_FOLDER")]
@@ -3530,6 +3612,9 @@ namespace Camel {
 	public const int LOCK_DOT_STALE;
 	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_LOCK_RETRY")]
 	public const int LOCK_RETRY;
+	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_MAX_PREVIEW_LENGTH")]
+	[Version (since = "3.52")]
+	public const int MAX_PREVIEW_LENGTH;
 	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_MESSAGE_DATE_CURRENT")]
 	public const int MESSAGE_DATE_CURRENT;
 	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_MESSAGE_SYSTEM_MASK")]
@@ -3576,22 +3661,29 @@ namespace Camel {
 	public const string RECIPIENT_TYPE_RESENT_TO;
 	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_RECIPIENT_TYPE_TO")]
 	public const string RECIPIENT_TYPE_TO;
+	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_SESSION_BOOK_UID_ANY")]
+	[Version (since = "3.44")]
+	public const string SESSION_BOOK_UID_ANY;
+	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_SESSION_BOOK_UID_COMPLETION")]
+	[Version (since = "3.44")]
+	public const string SESSION_BOOK_UID_COMPLETION;
+	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_STORE_DB_FILE")]
+	[Version (since = "3.57.1")]
+	public const string STORE_DB_FILE;
 	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_STORE_INFO_FOLDER_TYPE_BIT")]
 	public const int STORE_INFO_FOLDER_TYPE_BIT;
 	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_STORE_INFO_FOLDER_TYPE_MASK")]
 	public const int STORE_INFO_FOLDER_TYPE_MASK;
 	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_STORE_INFO_FOLDER_UNKNOWN")]
 	public const int STORE_INFO_FOLDER_UNKNOWN;
 	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_STORE_SETUP_ARCHIVE_FOLDER")]
 	public const string STORE_SETUP_ARCHIVE_FOLDER;
 	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_STORE_SETUP_DRAFTS_FOLDER")]
 	public const string STORE_SETUP_DRAFTS_FOLDER;
 	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_STORE_SETUP_SENT_FOLDER")]
 	public const string STORE_SETUP_SENT_FOLDER;
 	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_STORE_SETUP_TEMPLATES_FOLDER")]
 	public const string STORE_SETUP_TEMPLATES_FOLDER;
-	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_UNMATCHED_NAME")]
-	public const string UNMATCHED_NAME;
 	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_URL_HIDE_ALL")]
 	public const int URL_HIDE_ALL;
 	[CCode (cheader_filename = "camel/camel.h", cname = "CAMEL_URL_PART_AUTH")]
@@ -3630,174 +3722,240 @@ namespace Camel {
 	[Version (since = "3.16")]
 	public static unowned GLib.Binding binding_bind_property_with_closures (GLib.Object source, string source_property, GLib.Object target, string target_property, GLib.BindingFlags flags, GLib.Closure transform_to, GLib.Closure transform_from);
 	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "Charset.best")]
+	public static unowned string? charset_best ([CCode (array_length_cname = "len", array_length_pos = 1.1)] char[] @in);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "Charset.iso_to_windows")]
+	public static unowned string charset_iso_to_windows (string isocharset);
+	[CCode (cheader_filename = "camel/camel.h")]
 	[Version (since = "3.22")]
 	public static bool cipher_can_load_photos ();
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static int cipher_canonical_to_stream (Camel.MimePart part, uint32 flags, Camel.Stream ostream, GLib.Cancellable? cancellable = null) throws GLib.Error;
 	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "ContentDisposition.decode")]
+	public static Camel.ContentDisposition content_disposition_decode (string @in);
+	[CCode (cheader_filename = "camel/camel.h")]
 	public static string content_transfer_encoding_decode (string @in);
 	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "ContentType.decode")]
+	public static Camel.ContentType content_type_decode (string @in);
+	[CCode (cheader_filename = "camel/camel.h")]
 	public static bool debug (string mode);
 	[CCode (cheader_filename = "camel/camel.h")]
 	[Version (since = "3.30")]
 	public static void debug_demangle_backtrace (ref GLib.StringBuilder? bt);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static void debug_end ();
 	[CCode (cheader_filename = "camel/camel.h")]
 	[Version (since = "3.12")]
-	public static GLib.StringBuilder debug_get_backtrace ();
+	public static GLib.StringBuilder? debug_get_backtrace ();
 	[CCode (cheader_filename = "camel/camel.h")]
 	[Version (since = "3.30")]
-	public static GLib.StringBuilder debug_get_raw_backtrace ();
+	public static GLib.StringBuilder? debug_get_raw_backtrace ();
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static void debug_init ();
 	[CCode (cheader_filename = "camel/camel.h")]
 	[Version (since = "3.20")]
 	public static void debug_ref_unref_dump_backtraces ();
 	[CCode (cheader_filename = "camel/camel.h")]
 	[Version (since = "3.20")]
 	public static void debug_ref_unref_push_backtrace (GLib.StringBuilder backtrace, uint object_ref_count);
 	[CCode (cheader_filename = "camel/camel.h")]
 	[Version (since = "3.20")]
 	public static void debug_ref_unref_push_backtrace_for_object (void* _object);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static bool debug_start (string mode);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static string enriched_to_html (string @in, Camel.MimeFilterEnrichedFlags flags);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static int file_util_decode_fixed_int32 (void* @in, int32 dest);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static int file_util_decode_fixed_string (void* @in, string str, size_t len);
 	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (since = "3.50")]
+	public static int file_util_decode_gint64 (void* @in, int64 dest);
+	[CCode (cheader_filename = "camel/camel.h")]
 	public static int file_util_decode_gsize (void* @in, size_t dest);
 	[CCode (cheader_filename = "camel/camel.h")]
-	public static int file_util_decode_off_t (void* @in, size_t dest);
+	public static int file_util_decode_off_t (void* @in, off_t dest);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static int file_util_decode_string (void* @in, string str);
 	[CCode (cheader_filename = "camel/camel.h")]
-	public static int file_util_decode_time_t (void* @in, long dest);
+	public static int file_util_decode_time_t (void* @in, time_t dest);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static int file_util_decode_uint32 (void* @in, uint32 dest);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static int file_util_encode_fixed_int32 (void* @out, int32 value);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static int file_util_encode_fixed_string (void* @out, string str, size_t len);
 	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (since = "3.50")]
+	public static int file_util_encode_gint64 (void* @out, int64 value);
+	[CCode (cheader_filename = "camel/camel.h")]
 	public static int file_util_encode_gsize (void* @out, size_t value);
 	[CCode (cheader_filename = "camel/camel.h")]
-	public static int file_util_encode_off_t (void* @out, size_t value);
+	public static int file_util_encode_off_t (void* @out, off_t value);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static int file_util_encode_string (void* @out, string str);
 	[CCode (cheader_filename = "camel/camel.h")]
-	public static int file_util_encode_time_t (void* @out, long value);
+	public static int file_util_encode_time_t (void* @out, time_t value);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static int file_util_encode_uint32 (void* @out, uint32 value);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static string file_util_safe_filename (string name);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static string file_util_savename (string filename);
 	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "FolderError.quark")]
+	public static GLib.Quark folder_error_quark ();
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "FolderInfo.build")]
+	public static Camel.FolderInfo folder_info_build (GLib.GenericArray<Camel.FolderInfo> folders, string namespace_, char separator, bool short_names);
+	[CCode (cheader_filename = "camel/camel.h")]
 	[Version (since = "2.22")]
 	public static void freeaddrinfo (void* host);
 	[CCode (cheader_filename = "camel/camel.h")]
 	[Version (since = "2.22")]
 	public static void* getaddrinfo (string name, string service, void* hints, GLib.Cancellable? cancellable = null) throws GLib.Error;
 	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "HeaderAddress.decode")]
+	public static Camel.HeaderAddress header_address_decode (string @in, string charset);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "HeaderAddress.fold")]
+	public static string header_address_fold (string @in, size_t headerlen);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "HeaderAddress.list_append")]
+	public static void header_address_list_append ([CCode (array_length = false, array_null_terminated = true)] Camel.HeaderAddress[] addrlistp, Camel.HeaderAddress addr);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "HeaderAddress.list_append_list")]
+	public static void header_address_list_append_list ([CCode (array_length = false, array_null_terminated = true)] Camel.HeaderAddress[] addrlistp, [CCode (array_length = false, array_null_terminated = true)] Camel.HeaderAddress[] addrs);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "HeaderAddress.list_clear")]
+	public static void header_address_list_clear ([CCode (array_length = false, array_null_terminated = true)] Camel.HeaderAddress[] addrlistp);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "HeaderAddress.list_encode")]
+	public static string header_address_list_encode ([CCode (array_length = false, array_null_terminated = true)] Camel.HeaderAddress[] addrlist);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "HeaderAddress.list_format")]
+	public static string header_address_list_format ([CCode (array_length = false, array_null_terminated = true)] Camel.HeaderAddress[] addrlist);
+	[CCode (cheader_filename = "camel/camel.h")]
 	public static string header_contentid_decode (string @in);
 	[CCode (cheader_filename = "camel/camel.h")]
-	public static long header_decode_date (string str, int tz_offset);
+	public static time_t header_decode_date (string str, int tz_offset);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static int header_decode_int (string @in);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static string header_decode_string (string @in, string default_charset);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static string header_encode_phrase (uint8 @in);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static string header_encode_string (uint8 @in);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static string header_fold (string @in, size_t headerlen);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static string header_format_ctext (string @in, string default_charset);
 	[CCode (cheader_filename = "camel/camel.h")]
-	public static string header_format_date (long date, int tz_offset);
+	public static string header_format_date (time_t date, int tz_offset);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static string header_location_decode (string @in);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static Camel.HeaderAddress header_mailbox_decode (string @in, string charset);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static void header_mime_decode (string @in, int maj, int min);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static string header_msgid_decode (string @in);
 	[CCode (cheader_filename = "camel/camel.h")]
-	public static string header_msgid_generate (string domain);
+	public static string header_msgid_generate (string? domain);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static GLib.SList<string> header_newsgroups_decode (string @in);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static GLib.SList<string> header_references_decode (string @in);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static void* header_set_param (void* paramsp, string name, string value);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static string header_token_decode (string @in);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static string header_unfold (string @in);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static string? headers_dup_mailing_list (Camel.NameValueArray headers);
 	[CCode (cheader_filename = "camel/camel.h")]
 	[Version (since = "3.16")]
-	public static string host_idna_to_ascii (string host);
+	public static string? host_idna_to_ascii (string? host);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (since = "3.54")]
+	public static bool hostname_utils_host_is_in_domain (string? host, string? domain);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (since = "3.44")]
+	public static bool hostname_utils_requires_ascii (string hostname);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static unowned string iconv_charset_language (string charset);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static unowned string iconv_charset_name (string charset);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static unowned string iconv_locale_charset ();
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static unowned string iconv_locale_language ();
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static int init (string certdb_dir, bool nss_init);
 	[CCode (cheader_filename = "camel/camel.h")]
-	public static void localtime_with_offset (long tt, [CCode (type = "tm*")] Posix.tm tm, int offset);
+	public static void localtime_with_offset (time_t tt, [CCode (type = "tm*")] Posix.tm tm, int offset);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static int lock_dot (string path) throws GLib.Error;
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static int lock_fcntl (int fd, Camel.LockType type) throws GLib.Error;
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static int lock_flock (int fd, Camel.LockType type) throws GLib.Error;
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static int lock_folder (string path, int fd, Camel.LockType type) throws GLib.Error;
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static int lock_helper_lock (string path) throws GLib.Error;
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static int lock_helper_unlock (int lockid);
 	[CCode (cheader_filename = "camel/camel.h")]
 	[Version (since = "3.4")]
-	public static long mktime_utc ([CCode (type = "tm*")] Posix.tm tm);
+	public static time_t mktime_utc ([CCode (type = "tm*")] Posix.tm tm);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static int movemail (string source, string dest) throws GLib.Error;
 	[CCode (cheader_filename = "camel/camel.h")]
 	[Version (since = "3.6")]
 	public static void pointer_tracker_dump ();
 	[CCode (cheader_filename = "camel/camel.h")]
 	[Version (since = "3.6")]
 	public static void pointer_tracker_track_with_info (void* ptr, string info);
 	[CCode (cheader_filename = "camel/camel.h")]
 	[Version (since = "3.6")]
 	public static void pointer_tracker_untrack (void* ptr);
 	[CCode (cheader_filename = "camel/camel.h")]
-	public static unowned string pstring_add (string string, bool own);
+	[Version (replacement = "Provider.get")]
+	public static Camel.Provider provider_get (string protocol) throws GLib.Error;
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "Provider.init")]
+	public static void provider_init ();
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "Provider.list")]
+	public static GLib.List<weak Camel.Provider> provider_list (bool load);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "Provider.load")]
+	public static bool provider_load (string path) throws GLib.Error;
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "ProviderModule.init")]
+	public static void provider_module_init ();
+	[CCode (cheader_filename = "camel/camel.h")]
+	public static unowned string? pstring_add (string? string, bool own);
 	[CCode (cheader_filename = "camel/camel.h")]
 	[Version (since = "3.22")]
-	public static bool pstring_contains (string string);
+	public static bool pstring_contains (string? string);
 	[CCode (cheader_filename = "camel/camel.h")]
 	[Version (since = "3.6")]
 	public static void pstring_dump_stat ();
 	[CCode (cheader_filename = "camel/camel.h")]
-	public static void pstring_free (string string);
+	public static void pstring_free (string? string);
 	[CCode (cheader_filename = "camel/camel.h")]
 	[Version (since = "2.24")]
-	public static unowned string pstring_peek (string string);
+	public static unowned string? pstring_peek (string? string);
 	[CCode (cheader_filename = "camel/camel.h")]
-	public static unowned string pstring_strdup (string string);
+	public static unowned string? pstring_strdup (string? string);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static size_t quoted_decode_step ([CCode (array_length_cname = "len", array_length_pos = 1.5, array_length_type = "gsize")] uint8[] @in, [CCode (array_length = false)] ref uint8[] @out, [CCode (array_length_cname = "savestate", array_length_pos = 2.5)] ref int[] saveme);
 	[CCode (cheader_filename = "camel/camel.h")]
@@ -3829,44 +3987,108 @@ namespace Camel {
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static bool search_header_match (string value, string match, Camel._search_match_t how, Camel._search_t type, string default_charset);
 	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (since = "3.57.1")]
+	public static time_t search_util_add_months (time_t t, int months);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (since = "3.57.1")]
+	public static int search_util_compare_date (int64 datetime1, int64 datetime2);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (since = "3.57.1")]
+	public static uint64 search_util_hash_message_id (string message_id, bool needs_decode);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (since = "3.57.1")]
+	public static time_t search_util_make_time (int argc, Camel.SExpResult argv);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (since = "3.57.1")]
+	public static int64 search_util_str_to_time (string? str);
+	[CCode (cheader_filename = "camel/camel.h")]
 	public static void search_words_free (void* words);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static void* search_words_simple (void* words);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static void* search_words_split (uint8 @in);
 	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "ServiceError.quark")]
+	public static GLib.Quark service_error_quark ();
+	[CCode (cheader_filename = "camel/camel.h")]
 	[Version (since = "2.24")]
 	public static void shutdown ();
 	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "StoreError.quark")]
+	public static GLib.Quark store_error_quark ();
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (deprecated = true, deprecated_since = "3.46", replacement = "StoreInfo.name")]
+	public static unowned string store_info_name (Camel.StoreSummary summary, Camel.StoreInfo info);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (deprecated = true, deprecated_since = "3.46", replacement = "StoreInfo.path")]
 	public static unowned string store_info_path (Camel.StoreSummary summary, Camel.StoreInfo info);
 	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (deprecated = true, deprecated_since = "3.46", replacement = "StoreInfo.set_string")]
+	public static void store_info_set_string (Camel.StoreSummary summary, Camel.StoreInfo info, int type, string value);
+	[CCode (cheader_filename = "camel/camel.h")]
 	public static int strcase_equal (void* a, void* b);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static uint strcase_hash (void* v);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static unowned string strdown (string str);
 	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (since = "3.44")]
+	public static bool string_is_all_ascii (string? str);
+	[CCode (cheader_filename = "camel/camel.h")]
 	public static string strstrcase (string haystack, string needle);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static Camel.MessageFlags system_flag (string name);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static bool system_flag_get (Camel.MessageFlags flags, string name);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static string text_to_html (string @in, Camel.MimeFilterToHTMLFlags flags, uint32 color);
 	[CCode (cheader_filename = "camel/camel.h")]
 	[Version (since = "3.24")]
-	public static long time_value_apply (long src_time, Camel.TimeUnit unit, int value);
+	public static time_t time_value_apply (time_t src_time, Camel.TimeUnit unit, int value);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "TransferEncoding.from_string")]
+	public static Camel.TransferEncoding transfer_encoding_from_string (string string);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "TransferEncoding.to_string")]
+	public static unowned string transfer_encoding_to_string (Camel.TransferEncoding encoding);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static string ucs2_utf8 (string ptr);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static void unlock_dot (string path);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static void unlock_fcntl (int fd);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static void unlock_flock (int fd);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static void unlock_folder (string path, int fd);
 	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "URL.addrspec_end")]
+	public static bool url_addrspec_end (string @in, string pos, string inend, Camel.UrlMatch match);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "URL.addrspec_start")]
+	public static bool url_addrspec_start (string @in, string pos, string inend, Camel.UrlMatch match);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "URL.decode")]
+	public static void url_decode (string part);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "URL.decode_path")]
+	public static string url_decode_path (string path);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "URL.encode")]
+	public static string url_encode (string part, string? escape_extra);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "URL.file_end")]
+	public static bool url_file_end (string @in, string pos, string inend, Camel.UrlMatch match);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "URL.file_start")]
+	public static bool url_file_start (string @in, string pos, string inend, Camel.UrlMatch match);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "URL.web_end")]
+	public static bool url_web_end (string @in, string pos, string inend, Camel.UrlMatch match);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (replacement = "URL.web_start")]
+	public static bool url_web_start (string @in, string pos, string inend, Camel.UrlMatch match);
+	[CCode (cheader_filename = "camel/camel.h")]
 	public static unowned string ustrstrcase (string haystack, string needle);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static string utf7_utf8 (string ptr);
@@ -3911,6 +4133,15 @@ namespace Camel {
 	[Version (since = "3.40")]
 	public static GLib.GenericArray<weak string> util_get_directory_variants (string main_path, string replace_prefix, bool with_modules_dir);
 	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (since = "3.44")]
+	public static string? utils_sanitize_ascii_domain_in_address (string? email_address, bool do_format);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (since = "3.44")]
+	public static bool utils_sanitize_ascii_domain_in_url (Camel.URL url);
+	[CCode (cheader_filename = "camel/camel.h")]
+	[Version (since = "3.44")]
+	public static string? utils_sanitize_ascii_domain_in_url_str (string? url_str);
+	[CCode (cheader_filename = "camel/camel.h")]
 	public static size_t uudecode_step ([CCode (array_length_cname = "inlen", array_length_pos = 1.5, array_length_type = "gsize")] uint8[] @in, [CCode (array_length = false)] ref uint8[] @out, [CCode (array_length_cname = "state", array_length_pos = 2.5)] ref uint32[] save);
 	[CCode (cheader_filename = "camel/camel.h")]
 	public static size_t uuencode_close ([CCode (array_length_cname = "len", array_length_pos = 1.5, array_length_type = "gsize")] uint8[] @in, [CCode (array_length = false)] ref uint8[] @out, [CCode (array_length = false)] ref uint8 uubuf[60], [CCode (array_length_cname = "state", array_length_pos = 3.5)] ref uint32[] save);
