Variation for lMAP Mailboxes

Mailboxes that use mbox-like formats need to be modified to support the Internet Message Access Protocol (IMAP). IMAP is presented in detail in Chapter 11, The Internet Message Access Protocol. In that protocol, mailboxes and individual messages may be marked with various flags to denote state, such as “new” or “answered”.

Typically, message flags are stored in the messages themselves, by inserting an additional header. Most mbox-based systems use the special header Status for this purpose. You might note in the preceding example messages that the Netscape MUA also writes a special header called X-Mozilla-Status. This is used to retain MUA-specific state information, such as which messages have been forwarded, replied to, etc.

Mailboxes, on the other hand, have to store their flags somewhere outside of the messages in the box. The most common solution to this problem is to add a “pseudo message” into the mailbox that holds state information for the box itself. Pseudo messages are in simple RFC 822 format and are normally placed at the top of the mailbox file. They hold special message headers that hold state information and normally have a plain text explanatory note in the body of the message.

An example pseudo message for an IMAP mailbox looks like this:

From MAILER-DAEMON Thu Aug 27 14:40:22 1998 Date: Thu, 27 Aug 1998 14:40:22 +1000 (EST) From: Mail System Internal Data <MAILER-DAEMON@morris.staff.plugged.com.au> Subject: DON'T DELETE THIS MESSAGE -- ...

Get Programming Internet Email now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.