The Unix Format

In Unix format messages are the text of a file, different messages are separated by a "separator line", whose format we will explain now.

The first line of every message in a folder in Unix format looks like

 From Mon May  8 22:48:30 2000 -0700

We will make two remarks about it, one is the format and the other one is the content.

With respect to the format, notice that the line begins with the word "From", not with "from" or "FROM". Exactly as it say there. It is so important that the line MUST begin with this word that when you send a message it's very likely that your mailer will add a ">" to every line that begins with "From" so that the recipients mailer will not confuse it with a separator line.

What follows the word From is one space, and a valid e-mail address. Many delivery agents (like procmail) actually write the name of the sender in there, UW-IMAP server writes the name of the owner of the mailbox. Since Pine does not make any use of this part of the line, it is not important which address you write in there. Other clients may make use of this, though.

Then there's one space and the date in the following format:

The number in parenthesis refer to the length of the field, so WEEKDAY is written in 3 characters. Notice that the "DAY" is written in 2 characters, if you see above you may not notice this, but it is quite important, what happened in the example above is that the DAY really is "08", but the number zero got replaced by a blank space, so it is actually two characters long.

In old Berkeley format there was no TIMEZONEDIFFERENCE, if you need to get rid of this part of the field you can, if you would like that the server don't save the TIMEZONEDIFFERENCE, you should add under feature-list in your .pinerc file "quell-berkeley-format-timezone".

Now let's talk about the content. Pine does actually use the date that you write in there, so you should be careful about what you write in there if you ever need to. You should write the date that is closer to the arrival time of the message to the folder. You can know this by reading the headers of the message, in fact, exactly below the separator line there should be a line that says something like:

Received: from ([])
        by (8.9.1/8.9.1) with ESMTP id TAA21560
        for ; Sun, 3 Jan 1999 19:14:39 -0800 (PST)
Received: from dave - by with Microsoft SMTPSVC;
         Sun, 3 Jan 1999 19:14:11 -0800

There may be many lines starting with the word "Received:", you want to pay attention to the first one and use the date that appears there, in this case "Sun, 3 Jan 1999 19:14:39 -0800". Notice that you'll have to adapt this date to conform to the format that we described above.

UW-IMAP server (and therefore Pine) use this date to sort the messages that are contained in a folder, if you do not care about Pine correctly sorting these messages you can actually write the same separator line in all messages. The important thing about the line is the format, which say where messages are, and ocassionally its content.

Two empty lines must preceed the separator line, these lines indicate the end of the message that preceed the message being separated, however, the first line of a Unix format folder must be the separator line.

More about the Unix Format

Also notice that the headers of the message are separted from the actual content of the message (called the body) by a blank line, in other words, you should not leave blank lines in the header of any message.

The Headers

Every message has headers, the information that identifies a message, includes information about who sent the message, who is the intended receiver, date it was sent, etc. Most of the headers are self explanatory, although not how to interpret its information. Every header starts at the beginning of the line with a non-blank character, lines that begin with blank spaces are supposed to be continuations of the preceding line, and so on.

As we pointed out before, there is a line that follows the From separator line, actually there is a whole group of lines that follow the separator line, the first one after the separator line should say something like:

 Received ... 

Actually, there should be several of these lines. The information that these lines give you is the route that the e-mail took to get from the sender of the message to you.

In particular, when the message is sent, your SMTP server adds the first line of the "Received" header, then the next server that receives it records that it received and sends it again to the next server. Every time the new server that receives a message records the "Received" line on top of all the others "Received" lines. In particular, the route of an e-mail is read from bottom to top.

When a server receives a message, it records the machine/server from which it received the message and also its name, then the message is sent to the next machine/server and so on, so for example

Received: from ([])
        by (8.9.1/8.9.1) with ESMTP id TAA21560
        for ; Sun, 3 Jan 1999 19:14:39 -0800 (PST)

says that the message was received by, and that it was received from, this was a message for

If you ever need to complain about spam you need to relay to the system administrator that you are complaining to, the information contained in the Received: headers, because this one says exactly who sent the message. It also inidcates which servers have allowed spam through them. In most cases spam is not allowed, so it's good to inform the owner of the server that his/her server is being used to send spam.