a memo

Notes on Berylium Admin via Imap (?!?)

So you want to move large quantities of objects around, eh? You want to duplicate or delete them, organize them into folders, and share them with other people. Maybe you even want to filter them, line them up in queues, and share them with other sites.

Sounds like you want as much control over Berylium objects as you have over your email! Which would be great, right? Because not only could you use any imap email client to admin your site, but you could do it from anywhere via webmail.

Security is an issue, but much less so than with FTP, thanks to secure imap (and SSL in webmail).

An individual message would look something like this:

To: berylium@example.com
From: chris@psydeshow.org
Subject: image:52873

Two Person Tent In Blue

id: 52783
uri: http://example.com/images/root_52783
flavor: product
rank: 100
status: posted
public: 1
etc, as parsed html where necessary


---
Server key: 4309tu940j09d


So here's how it might go, step by step:
  1. Mary adds a Product document in http://example.com/products/tents/
  2. The Berylium server creates a new mail message, like the above, signed with a key. It is unread.
  3. I look at it (it is now read), and decide to mark it important, flagging it for later
  4. I move it to my drafts folder, edit it changing the price, and send it back to berylium@example.com for processing. It must be signed with my admin key.
  5. Berylium-Imapbot finds a new message. It checks my key, parses the email for values, and updates the database.
  6. Then it marks the previous message record for this object as deleted, and moves the new message record into its place. So there is now a deleted, old version for archiving or tossing, and a shiny new version that matches the one in the database.

But say I want to move it into http://example.com/products/tents/earth/, how do I do that?

The Berylium-Imapbot will need to spider its mailboxen constantly in order to watch out for new messages in unexpected places, just like it watches for new messages in its inbox. When it does find a message somewhere unexpected, it updates the database. Similarly, when it finds a deleted message in place, it updates.

Basically it spiders your mailbox and compares it with the database, and fixes any inconsistencies based on which version is newer. There is probably an off-the-shelf product that does this already, but we need a pretty solid integration.

IMAP is defined in RFC 2060.
PHP handler api: http://www.php.net/manual/en/ref.imap.php


By Chris Snyder on February 18, 2003 at 4:08pm

jump to top