mbox parsing code python and perl