Hmmm... I should warn you, however, that the main message reading loop in
the client could take a few reads before you really grok what's going on.
It's probably some of the oldest code in the entire Citadel system and it
hasn't really been refactored since I wrote the first version of it in
1987 (back when my C code looked like BASIC).
For reading messages, though, the MSGP and MSG4 server commands are your
friends. MSGP tells the Citadel server the preferred MIME types you'd
prefer to receive, and MSG4 delivers messages to you in your preferred
format(s) if at all possible. In the current implementation, the client
prefers to receive text/html if it can (which gets rendered by a
client-side HTML parser) and of course text/plain for messages which
arrived from the Internet in that format. I'd like to deprecate
text/x-citadel-variformat eventually, but the text client is still
generating messages in that format so it'll be a while before that can
happen. text/x-citadel-variformat is the MIME type we selected for the
legacy "all linebreaks are soft except when followed by an indentation on
the next line" format that goes all the way back to the original Citadel
BBS designed by Jeff Prothero on CP/M in 1981.
The MSG0 command is deprecated. The only reason it still exists at all
is because the bare-bones output it generates is perfect to feed into the
full text indexer. But the indexer gets at it via an internal API rather
than a server command, so the command will eventually go away. Right now
it's kept available for really old clients and for diagnostic purposes.
But this shouldn't give you any trouble because MSG4 gives you what you
need already. You can also get each message in full MIME-encoded RFC822
format using the MSG2 command, but I don't recommend this because it
forces the client to download each message in its entirety, including
attachments, even if the user doesn't want it all.
Hope I didn't confuse you too much. It is an elegant design once you
wrap your head around it.