|
|
#1 |
|
Major Leaguer
Join Date: Mar 2005
Posts: 322
|
Connecting to Mail's SQLite database
If I understand correctly, Mail.app uses an SQLite database to store messages. Is it possible to connect to this database using an application other than Mail? I want to write a PHP script to access the mailbox.
Thanks Mark |
|
|
|
|
|
#2 |
|
All Star
Join Date: Jan 2002
Location: CO, USA
Posts: 908
|
I don't believe the text of messages is stored in the sqlite DB, but other data (subject, sender, recipient, etc) are. The DB is in the file ~/Library/Mail/Envelope Index, and the sqlite3 command can view it:
Code:
$ sqlite3 /Users/blb/Library/Mail/Envelope\ Index SQLite version 3.1.3 Enter ".help" for instructions sqlite> .schema CREATE TABLE addresses (ROWID INTEGER PRIMARY KEY, address, comment, UNIQUE(address, comment)); ... sqlite> select count(*) from messages; 41492 |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|