Just for the record, it turns out that doveadm is the key to happiness here. It lets me find and manipulate messages by message-id (or any other header) which is what I needed. rg