python code for parsing email objects with MIME specification