On Thu, 2006-09-28 at 00:50 -0700, Aaron Stone wrote: > On Thu, 2006-09-28 at 09:27 +0200, Paul J Stevens wrote: > > > > Aaron Stone wrote: > > > Something I've been thinking about, though, is that I'd like to be able > > > to dump items as they are being deleted. Generating maybe an mbox format > > > file of all messages / physmessages / mailboxes dumped in a given > > > session would provide some peace-of-mind and an audit trail in case > > > something goes wrong. > > > > > > I suppose an important question to ask is what an mbox formatted > > > physmessage or mailbox looks like... > > > > mbox format simply means the message starts with a From_ header. > > > > in dbmail-mailbox.c you'll find > > > > static size_t dump_message_to_stream(struct DbmailMessage *message, > > GMimeStream *ostream) > > > > which does just what you need: write a DbmailMessage in mbox format to a > > stream. If the message doesn't have a From_ header yet, it constructs > > one by deducing the envelope sender. > > What would we do with a single detached row in the physmessage table?
Or say a single messageblk. Physmessage would just be a mapping entry, nothing special there; or is there? Removing a physmessage might cause the next run to remove a messageblk. Maybe dumping out the entries as SQL INSERT queries would be good, so that they could be re-inserted directly if something went horribly wrong. Aaron