in reply to Random email parsing

I definetely suggest you use a state machine. It'll help you with the maintenance of the parser in case the format changes (and chances are that it probably will).