On Jan 21, 2009, at 6:53 PM, Molin MEN wrote:
But i'm still not sure about IMAP storage. Could you explain me in
detail about that?
I use Fedora, some of the paths might be different on your system.
You might want to look at this HOW-TO at The Linux Documentation
Project :
http://www.tldp.org/HOWTO/Mail-Administrator-HOWTO.html
I'll use angle brackets to designate names that are variable.
I am simplifying here to keep things brief.
If I get anything seriously wrong, please anyone else jump in and
correct me.
When a message comes into a mail server ( or Mail Transport Agent -
MTA ) if the message is for an account on that computer, it hands the
message off to a Local Delivery Agent ( LDA ) such as procmail.
procmail removes the envelope and puts the message into the proper
user's inbox, which is normally the file /var/spool/mail/<username>.
If a user connects via IMAP, messages are shown in mailboxes. The
inbox resides in /var/spool/mail/<username> , however any other
mailboxes are stored in the user's home directory, usually /home/
<username>/ . Many administrators prefer to have mailboxes in a sub-
directory of user home directories, and some command-line Mail User
Agents ( MUA ) _need_ a sub-directory. The most common sub-directory
is "mail" so the path where non-inbox messages are stored are in /
home/<username>/mail/<mailboxname>
There are two common formats that messages are stored - mbox and
maildir.
mbox is a single file that contains many messages. maildir is a directory that contains a file for each message.
That should get you started in the right direction.
I just wonder whether it is stored in IMAP storage as what u said
RoundCube connects to an IMAP server just as Thunderbird ( a MUA ) does. Messages are stored on the IMAP server.
What do you mean by caching of message?
The messages always reside on the IMAP server.
Thunderbird, for example, makes local copies ( a cache ) of what is
on the IMAP server to improve performance.
RoundCube can be configured to create a cache of IMAP message too.
So, as described in the config file comments -
// this is recommended if the IMAP server does // not run on the same machine
It _may_ increase performance for the database to make a "local copy"
of the IMAP messages depending on your computing environment.
Most of the time it won't, but if the database server runs on the
same computer as the webserver,
and the IMAP server is on a different computer, the database caching
might help.
Testing is the only way to determine if having RoundCube use a
database cache of IMAP messages helps.
What do you mean by serialize into a big pile here?
I mentioned mbox and maildir formats above.
Since it takes a bunch of PHP code ( and processing time ) to parse
through the IMAP messages in order to display them in the web page,
what is cached in the database is the parsed PHP-specific data from
the messages, serialized into a form that the database can store. To
a human, that serialized data doesn't look much like a message
anymore, it is in a format meant to be understandable by PHP. The
message data would be more understandable to a human when viewed on
the IMAP server rather than the pre-parsed, serialized cached data.
One last note.
Messages that have HTML parts or attachments are difficult to read
via a text editor or text pager directly as they are stored on the
IMAP server, particularly if the messages are stored in mbox format
and the mailbox is large.
HTH