How to Modify the Message-ID Header in KumoMTA?

Hi everyone, I’m currently working with KumoMTA and need to customize the Message-ID header for outgoing emails. However, I’m not sure how to achieve this.

I’d first use msg:remove_all_named_headers('Message-ID') to remove any existing message ID and then use msg:append_header('Message-ID', '<some-id>') to add whatever message ID you need in the smtp_server_message_received and http_message_generated event handlers.

thank you