POP3 server responses end in "\r\n". Remember that "\n" in C# is just an 0A like in C, not an 0D 0A like in Perl. Check for this sequence at the end of the byte array you read from the SslStream - don't use the 'wait for a count of 0 bytes to be returned' method in a loop, as you will get a never-ending network wait with that.
Sending TOP m n elicits 3 server responses:
1. +OK
2. The headers, blank line and top n lines, all together
3. A full stop
Anti-nuisance lawsuit warning: The purpose of these notes is to remind me, Zoegond, of stuff or to help me work stuff out. They may contain mistakes.
Quick
- ($a, $b....) = unpack("A2A7...", $packed)
- push( array, list )