.. _pigeonhole_dict: =============================================== Pigeonhole Sieve: Dict Lookup for Sieve Scripts =============================================== Sieve scripts can be obtained from a number of different :ref:`types of locations `. This page shows how to retrieve them from a :ref:`Dovecot dictionary ` (abbreviated as 'dict'), which can have either a file or database backend. To retrieve a Sieve script from the dict database, two lookups are performed. First, the name of the Sieve script is queried from the dict path ``/priv/sieve/name/``. If the Sieve script exists, this yields a data ID which in turn points to the actual script text. The script text is subsequently queried from the dict path ``/priv/sieve/data/``. The second query is only necessary when no compiled binary is available or when the script has changed and needs to be recompiled. The data ID is used to detect changes in the dict's underlying database. Changing a Sieve script in the database must be done by first making a new script data item with a new data ID. Then, the mapping from name to data ID must be changed to point to the new script text, thereby changing the data ID returned from the name lookup, i.e. the first query mentioned above. Script binaries compiled from Sieve scripts contained in a dict database record the data ID. While the data ID contained in the binary is identical to the one returned from the dict lookup, the binary is assumed up-to-date. When the returned data ID is different, the new script text is retrieved using the second query and compiled into a new binary containing the updated data ID. Note that, by default, compiled binaries are not stored at all for Sieve scripts retrieved from a dict database. The ``;bindir=`` option needs to be specified in the :ref:`location specification `. Configuration ------------- The script location syntax is specified as follows: :: sieve = dict:[;