Lua primitives: on_delete_message()
If you define the function on_delete_message() it will be invoked immediately prior to the removal of the selected/specified message.
The function will be invoked with the path to the message on-disk.
function on_delete_message( path ) msg( "Message deleted: " .. path ); end
NOTE: Any return value is ignored, and you cannot prevent the deletion with this hook. Although if you wish you could save any deleted message to a "trash" folder - which the trash() example demonstrates.
This function has been available since version 0.19.