charlierguo / gmail

A Pythonic interface for Google Mail
MIT License
1.77k stars 386 forks source link

Documentation on Message Components (sender, to, content-transfer encoding, etc) #22

Open cjohns38 opened 11 years ago

cjohns38 commented 11 years ago

Three questions all of which are related to how the data is returned once fetched.

1) Is there some documentation on the different pieces of information retrieved with the message? I'm looking to return the body of the message .body, who sent it, content-transfer encoding, etc. I'm using some google aliases and want to separate things out and need both the message and the sender returned.

2) Along the same lines, could the object returned be simplified into a dict? That would make driving through the data a little easier although potentially cumbersome if you pull a large number of emails.

3) You might consider adding some base64 code to decode the message. If you return a dict and see the content-transfer-encoding = 64 you could call the following type of "fix" for the text.

Example: Content-Transfer-Encoding: base64 text=base64.decodestring(messages[0].body)

Great project!