<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://manitou-mail.org/wiki/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://manitou-mail.org/wiki/feed.php">
        <title>Manitou-Mail Wiki</title>
        <description></description>
        <link>https://manitou-mail.org/wiki/</link>
        <image rdf:resource="https://manitou-mail.org/wiki/lib/exe/fetch.php/wiki:dokuwiki-128.png" />
       <dc:date>2026-04-16T02:37:54+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://manitou-mail.org/wiki/doku.php/adv_sample_user_queries_plus?rev=1621081317&amp;do=diff"/>
                <rdf:li rdf:resource="https://manitou-mail.org/wiki/doku.php/sql_analysis?rev=1548352547&amp;do=diff"/>
                <rdf:li rdf:resource="https://manitou-mail.org/wiki/doku.php/support_functions?rev=1524223049&amp;do=diff"/>
                <rdf:li rdf:resource="https://manitou-mail.org/wiki/doku.php/start?rev=1508338557&amp;do=diff"/>
                <rdf:li rdf:resource="https://manitou-mail.org/wiki/doku.php/inverted_word_index?rev=1463401652&amp;do=diff"/>
                <rdf:li rdf:resource="https://manitou-mail.org/wiki/doku.php/sql_basic_stats?rev=1447822711&amp;do=diff"/>
                <rdf:li rdf:resource="https://manitou-mail.org/wiki/doku.php/access_rights?rev=1432049225&amp;do=diff"/>
                <rdf:li rdf:resource="https://manitou-mail.org/wiki/doku.php/sql_analysis_dedup_attachments?rev=1409605294&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://manitou-mail.org/wiki/lib/exe/fetch.php/wiki:dokuwiki-128.png">
        <title>Manitou-Mail Wiki</title>
        <link>https://manitou-mail.org/wiki/</link>
        <url>https://manitou-mail.org/wiki/lib/exe/fetch.php/wiki:dokuwiki-128.png</url>
    </image>
    <item rdf:about="https://manitou-mail.org/wiki/doku.php/adv_sample_user_queries_plus?rev=1621081317&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-05-15T12:21:57+00:00</dc:date>
        <dc:creator>daniel (daniel@undisclosed.example.com)</dc:creator>
        <title>adv_sample_user_queries_plus</title>
        <link>https://manitou-mail.org/wiki/doku.php/adv_sample_user_queries_plus?rev=1621081317&amp;do=diff</link>
        <description>Advanced examples of SQL queries

Messages sent, with senders or recipients from a specific domain, but not tagged with a specified tag:


