Reader.SkipUntil/ReadUntil considered harmful
First off, I want to say that S22.Imap is one of the better IMAP client libraries I've looked over, so I want to offer some friendly help even though I am writing my own IMAP library.
Your body[structure] reader is the right sort of approach, but the use of things like Reader.SkipUntil(')') and Reader.ReadUntil (')') can easily be faulty if there is a quoted string token containing the character you are scanning for.
A better approach is to have your Reader class return tokens. An entire quoted-string would be a single token. An atom would be a token. A '(' would be a token. A ')' would be a token. And so on...
This will help make your parser a whole lot more robust and it wouldn't be all that difficult to implement.
Hopefully you find my advice helpful.
Hello,
ah I hadn't thought of that. Thanks for the heads-up, I'll look into it.
cheers, smiley22
Glad to help!
Good working together for community, thanks a lot.
Pavel from Imapx will be use ANTLR. Maybe better use MimeKit and MailKit for parsing.