When using the UID SEARCH command with HEADER MESSAGE-ID as criteria (and probably SEARCH as well), the code throws an BAD Error in arguments error. With some debugging, I found the following exception being thrown in that case:
LumiSoft.Net.ParseException: Unknown search key ''.
at LumiSoft.Net.IMAP.IMAP_Search_Key.ParseKey(StringReader r) in /home/ddreschner/work-git/smtp4dev/imapserver/New.LumiSoft.Net/IMAP/IMAP_Search_Key.cs:line 196
at LumiSoft.Net.IMAP.IMAP_Search_Key_Group.Parse(StringReader r) in /home/ddreschner/work-git/smtp4dev/imapserver/New.LumiSoft.Net/IMAP/IMAP_Search_Key_Group.cs:line 49
at LumiSoft.Net.IMAP.Server.IMAP_Session.SEARCH(Boolean uid, String cmdTag, String cmdText) in /home/ddreschner/work-git/smtp4dev/imapserver/New.LumiSoft.Net/IMAP/Server/IMAP_Session.cs:line 4432
Used example:
UID SEARCH HEADER MESSAGE-ID <20260106224430.Horde.Ok6GdEyWhiijOVj8ClvE4U8@example.local>