Toby Documentation

April 24, 2004

Message Retrieval

After a user logs in, Toby connects to that user's email server to check for new messages. If there are any new messages, Toby downloads them from the server and copies them to the email database.

If the user has chosen to have his messages left on the server, Toby will mark these messages in the database as "temp" messages. Then, the next time this user logs in, Toby will delete any "temp" messages this user has before checking the server again. This allows users to use Toby without committing to storing their messages on whatever server Toby is running on.

To prevent duplicate messages showing up in Toby for these users, messages will only be downloaded once for each time this user logs in. That is, Toby will continue to attempt to download new messages each time the user opens their inbox, but after one or more messages are downloaded, Toby will not connect to the user's mail server until the user has logged out and logged in again. This is currently classified as a bug and will hopefully be fixed in a future release.

Alternatively, if the user has chosen to have Toby save his messages, Toby will then delete the messages from the server.

Toby stores e-mail messages in the following fields in the email database:

FieldTypeValue
idAuto-incrementing integerThis is the unique identifier of each message in the database.
userIntegerThis is the is of the user to whom this message belongs. This value corresponds with the `id` field in the email_users table.
headersTextThis contains the full headers of the message.
message(Long)textThis contains the first 100 000 characters of the message body. This limitiation is due to the maximum size some servers impose on MySQL queries. The remainder of the message is stored in 100 000 character chunks in the email_overflow database.
Return-Path through DateVarchar(255) or TextThese are individual header values that are used frequently by Toby and are stored in separate fields for easier access.
num_attachmentsIntegerThis contains the number of attachments in the message, determined at the time when the message was first downloaded.
has_html(Tiny) integerIndicates whether (1) or not (0) the message has an HTML portion.
NiceDateVarchar(14)This is a YYYYMMDDHHMMSS timestamp of the sent-time of the message, stored in this format for easier manipulation by Toby.
folderIntegerFolder id of the folder in which this message lives. This value corresponds with the `id` field in the email_folders table.
seen(Tiny) integerIndicates whether (1) or not (0) the user has read this message.
temp(Tiny) integerIndicates whether (1) or not (0) this message is temporary.

After Toby has downloaded any new messages, it loads the main client screen.

Next: The preview pane