Dump schema
sqlite3 Accounts4.sqlite .schema
Dump data
sqlite3 Accounts4.sqlite .dump
Apply changes to main database file
Make sure to make copies of the original files and only work on those duplicates. This process should reduce the size of the Accounts4.sqlite-wal to 0 bytes.
sqlite3 Accounts4.sqlite vacuum
List primary key, account description and user name of all Mail accounts
sqlite3 Accounts4.sqlite 'SELECT Z_PK, ZACCOUNTDESCRIPTION, ZUSERNAME FROM ZACCOUNT WHERE ZOWNINGBUNDLEID = "com.apple.mail"'
Show email addresses for the account with primary key 11
sqlite3 Accounts4.sqlite 'SELECT hex(ZVALUE) FROM ZACCOUNTPROPERTY WHERE ZKEY = "IdentityEmailAddress" AND ZOWNER = 11' | xxd -r -p > ~/Desktop/dumped.plist && plutil -convert xml1 ~/Desktop/dumped.plist && cat ~/Desktop/dumped.plist