Manitou-Mail Home

18.  Table: mail

Structure of mail

mail_id

integer

The unique internal mail identifier.It is generated from the seq_mail_id sequence.

sender

text

The RFC822 address part extracted from the "From" address. If there are several senders (quite uncommon, but not illegal), the names are joined by a comma. The value is also arbitrarily truncated at the size of the database field (200 characters)

recipients

text

The contents of the headers To: field, decoded accorded to the rfc-2047 rules.

sender_fullname

text

The RFC822 name part extracted from the "From" address. If there are several senders (quite uncommon, but not illegal), the names are joined by a comma.

subject

text

The contents of the headers subject field, decoded according to the rfc-2047 rules.

msg_date

timestamp with time zone

The date and time at which the mail has been inserted into the database. For incoming messages, it is different from the sender_date (see below the definition of the sender_date field) The timezone is also that of the manitou system, not the sender's.

DEFAULT now()

sender_date

timestamp with time zone

The date and time at which the mail has been sent by the originator. It depends on the sender computer's date and time accuracy.

identity_id

integer

When not null, that field references an entry in the identities table. Incoming mails are assigned an identity depending on the configuration of manitou-mdx. For outgoing mails, the identity_id field will be set by the choice of the sender made within the user interface.

REFERENCES identities

status

integer

A mask of bits that contain cumulative information about the message. The bits and the corresponding mask in hexadecimal are:

  • 0 (0x1): Set if the message has been read.
  • 1 (0x2): Reserved. Do not use.
  • 2 (0x4): Set if a reply to the message has been made.
  • 3 (0x8): Set if the message has been forwarded.
  • 4 (0x10): Set if the message has been trashed.
  • 5 (0x20): Set if the message has been archived.
  • 6 (0x40): Set if the message is currently locked by a user for processing. Not used in current versions.
  • 7 (0x80): Set if the message is meant to be sent (and not cleared when it has actually been sent).
  • 8 (0x100): Set if the message has been sent (that is, successfully passed to the local delivery agent).
  • 9 (0x200): Set if a reply is currently being made by an operator. Not used in current versions.
  • 10 (0x400): Set if the message has been composed and scheduled for later sending.

The bits are added together. For example, a message that has been read, then replied to, and thus marked as archived should have its status set to 1+4+32=37 in decimal or 0x25 in hexadecimal. A status of zero indicates a new message.

mod_user_id

integer

Internal unique ID of the person (foreign key into the users table) that most recently processed the message (replied,forwarded,trashed,archived, or composed for an outgoing message)

thread_id

integer

Internal unique ID of the discussion thread if a thread is referenced and recognized in the message (by looking at the Reply-To or References header fields). Null if the message couldn't be assigned to a thread.

message_id

text

The value of the Message-ID header field, truncated if necessary.

in_reply_to

integer

If the message is a reply to another message that also is in the mail table, then that field is a pointer to that message, by its internal unique ID (foreign key to a mail_id). Otherwise it's null.

date_processed

timestamp with time zone

Date and time when the message has been archived, or trashed, or replied to, or any action of processing the message.

priority

integer

The priority of the message, as set by filter rules or by a user.

flags

integer

A bitfield used as a cache to avoid the cost of looking up certain tables to get boolean results ("has" / "has not"). Currently, bit 0 indicates that the message has attachments and bit 1 indicates that it has a private note. Future versions will use more bits to cache more information.

raw_size

integer

The number of bytes of the mailfile initially used to import the message.

Tables referencing mail via Foreign Key Constraints