View Single Post
  #47 (permalink)  
Old 08-09-2008, 05:14 PM
jkusnetz jkusnetz is offline
What's Jailbreak?
 
Join Date: Aug 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Check emails too

I found the mail database and from there you can look for unread messages with different attributes.

if [ `echo 'select count(*) from messages where read="0" and _to like "%mymail@yahoo.com%";' | sqlite3 /var/mobile/Library/Mail/Envelope\ Index` -gt 0 ]

In this example it checks for email going to a dedicated yahoo push email box. But you can query for other attributes:

strings /var/mobile/Library/Mail/Envelope\ Index | less
SQLite format 3
messages
H{[r
Hw{C
Ktablemessagesmessages

CREATE TABLE messages (ROWID INTEGER PRIMARY KEY AUTOINCREMENT,
remote_id INTEGER,
sender,
subject,
_to,
cc,
date_sent INTEGER,
date_received INTEGER,
sort_order INTEGER,
mailbox INTEGER,
remote_mailbox INTEGER,
original_mailbox INTEGER,
flags INTEGER,
read,
flagged,
deleted,
size INTEGER,
color,
encoding,
content_type)

So you should be able to filter by subject, sender, etc or any combination

I have no idea how to do it, but it would be nice to have a configuration file where you could setup filters to notify on.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote