[Dovecot] Sieve > Pigeonhole > external storage with LDAP or other data source available to dovecot

Martin F. Foster martin_foster at pacific.net.au
Tue Jan 12 12:35:09 EET 2010


oh wow - ignore my last message about sievec & environment.  As the 
output says, it's just a warning... it is not blocking the compilation 
of the sieve script as I originally thought.

moving on:
The compiled script is now being used as a sieve_before entry.  The LDA 
is erroring on the result, something that I'll continue to 
investigate.   The "failed to open" message below isn't correct - a 
trace shows the compiled .sieve being opened and read by the process; 
but I get that there is an error in interpreting & using the compiled 
script.
The extdata .dict file is not opened by the deliver process.

I'm going to continue investigating.  some info below if anyone's 
interested:

<script>
require ["vacation", "variables", "vnd.dovecot.extdata"];

vacation :subject "${extdata.vacation_subject}"
          "${extdata.vacation_message}";

</script>


<compile script>
#  /usr/local/bin/sievec -P sieve_extdata 
/usr/local/etc/dovecot/sieve/before.sv 
/usr/local/etc/dovecot/sieve/before.sieve
Warning: sieve: extdata: no dict uri specified, extension is 
unconfigured (sieve_extdata_dict_uri is not set).

# echo $?
0
</compile script>


<logs>
2010-01-12T08:41:08.005962+00:00 node001 dovecot: auth(default): 
ldap(test at domain1.test): user search: base=o=services scope=subtree 
filter=(uid=test at domain1.test) 
fields=homeDirectory,mailStoreDirectory,mailQuota
2010-01-12T08:41:08.006457+00:00 node001 dovecot: auth(default): 
ldap(test at domain1.test): result: 
homeDirectory(home)=/services/vmail/home/1000000 
mailQuota(quota_rule)=maildir:storage=5M 
mailStoreDirectory(mail)=maildir:/services/vmail/mail/1000000/
2010-01-12T08:41:08.006477+00:00 node001 dovecot: auth(default): master 
out: 
USER#0111#011test at domain1.test#011home=/services/vmail/home/1000000#011quota_rule=maildir:storage=5M#011mail=maildir:/services/vmail/mail/1000000/
2010-01-12T08:41:08.012161+00:00 node001 dovecot: 
deliver(test at domain1.test): sieve: before: line 1: unexpected 
character(s) starting with 0xbe
2010-01-12T08:41:08.012556+00:00 node001 dovecot: 
deliver(test at domain1.test): sieve: before: line 1: unexpected unknown 
characters found at (the presumed) end of file
2010-01-12T08:41:08.012987+00:00 node001 dovecot: 
deliver(test at domain1.test): sieve: before: parse failed
2010-01-12T08:41:08.013380+00:00 node001 dovecot: 
deliver(test at domain1.test): sieve: failed to open script 
/usr/local/etc/dovecot/sieve/before.sieve
2010-01-12T08:41:08.860595+00:00 node001 dovecot: 
deliver(test at domain1.test): 
msgid=<20100112084107.2E72A27713 at node001.netlog.net>: saved mail to INBOX
</logs>

<dovecot config>
plugin:
   sieve_plugin_dir: /usr/local/lib/dovecot/sieve
   sieve_plugins: sieve_extdata
   sieve_extdata_dict_uri: file:/usr/local/etc/dovecot/extdata.dict
   sieve_before: /usr/local/etc/dovecot/sieve/before.sieve
   quota: maildir
   sieve: ~/.dovecot.sieve
   sieve_dir: ~/sieve

$ cat /usr/local/etc/dovecot/extdata.dict
priv/vacation_subject
I am the subject.
priv/vacation_message
I ame the message.
</config>


Cheers,

-Martin Foster

Le 12-Jan-10 16:25, Martin F. Foster a écrit :
>
> I have the extdata plugin compiled, and am now trying to make a global 
> sieve script to test it.  I'm running into problems when using sievec 
> to compile the script - I'm not getting the plugin's variables that 
> are provided in dovecot.conf's plugin {}.  I added a few 
> sieve_sys_warning messages to track the calls to sieve_setting_get()
>
> <output>
> /usr/local/bin/sievec -d -P sieve_extdata 
> /usr/local/etc/dovecot/sieve/before.sv
> Warning: sieve: sieve_setting_get: req: 'sieve_max_script_size' res: 
> '(null)'
> Warning: sieve: sieve_setting_get: req: 'sieve_max_actions' res: '(null)'
> Warning: sieve: sieve_setting_get: req: 'sieve_max_redirects' res: 
> '(null)'
> Warning: sieve: sieve_setting_get: req: 'sieve_subaddress_sep' res: 
> '(null)'
> Warning: sieve: sieve_setting_get: req: 'recipient_delimiter' res: 
> '(null)'
> Warning: sieve: sieve_setting_get: req: 'sieve_plugin_dir' res: '(null)'
> Warning: sieve: sieve_setting_get: req: 'sieve_plugins' res: '(null)'
> Warning: sieve: sieve_setting_get: req: 'sieve_extdata_dict_uri' res: 
> '(null)'
> Warning: sieve: extdata: no dict uri specified, extension is 
> unconfigured (sieve_extdata_dict_uri is not set).
>
> * Required extensions:
>
>   0: vacation (9)
>   1: variables (17)
>   2: vnd.dovecot.extdata (29)
>
> * Main program (block: 1):
>
> 00000000: EXTENSIONS [3]:
> 00000001:   vacation
> 00000002:   variables
> 00000003:     SCOPE [0] (end: 00000008)
> 00000008:   vnd.dovecot.extdata
> 00000009: VACATION
> 0000000a:   (source line: 3)
> 0000000d:   subject: VAR ${extdata.vacation_subject}
> 00000023:   reason: VAR ${extdata.vacation_message}
> 00000038:   handle: STR[77] 
> "${extdata.vacation_message}${extdata.vacation_subject}<default-from><NO-MIME>" 
>
> 00000088: [End of code]
> </output>
>
> I'm new to dovecot's internals, it looks like it just needs some 
> environment variables provided, but I'm puzzled as to how this is to 
> be done.
> I've traced it through sievec.c -> sieve_tool_sieve_env -> 
> sieve_tool_get_setting -> getenv() call.
>
> More info:
> 1. I've traced the process, there's no attempt to open or stat any 
> dovecot.conf
> 2. using tip dovecot-1.2, dovecot-1.2-sieve, 
> pigeonhole-sieve-extdata.  I pulled+updated & rebuilt and confirmed 
> the above behaviour just prior to sending this message.
> 3. The test scripts run because the test framework uses the 
> test_config mechanism to provide sieve_extdata_dict_uri.
>
> Any hints on how to get the dovecot.conf data to sievec?
>
> Thanks,
>
> -Martin Foster



More information about the dovecot mailing list