Jesse Norell wrote:
Hello,
Probably the best place to rebuild the header cache (because
you added more headers you're interested in or whatever other
reason) would be with dbmail-maintenance. The message injectors
would keep it up to date for new messages, of course.
One thing you need to make sure you handle is when there are
multiple headers of the same name in the message - the most obvious
example is Received-by, but others certainly show up, too (eg.
Delivered-To, X-Spam-*, etc.). You could either not add the
UNIQUE(message_id, header_type) and allow multiple entries, or
even concatenate all the headers together so you get a single
header_cache entry for all the headers of that type, and of course
have to parse them out on the client (which I guess you do
anyways, to unfold whitespace).
Well,
The though was to build the header cache and add cached headers
when the client requested the headers, not at message receive time.
You are right about the UNIQUE statement, but in my limited mind,
I had hard to imagine multiple "subject:" headers, even if it is
allowed.
This way will the database adapt itself to the mail clients that
are accessing it.
/Magnus