Attached is the latest imap-db.el. It only does file-exists-p right now, but it's got the functions for file retrieval and file creation in place. It can't write over an existing file yet (replace body). Plus, I think the file retrieval may need to get just the body, not the body plus the headers. imap-db-create-article is especially hairy. I'm not sure I'm doing the right things in there. I'm not inserting the new article in the nnmail cache, for instance. I added the imap-possibly-change-group function, feel free to move it to imap.el if it's OK. I picked a fairly simple format: nnimap://mail.lifelogs.com/ding?SUBJECT%20spam that's it, no UIDs, no authentications, no uidvalidity. I'm happy to let nnimap.el handle all of that. Anyhow, let me know if there are obvious bugs or errors in the code. Ted