I could still have a crack at using email.parser.Parser if you thought that would produce nicer code, I just hadn't gotten to it yet