SELECT m.mail_id FROM mail m
JOIN mail_addresses ma ON (ma.mail_id=m.mail_id)
JOIN addresses USING(addr_id)
WHERE status&amp;256&lt;&gt;0
AND email_addr like &#039;%@example.org&#039;
AND not exists
  (select 1 from mail_tags mt JOIN (select tag_id FROM tags WHERE name=&#039;Sample Tag&#039;) t ON (t.tag_id=mt.tag) WHERE mt.mail_id=m.mail_id)
;</description>
    </item>
    <item rdf:about="https://manitou-mail.org/wiki/doku.php/sql_analysis?rev=1548352547&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2019-01-24T17:55:47+00:00</dc:date>
        <dc:creator>daniel (daniel@undisclosed.example.com)</dc:creator>
        <title>sql_analysis - [Presence and count of specific mail headers] </title>
        <link>https://manitou-mail.org/wiki/doku.php/sql_analysis?rev=1548352547&amp;do=diff</link>
        <description>Presence and count of specific mail headers

This query extracts, for each of the header fields from a fixed list, the number of occurrences of all distinct values of the field.


SELECT
 split_part(substr(lines, 1+position(E&#039;\n&#039;||field in lines), 200), E&#039;\n&#039;, 1) as ct,
 count(*)
FROM header, (values (&#039;X-Priority&#039;), (&#039;Importance&#039;), (&#039;Precedence&#039;), (&#039;Priority&#039;), (&#039;X-MSMail-Priority&#039;), (&#039;X-MS-Priority&#039;)) as h(field)
WHERE position(E&#039;\n&#039;||field IN lines)&gt;0
group by 1</description>
    </item>
    <item rdf:about="https://manitou-mail.org/wiki/doku.php/support_functions?rev=1524223049&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2018-04-20T11:17:29+00:00</dc:date>
        <dc:creator>daniel (daniel@undisclosed.example.com)</dc:creator>
        <title>support_functions - Add child_tags</title>
        <link>https://manitou-mail.org/wiki/doku.php/support_functions?rev=1524223049&amp;do=diff</link>
        <description>tag_path(int)

Extract the tag name with its hierarchy. 

This recursive function takes the ID of a tag and returns its full name, including its hierarchy.


CREATE OR REPLACE FUNCTION tag_path(in_tag_id INTEGER) RETURNS text AS 
$$
DECLARE
 r text;
 id INTEGER;
BEGIN
  IF in_tag_id IS NULL THEN
    RETURN null;
  END IF;
  SELECT name, parent_id INTO r,id FROM tags WHERE tag_id=in_tag_id;
  IF (id IS NULL) THEN
     RETURN r;
  ELSE
     RETURN tag_path(id)||&#039;-&gt;&#039;||coalesce(r,&#039;&#039;);
  END IF;
END;…</description>
    </item>
    <item rdf:about="https://manitou-mail.org/wiki/doku.php/start?rev=1508338557&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2017-10-18T14:55:57+00:00</dc:date>
        <dc:creator>daniel (daniel@undisclosed.example.com)</dc:creator>
        <title>start - [Database schema] </title>
        <link>https://manitou-mail.org/wiki/doku.php/start?rev=1508338557&amp;do=diff</link>
        <description>Manitou-Mail Wiki

Welcome to the Wiki for Manitou-Mail, a database-driven mail user agent.

manitou-mdx

manitou-mdx is a Perl program that is responsible for importing incoming mail into the database, and exporting outgoing mail to a Mail Transfert Agent. MDX stands for Mail Database e</description>
    </item>
    <item rdf:about="https://manitou-mail.org/wiki/doku.php/inverted_word_index?rev=1463401652&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-05-16T12:27:32+00:00</dc:date>
        <dc:creator>daniel (daniel@undisclosed.example.com)</dc:creator>
        <title>inverted_word_index - remove useless j++ in loop</title>
        <link>https://manitou-mail.org/wiki/doku.php/inverted_word_index?rev=1463401652&amp;do=diff</link>
        <description>Context

See also Implementation of the inverted word index for how the word index is stored in the database, and the definition of tables:

	*  words
	*  non_indexable_words
	*  inverted_word_index

Function

The word index can be queried in SQL. Here is the code of a PL/pgSQL function that retrieves the IDs of messages containing a set of words. The words are given as an array of text.
The function is already in the Manitou-Mail database for versions 1.1.0 and above</description>
    </item>
    <item rdf:about="https://manitou-mail.org/wiki/doku.php/sql_basic_stats?rev=1447822711&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2015-11-18T04:58:31+00:00</dc:date>
        <dc:creator>daniel (daniel@undisclosed.example.com)</dc:creator>
        <title>sql_basic_stats - created</title>
        <link>https://manitou-mail.org/wiki/doku.php/sql_basic_stats?rev=1447822711&amp;do=diff</link>
        <description>Number of messages for a given month

(including days with no message).
Example for July, 2015



SELECT day::date, coalesce(cnt,0) as cnt FROM
 (select date_trunc(&#039;day&#039;,msg_date) as day, count(*) as cnt
  from mail 
  where msg_date&gt;=&#039;2015-07-01&#039;::timestamptz
    and msg_date&lt;&#039;2015-07-01&#039;::timestamptz+interval &#039;1 month&#039;
    -- and other optional conditions
  group by 1
 ) as list
RIGHT JOIN
   generate_series(&#039;2015-07-01&#039;::timestamptz,
                   &#039;2015-07-01&#039;::timestamptz+interval &#039;1 mo…</description>
    </item>
    <item rdf:about="https://manitou-mail.org/wiki/doku.php/access_rights?rev=1432049225&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2015-05-19T15:27:05+00:00</dc:date>
        <dc:creator>daniel (daniel@undisclosed.example.com)</dc:creator>
        <title>access_rights - remove mailboxes</title>
        <link>https://manitou-mail.org/wiki/doku.php/access_rights?rev=1432049225&amp;do=diff</link>
        <description>Schema access rights

Access rights management is left to the administrator by way of self-written SQL commands, as is the creation of database users.

This page gives some basic guidelines on how to manage a database with multiple users in a typical scenario:</description>
    </item>
    <item rdf:about="https://manitou-mail.org/wiki/doku.php/sql_analysis_dedup_attachments?rev=1409605294&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2014-09-01T21:01:34+00:00</dc:date>
        <dc:creator>daniel (daniel@undisclosed.example.com)</dc:creator>
        <title>sql_analysis_dedup_attachments</title>
        <link>https://manitou-mail.org/wiki/doku.php/sql_analysis_dedup_attachments?rev=1409605294&amp;do=diff</link>
        <description>Attachments deduplication

Attachments are stored into 3 tables: attachments, attachment_contents and the pg_largeobject system table.

At import time, the SHA1 fingerprint of attachments are computed and compared to contents already in the database. When a match is found, a new reference is created in attachment_contents to the already existing OID (large object reference) instead of importing again the same contents.</description>
    </item>
</rdf:RDF>
