<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div>Hi Artyom,<br></div>
<div> </div>
<div>Yeah wow, this is really gross.<br></div>
<div> </div>
<div>I'm pretty sure the gibberish in those "??????Default.script.bc" filenames is just whatever junk was in the (uninitialised) sieve_script_dir variable.<br></div>
<div> </div>
<div>I've had a rummage around, and there's a user_sieve_path() function in imap/user.c that does the heavy lifting of finding a user's sieve script directory. Looks like sieve_script_dir wanted to be the result of that. Your fix is on the right track. :)<br></div>
<div> </div>
<div>I've attached a patch for 2.5.x that fixes these paths using user_sieve_path(). It also fixes the assumption that the sievedir value will end in a "/", which it doesn't by default, and shouldn't need to. Can you try it out and see how it goes? (The patch should apply cleanly on any version of 2.5, this file has barely changed since it was created.)<br></div>
<div> </div>
<div>The rest of the autocreate_sieve() function is pretty awful too -- there's almost certainly more bugs in there, and fixing the paths might just shake them out. I'd like to tidy this up significantly (and make some test cases for it), but in the meantime hopefully this will get you moving forward.<br></div>
<div> </div>
<div>Cheers,<br></div>
<div> </div>
<div>ellie<br></div>
<div> </div>
<div>On Tue, Oct 6, 2015, at 12:56 AM, Artyom Aleksandrov wrote:<br></div>
<blockquote type="cite"><div dir="ltr"><div><div>Guys I don't understand hot it can work.<br></div>
<div> </div>
<div>I added additional logging and found that sieve_script_dir is not defined.<br></div>
</div>
<div>After adding this definition the problem gone.<br></div>
<div> </div>
<div> </div>
<div>147 /* Check if autocreate_sieve_compiledscript is defined in imapd.conf */<br></div>
<div>148 if(!(compiled_source_script = config_getstring(IMAPOPT_AUTOCREATE_SIEVE_SCRIPT_COMPILED))) {<br></div>
<div>149 syslog(LOG_WARNING, "autocreate_sieve: autocreate_sieve_compiledscript option is not defined. Compiling it");<br></div>
<div>150 do_compile = 1;<br></div>
<div>151 }<br></div>
<div>152 <br></div>
<div>153 char userletter[1];<br></div>
<div>154 userletter[0]=userid[0];<br></div>
<div>155 snprintf(sieve_script_dir, MAX_FILENAME, "%s%s/%s/",sieve_dir,userletter,userid);<br></div>
<div> </div>
<div> </div>
</div>
<div><div> </div>
<div><div>On Thu, Oct 1, 2015 at 8:49 PM, Artyom Aleksandrov <span dir="ltr"><<a href="mailto:mailing.list@tem4uk.ru">mailing.list@tem4uk.ru</a>></span> wrote:<br></div>
<blockquote style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204, 204, 204);padding-left:1ex;"><div dir="ltr"><div><div><div>Is it works? Which version do you use?<br></div>
</div>
<div>Could you guest the reason of the problem? How I can troubleshoot it? <br></div>
<div> </div>
<div style="margin-left:40px;"><div>:/var/lib/cyrus# ls -la<br></div>
<div>total 2176<br></div>
<div>-rw------- 1 cyrus mail 124 Sep 25 16:04 ??????Default.script.bc<br></div>
<div>-rw------- 1 cyrus mail 231 Sep 25 16:04 ??????Default.script.script<br></div>
<div>lrwxrwxrwx 1 cyrus mail 17 Sep 25 16:04 ??????defaultbc -> Default.script.bc<br></div>
<div>-rw------- 1 cyrus mail 124 Jul 2 12:38 ??N???Default.script.bc<br></div>
<div>-rw------- 1 cyrus mail 231 Jul 2 12:38 ??N???Default.script.script<br></div>
<div>lrwxrwxrwx 1 cyrus mail 17 Jul 2 12:38 ??N???defaultbc -> Default.script.bc<br></div>
<div>-rw------- 1 cyrus mail 124 Sep 22 15:10 0#?>??Default.script.bc<br></div>
<div>-rw------- 1 cyrus mail 231 Sep 22 15:10 0#?>??Default.script.script<br></div>
<div>lrwxrwxrwx 1 cyrus mail 17 Sep 22 15:10 0#?>??defaultbc -> Default.script.bc<br></div>
</div>
</div>
<div><div> </div>
</div>
</div>
<div><div><div><div> </div>
<div><div>On Thu, Oct 1, 2015 at 7:55 PM, Alvin Starr <span dir="ltr"><<a href="mailto:alvin@netvel.net">alvin@netvel.net</a>></span> wrote:<br></div>
<blockquote style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204, 204, 204);padding-left:1ex;"><div bgcolor="#FFFFFF"><div><div>I use autocreate.<br></div>
<div> </div>
<div>
So there is at least one.<br></div>
<div><div><div> </div>
<div> </div>
<div>
On 10/01/2015 12:18 PM, Artyom Aleksandrov wrote:<br></div>
</div>
</div>
</div>
<blockquote type="cite"><div><div><div dir="ltr">Does anybody use autocreate_sieve?<br></div>
<div><div> </div>
<div><div>On Sat, Sep 26, 2015 at 1:30 AM, Artyom
Aleksandrov <span dir="ltr"><<a href="mailto:mailing.list@tem4uk.ru">mailing.list@tem4uk.ru</a>></span>
wrote:<br></div>
<blockquote style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204, 204, 204);padding-left:1ex;"><div dir="ltr"><div> </div>
<div><div><span>Hello,I want to create default sieve scipt for
all my users but I stuck with strange problem that
looks like the bug. Unfortunately I've never wrote
on C so it's difficult for me to find it.<br>
When Cyrus (2.5.3 or 2.5.6) create default sieve
script it doesn't put file in sieve_dir/?/user
folder. It jist creates tmp files in configdirectory
with names like this<br> </span></div>
<div style="margin-left:40px;"><span>-rw------- 1 cyrus
mail 124 Sep 26 00:41 ?&?P??default.script.bc<br>
-rw------- 1 cyrus mail 231 Sep 26 00:41
?&?P??default.script.script<br>
lrwxrwxrwx 1 cyrus mail 17 Sep 26 00:41
?&?P??defaultbc -> default.script.bc</span></div>
<div> </div>
</div>
<div><span>There are not checks in this stage so my syslog is
clean of error.</span><br></div>
<div><div><span>Everything seems fine.<br> <br></span></div>
<div style="margin-left:40px;"><span>Sep 26 00:41:34 imapsync
cyrus/imap[26117]: autocreate_sieve: Problem opening
compiled script file: default.script.bc. Compiling
it<br>
Sep 26 00:41:34 imapsync cyrus/imap[26117]:
autocreate_sieve: Compiled sieve script was
successfully saved in default.script.bc<br>
Sep 26 00:41:34 imapsync cyrus/imap[26117]:
autocreate_sieve: User XXXX, default sieve script
creation succeeded </span></div>
<div> </div>
</div>
<div><div><span>My setting:<br></span></div>
<div style="margin-left:40px;"><span>autocreate_sieve_script:
/var/spool/sieve/global/default.script<br>
autocreate_sieve_script_compile: yes<br>
autocreate_sieve_script_compiled: default.script.bc<br>
sievedir: /var/spool/sieve/<br> </span></div>
<div><span>
Distributive: Ubuntu 14.04.3</span><br></div>
</div>
<div> </div>
<div> </div>
<div>I'll be glad for any help. )<br></div>
<div> </div>
<div>
Best regards, Artyom<br></div>
</div>
</blockquote></div>
<div> </div>
</div>
<div> </div>
<div> </div>
</div>
</div>
<pre>----
Cyrus Home Page: <a href="http://www.cyrusimap.org/">http://www.cyrusimap.org/</a>
List Archives/Info: <a href="http://lists.andrew.cmu.edu/pipermail/info-cyrus/">http://lists.andrew.cmu.edu/pipermail/info-cyrus/</a>
To Unsubscribe:
<a href="https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus">https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus</a><br></pre><div> </div>
</blockquote><div><span><span style="color:rgb(136, 136, 136)" class="colour"><br> <br></span></span></div>
<pre><span><span style="color:rgb(136, 136, 136)" class="colour">--
Alvin Starr || voice: <a href="tel:%28905%29513-7688">(905)513-7688</a>
Netvel Inc. || Cell: <a href="tel:%28416%29806-0133">(416)806-0133</a> <a href="mailto:alvin@netvel.net">alvin@netvel.net</a> ||
</span></span><br></pre><div> </div>
</div>
<div> </div>
<div>----<br></div>
<div>
Cyrus Home Page: <a href="http://www.cyrusimap.org/">http://www.cyrusimap.org/</a><br></div>
<div>
List Archives/Info: <a href="http://lists.andrew.cmu.edu/pipermail/info-cyrus/">http://lists.andrew.cmu.edu/pipermail/info-cyrus/</a><br></div>
<div>
To Unsubscribe:<br></div>
<div> <a href="https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus">https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus</a><br></div>
</blockquote></div>
</div>
</div>
</div>
</blockquote></div>
</div>
<div>----<br></div>
<div>Cyrus Home Page: <a href="http://www.cyrusimap.org/">http://www.cyrusimap.org/</a><br></div>
<div>List Archives/Info: <a href="http://lists.andrew.cmu.edu/pipermail/info-cyrus/">http://lists.andrew.cmu.edu/pipermail/info-cyrus/</a><br></div>
<div>To Unsubscribe:<br></div>
<div><a href="https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus">https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus</a><br></div>
</blockquote><div> </div>
</body>
</html>