Why we can't read the message text from GMail

290 views
Skip to first unread message

Brian Rosenthal

unread,
Mar 13, 2014, 12:50:52 PM3/13/14
to tas...@googlegroups.com
After a bit of digging and failure trying to read the message body of a GMail message, I thought I'd report what I've found in case someone can add something.

  • GMail messages are kept in the "messages" table of an SQLite database named in the form of mailsto...@domain.com.db, in /data/data/com.google.android.gm/databases (requires root to access).
  • This table has three message body related fields: 
    • "snippet", which is a short, plain text excerpt of the message body
    • "body", which contains the HTML text of the body if it's short (only a few words?)
    • "bodycompressed", which contains a compressed version of the body if the body isn't very short.
  • Either "body" or "bodycompressed" is used, not both.  
  • Almost every message will be longer than will fit in "body".
  • "bodycompressed" can be extracted from the database into a file and converted to binary file, but I can find no archive utility that can expand it.
This is a far as I can go without knowing how to extract the body text.

Any ideas?

I guess we're either stuck with "snippet" or K-9.

-Brian


nanobrain

unread,
Mar 13, 2014, 1:35:42 PM3/13/14
to tas...@googlegroups.com

Brian Rosenthal

unread,
Mar 13, 2014, 1:49:04 PM3/13/14
to tas...@googlegroups.com
I saw that also, but didn't see that anyone actually tried it.  Anyone familiar with Python?

m3741

unread,
Mar 19, 2014, 2:48:41 PM3/19/14
to tas...@googlegroups.com
That python looks legit to me. It's pretty simple but I haven't tried it and I have no idea what the compressed version of the body looks like so I can't guarantee that it'll decompress it properly.


On Thursday, March 13, 2014 12:50:52 PM UTC-4, Brian Rosenthal wrote:

Steve Harvey

unread,
Mar 19, 2014, 3:41:13 PM3/19/14
to tas...@googlegroups.com
Not sure what you goal is, but script.google.com allows you to write a script from which you can trigger an auto remote url. You can set event based triggers to scripts in google docs or time based for docs or gmail. I have a script that runs every minute and processes new mail for this purpose. Super easy and their tutorials are great. Google scripts+auto remote+tasker is an awesome combo. Hopefully this helps.

Steve

Brian Rosenthal

unread,
Mar 19, 2014, 5:06:50 PM3/19/14
to tas...@googlegroups.com
I've installed SL4A, but I haven't had time to try it and see.

Brian Rosenthal

unread,
Mar 19, 2014, 5:07:45 PM3/19/14
to tas...@googlegroups.com
I'd like to have select emails read to me through my speaker phone in my car.  I have set this up with text messages and find it very handy.
Reply all
Reply to author
Forward
0 new messages