Hi,
I have setup the latest Dovecot and Sieve with dict in order to read rules from MySQL and works fine:
sieve_before = dict:proxy::sieve;name=activesql;bindir=~/.sieve-bin
dict { sieve = mysql:/etc/dovecot/dovecot-dict-sieve-sql.conf.ext }
# cat /etc/dovecot/dovecot-dict-sieve-sql.conf.ext
connect = host=10.1.1.1 dbname=dovecot user=dovecot password=Ciao map { pattern = priv/sieve/name/$script_name table = user_sieve_scripts username_field = username value_field = id fields { script_name = $script_name } } map { pattern = priv/sieve/data/$id table = user_sieve_scripts username_field = username value_field = script_data fields { id = $id } }
But when I update the rules in mysql sieve continue to apply only the "old" rules stored in the binary. The only way to apply the new rules is to delete the .sieve-bin/activesql.svbin. If I remove ";bindir=~/.sieve-bin" works fine.
This is a cache issue and can be fixed via setting, is an issue or is a "feature" :-) ?
Thanks
-- Alessio Cecchi Postmaster @ http://www.qboxmail.it https://www.linkedin.com/in/alessice
I uspect the problem is in that sieve binaries are only recompiled when the source script is newer than the svbin file, and dict is unable to determine this. Perhaps you should leave ;bindir away for now.
Aki
On April 28, 2017 at 11:58 AM Alessio Cecchi <alessio@skye.it> wrote:
Hi,
I have setup the latest Dovecot and Sieve with dict in order to read rules from MySQL and works fine:
sieve_before = dict:proxy::sieve;name=activesql;bindir=~/.sieve-bin
dict { sieve = mysql:/etc/dovecot/dovecot-dict-sieve-sql.conf.ext }
# cat /etc/dovecot/dovecot-dict-sieve-sql.conf.ext
connect = host=10.1.1.1 dbname=dovecot user=dovecot password=Ciao map { pattern = priv/sieve/name/$script_name table = user_sieve_scripts username_field = username value_field = id fields { script_name = $script_name } } map { pattern = priv/sieve/data/$id table = user_sieve_scripts username_field = username value_field = script_data fields { id = $id } }
But when I update the rules in mysql sieve continue to apply only the "old" rules stored in the binary. The only way to apply the new rules is to delete the .sieve-bin/activesql.svbin. If I remove ";bindir=~/.sieve-bin" works fine.
This is a cache issue and can be fixed via setting, is an issue or is a "feature" :-) ?
Thanks
-- Alessio Cecchi Postmaster @ http://www.qboxmail.it https://www.linkedin.com/in/alessice
Op 4/28/2017 om 10:58 AM schreef Alessio Cecchi:
Hi,
I have setup the latest Dovecot and Sieve with dict in order to read rules from MySQL and works fine:
sieve_before = dict:proxy::sieve;name=activesql;bindir=~/.sieve-bin
dict { sieve = mysql:/etc/dovecot/dovecot-dict-sieve-sql.conf.ext }
# cat /etc/dovecot/dovecot-dict-sieve-sql.conf.ext
connect = host=10.1.1.1 dbname=dovecot user=dovecot password=Ciao map { pattern = priv/sieve/name/$script_name table = user_sieve_scripts username_field = username value_field = id fields { script_name = $script_name } } map { pattern = priv/sieve/data/$id table = user_sieve_scripts username_field = username value_field = script_data fields { id = $id } }
But when I update the rules in mysql sieve continue to apply only the "old" rules stored in the binary. The only way to apply the new rules is to delete the .sieve-bin/activesql.svbin. If I remove ";bindir=~/.sieve-bin" works fine.
This is a cache issue and can be fixed via setting, is an issue or is a "feature" :-) ?
The wiki states the following:
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.
Did you follow this?
Regards,
Stephan.
Op 4/30/2017 om 6:29 PM schreef Stephan Bosch:
Op 4/28/2017 om 10:58 AM schreef Alessio Cecchi:
Hi,
I have setup the latest Dovecot and Sieve with dict in order to read rules from MySQL and works fine:
sieve_before = dict:proxy::sieve;name=activesql;bindir=~/.sieve-bin
dict { sieve = mysql:/etc/dovecot/dovecot-dict-sieve-sql.conf.ext }
# cat /etc/dovecot/dovecot-dict-sieve-sql.conf.ext
connect = host=10.1.1.1 dbname=dovecot user=dovecot password=Ciao map { pattern = priv/sieve/name/$script_name table = user_sieve_scripts username_field = username value_field = id fields { script_name = $script_name } } map { pattern = priv/sieve/data/$id table = user_sieve_scripts username_field = username value_field = script_data fields { id = $id } }
But when I update the rules in mysql sieve continue to apply only the "old" rules stored in the binary. The only way to apply the new rules is to delete the .sieve-bin/activesql.svbin. If I remove ";bindir=~/.sieve-bin" works fine.
This is a cache issue and can be fixed via setting, is an issue or is a "feature" :-) ? The wiki states the following:
https://wiki2.dovecot.org/Pigeonhole/Sieve/Configuration/Dict
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.
Did you follow this?
Regards,
Stephan.
Il 30/04/2017 18:29, Stephan Bosch ha scritto:
Op 4/28/2017 om 10:58 AM schreef Alessio Cecchi:
Hi,
I have setup the latest Dovecot and Sieve with dict in order to read rules from MySQL and works fine:
sieve_before = dict:proxy::sieve;name=activesql;bindir=~/.sieve-bin
dict { sieve = mysql:/etc/dovecot/dovecot-dict-sieve-sql.conf.ext }
# cat /etc/dovecot/dovecot-dict-sieve-sql.conf.ext
connect = host=10.1.1.1 dbname=dovecot user=dovecot password=Ciao map { pattern = priv/sieve/name/$script_name table = user_sieve_scripts username_field = username value_field = id fields { script_name = $script_name } } map { pattern = priv/sieve/data/$id table = user_sieve_scripts username_field = username value_field = script_data fields { id = $id } }
But when I update the rules in mysql sieve continue to apply only the "old" rules stored in the binary. The only way to apply the new rules is to delete the .sieve-bin/activesql.svbin. If I remove ";bindir=~/.sieve-bin" works fine.
This is a cache issue and can be fixed via setting, is an issue or is a "feature" :-) ? The wiki states the following:
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. Thanks now it's all clear :-)
-- Alessio Cecchi Postmaster @ http://www.qboxmail.it https://www.linkedin.com/in/alessice
participants (3)
-
Aki Tuomi
-
Alessio Cecchi
-
Stephan Bosch