<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>NFG's DBMail Blog - database</title>
    <link>http://blog.dbmail.eu/</link>
    <description>You get what you need</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.2.1 - http://www.s9y.org/</generator>
    <pubDate>Thu, 18 Feb 2010 03:01:33 GMT</pubDate>

    <image>
        <url>http://blog.dbmail.eu/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: NFG's DBMail Blog - database - You get what you need</title>
        <link>http://blog.dbmail.eu/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Pruning the dbmail_headervalue table </title>
    <link>http://blog.dbmail.eu/archives/12-Pruning-the-dbmail_headervalue-table.html</link>
            <category>database</category>
    
    <comments>http://blog.dbmail.eu/archives/12-Pruning-the-dbmail_headervalue-table.html#comments</comments>
    <wfw:comment>http://blog.dbmail.eu/wfwcomment.php?cid=12</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://blog.dbmail.eu/rss.php?version=2.0&amp;type=comments&amp;cid=12</wfw:commentRss>
    

    <author>nospam@example.com (Paul J Stevens)</author>
    <content:encoded>
    &lt;p&gt;
In DBMail 2.2 the dbmail_headervalue table will contain all header-values for all messages in store. Even for medium-sized installations this can easily result in a very large table.
&lt;/p&gt;
&lt;p&gt;
However, since that table is just about only used for IMAP search you might consider dropping a couple of headernames from the cache.
&lt;/p&gt;
&lt;p&gt;
For example:
&lt;pre&gt;
DELETE FROM dbmail_headername WHERE headername = &#039;received&#039;;
&lt;/pre&gt;

will delete from dbmail_headervalue all entries regarding the Received header. 
&lt;/p&gt;

&lt;p&gt;
To determine which headernames should be dropped you could use a view like this:
&lt;pre&gt;
CREATE VIEW header_count AS 
    SELECT count(1) AS count, n.id, n.headername 
    FROM dbmail_headervalue v 
    LEFT JOIN dbmail_headername n ON v.headername_id=n.id 
    GROUP BY n.id;
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
After that you can do:
&lt;pre&gt;
SELECT * FROM header_count ORDER BY count; 
&lt;/pre&gt;

and delete all headernames from dbmail_headername for those headers you deem unlikely to ever be used in IMAP search.

&lt;pre&gt;
DELETE FROM dbmail_headername WHERE headername = &#039;Received&#039;;
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;Doing this for a couple of the most prolific - but un-used headers - will drastically reduce the size
of the dbmail_headervalue tables. But remember you will have to keep an eye on the header_count, and re-issue the
delete queries on a regular basis.
&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Sat, 13 Feb 2010 11:09:35 +0100</pubDate>
    <guid isPermaLink="false">http://blog.dbmail.eu/archives/12-guid.html</guid>
    <category>database</category>

</item>
<item>
    <title>A RESTful interface is coming</title>
    <link>http://blog.dbmail.eu/archives/7-A-RESTful-interface-is-coming.html</link>
            <category>database</category>
            <category>protocols</category>
    
    <comments>http://blog.dbmail.eu/archives/7-A-RESTful-interface-is-coming.html#comments</comments>
    <wfw:comment>http://blog.dbmail.eu/wfwcomment.php?cid=7</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.dbmail.eu/rss.php?version=2.0&amp;type=comments&amp;cid=7</wfw:commentRss>
    

    <author>nospam@example.com (Paul J Stevens)</author>
    <content:encoded>
    &lt;p&gt;
Again and again, dbmail administrators ask us about the best way for their application 
to talk to dbmail. And our answer has always been the same: talk IMAP. 
&lt;/p&gt;
&lt;p&gt;
However, IMAP is a notorious protocol for many. Not because it is inherently evil, but because 
creating a parser for imap formatted data is not a trivial thing. It&#039;s simply a lot of work, and easy 
to get wrong. It&#039;s also top-heavy; a lot of the capabilities in IMAP are simply not needed at all by
your typical webapp developer.
&lt;/p&gt;
&lt;p&gt;
So the question was: how can we design a solution that will allow an application developer to quickly
integrate with dbmail, using standard tools and languages. 
&lt;/p&gt;
&lt;p&gt;
Being forward compatible could be considered a secondary, but no less important requirement. The chosen
approach - short of IMAP - often comes as custom build queries talking directly with the database backend. Few if any
who walked this path, spent any effort on supporting database servers other than the one they use. This does not
make for long-term viability, and does not support the community at large. Also, dbmail&#039;s schema has and will - 
quite possibly - change. Retrieving a message from the database was simple, but is 
no longer. Finally, not being able to leverage the scalability features included in the recent releases means you
have to worry about a denial of service on your database server when the number of visitors of your webapp
increases.
&lt;/p&gt;
&lt;p&gt;
So enters a solution: dbmail-httpd. A simple event-driven daemon that will expose the object model of dbmail
through a RESTful interface. A php5 userland module will also be provided both to test the interface and to 
demonstrate the power of this approach. Where possible, requested data will be returned as JSON. This makes parsing
completely trivial of course.
&lt;/p&gt;
&lt;p&gt;
It is our hope and expectation that this will drive development for a new class of webmail interfaces built on top of dbmail, but also 
enable construction of a new - and native - administration interface that will not require additional hosting sit-ups.
&lt;p&gt;
so stay tuned for more.
&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Fri, 03 Jul 2009 11:43:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.dbmail.eu/archives/7-guid.html</guid>
    <category>database</category>
<category>webmail</category>

</item>
<item>
    <title>Interfacing with the DBMail database</title>
    <link>http://blog.dbmail.eu/archives/3-Interfacing-with-the-DBMail-database.html</link>
            <category>database</category>
            <category>protocols</category>
    
    <comments>http://blog.dbmail.eu/archives/3-Interfacing-with-the-DBMail-database.html#comments</comments>
    <wfw:comment>http://blog.dbmail.eu/wfwcomment.php?cid=3</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.dbmail.eu/rss.php?version=2.0&amp;type=comments&amp;cid=3</wfw:commentRss>
    

    <author>nospam@example.com ()</author>
    <content:encoded>
    &lt;p&gt;
A typical question that pops up now and then is about direct database access:
&lt;/p&gt;
&lt;blockquote&gt;
I&#039;m looking for an application to help me save emails to a Database. I
read about your email solution, DBMail, and it looks really good. I
already have a mail server I&#039;m using for my webmail, but my question is
whether it would be possible to setup logging of emails to a database
using my current mail server and DBMail.
&lt;/blockquote&gt;

&lt;p&gt;
DBMail uses a database to store its messages. Currently PostgreSQL,
MySQL and Sqlite are supported. The intent of the database backend is to
provide speed, scalability and integrity in storage. The database
backend is not especially suited for direct access. The database schema
is heavily normalized and contains numerous indexes and caching tables
for speed, as well as trigger logic to ensure data integrity.
&lt;/p&gt;
&lt;p&gt;
It&#039;s best to let DBMail manage the database contents and do message
storage and retrieval through the appropriate mail protocols (LMTP for
storage, POP3 or IMAP4 for retrieval). An additional advantage of this
approach is, you can swap in or out any mail server under your webmail
scripts layer. These protocols are widely used and well understood.
&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Tue, 20 May 2008 10:55:00 +0200</pubDate>
    <guid isPermaLink="false">http://blog.dbmail.eu/archives/3-guid.html</guid>
    <category>database</category>
<category>imap4</category>
<category>pop3</category>
<category>protocols</category>
<category>webmail</category>

</item>

</channel>
</rss>