Re: v2.3.3 rc1 - Error: sieve: !!BUG!!: Binary compiled from dovecot.sieve is still corrupt

2018-10-01 Thread James

On 01/10/2018 13:37, Stephan Bosch wrote:


I'd still like to know whether doing this helps somehow:


Does it help when you change the "> 0" at the following code position
to "!= 0" ?

https://github.com/dovecot/pigeonhole/blob/master/src/lib-sieve/sieve-binary-code.c#L300


--- ../original/src/lib-sieve/sieve-binary-code.c	2018-02-05 
19:45:53.0 +

+++ src/lib-sieve/sieve-binary-code.c   2018-10-01 14:35:18.553169973 +
@@ -297,7 +297,7 @@
return FALSE;

/* Read first integer bytes [1xxx] */
-   while ( (ADDR_DATA_AT(address) & 0x80) > 0 ) {
+   while ( (ADDR_DATA_AT(address) & 0x80) != 0 ) {
if ( ADDR_BYTES_LEFT(address) > 0 && bits > 0) {
integer |= ADDR_DATA_AT(address) & 0x7F;
ADDR_JUMP(address, 1);


Quick reply: It does. I can't see why.



James.











Re: v2.3.3 rc1 - Error: sieve: !!BUG!!: Binary compiled from dovecot.sieve is still corrupt

2018-10-01 Thread Stephan Bosch




Op 1-10-2018 om 10:43 schreef James:

On 25/09/2018 22:39, Stephan Bosch wrote:

Hello,


Something mightily weird is going on at your end. It doesn't fail here


This is correct.  I believe there to be a compiler problem. Removing 
optimisation from sieve-binary-code.c gives success.


Thank you to Stephan Bosch for testing this for me and pointing me in 
the right direction.


My debugging was confused because dovecot flags are passed to 
pigeonhole, eg $DOVECOT_CFLAGS.  This is why the build of dovecot 
affects pigeonhole.  Once I removed these I could control the 
pigeonhole build and I was able to isolate the problem.


Ok, good.

I'd still like to know whether doing this helps somehow:

Does it help when you change the "> 0" at the following code position 
to "!= 0" ?


https://github.com/dovecot/pigeonhole/blob/master/src/lib-sieve/sieve-binary-code.c#L300


Regards,

Stephan.



Re: v2.3.3 rc1 - Error: sieve: !!BUG!!: Binary compiled from dovecot.sieve is still corrupt

2018-10-01 Thread James

On 25/09/2018 22:39, Stephan Bosch wrote:

Hello,


Something mightily weird is going on at your end. It doesn't fail here


This is correct.  I believe there to be a compiler problem.  Removing 
optimisation from sieve-binary-code.c gives success.


Thank you to Stephan Bosch for testing this for me and pointing me in 
the right direction.


My debugging was confused because dovecot flags are passed to 
pigeonhole, eg $DOVECOT_CFLAGS.  This is why the build of dovecot 
affects pigeonhole.  Once I removed these I could control the pigeonhole 
build and I was able to isolate the problem.




James.




Re: v2.3.3 rc1 - Error: sieve: !!BUG!!: Binary compiled from dovecot.sieve is still corrupt

2018-10-01 Thread James

On 28/09/2018 12:38, Aki Tuomi wrote:


It was studio cc.  gcc doesn't make it through configure and I
didn't ask why.

Can you share a little bit more info on how did the compile (or
configure even) fail with gcc on Solaris 11?


$ ./configure $ARGS
...
checking Linux compatible mremap()... no
checking whether shared mmaps get updated by write()s... no
checking whether fd passing works... no
configure: error: fd passing is required for Dovecot to work

Which in the log corresponds to:

configure:22685: ./conftest
./configure[2026]: eval: line 1: 22335: Memory fault(coredump)


Appears to the option "-mfunction-return=thunk" that cause the
problem, remove and no core dump.


If you thunk that was all think again.  My gcc builds fail to link 
ending with lots of undefined symbols.  It is probably libtool 
obstructing portability but I have an easy solution of using another 
compiler and ignoring libtool.





You can use --disable-harderning to disable these things.


--disable-hardening




Re: v2.3.3 rc1 - Error: sieve: !!BUG!!: Binary compiled from dovecot.sieve is still corrupt

2018-09-28 Thread Aki Tuomi



On 28.09.2018 13:44, Aki Tuomi wrote:
>
> On 28.09.2018 12:38, James wrote:
>> On 27/09/2018 16:14, Sami Ketola wrote:
>>
 It was studio cc.  gcc doesn't make it through configure and I
 didn't ask why.
>>> Can you share a little bit more info on how did the compile (or
>>> configure even) fail with gcc on Solaris 11?
>>
>> $ ./configure $ARGS
>> ...
>> checking Linux compatible mremap()... no
>> checking whether shared mmaps get updated by write()s... no
>> checking whether fd passing works... no
>> configure: error: fd passing is required for Dovecot to work
>>
>> Which in the log corresponds to:
>>
>> configure:22685: ./conftest
>> ./configure[2026]: eval: line 1: 22335: Memory fault(coredump)
>>
>>
>> Appears to the option "-mfunction-return=thunk" that cause the
>> problem, remove and no core dump.  Older gccs do not have
>> -mfunction-return.
>>
>>
>>
>>
>>
>>> as I have no problems in compiling dovecot and pigeonhole on my
>>> Solaris 11.3 system with gcc. The version that ships with my Solaris
>>> is 4.5.2.
>> Strictly speaking Solaris 11 does not ship with gcc, one can install
>> it [from the OS vendor] with pkg and there is a choice of versions.
>>
>> # pkg list -a | grep gcc-c
>>
>>
>> I have gcc versions installed: 4.9.5, 5.5.0, 6.4.0, 7.3.0 and 8.2.0.
>>
>>
>>
>>> I also have Sun Studio 12.5 installed but I have not even tried to
>>> compile dovecot wit that yet.
>> Current Release - Oracle Developer Studio 12.6.
>>
>>
>>
>>
>>
>> James.
> Appears we need more thoroughly ensure -mfunction-return=thunk actually
> works.
>
> Aki

You can use --disable-harderning to disable these things.

Aki


Re: v2.3.3 rc1 - Error: sieve: !!BUG!!: Binary compiled from dovecot.sieve is still corrupt

2018-09-28 Thread Aki Tuomi



On 28.09.2018 12:38, James wrote:
> On 27/09/2018 16:14, Sami Ketola wrote:
>
>>> It was studio cc.  gcc doesn't make it through configure and I
>>> didn't ask why.
>>
>> Can you share a little bit more info on how did the compile (or
>> configure even) fail with gcc on Solaris 11?
>
>
> $ ./configure $ARGS
> ...
> checking Linux compatible mremap()... no
> checking whether shared mmaps get updated by write()s... no
> checking whether fd passing works... no
> configure: error: fd passing is required for Dovecot to work
>
> Which in the log corresponds to:
>
> configure:22685: ./conftest
> ./configure[2026]: eval: line 1: 22335: Memory fault(coredump)
>
>
> Appears to the option "-mfunction-return=thunk" that cause the
> problem, remove and no core dump.  Older gccs do not have
> -mfunction-return.
>
>
>
>
>
>> as I have no problems in compiling dovecot and pigeonhole on my
>> Solaris 11.3 system with gcc. The version that ships with my Solaris
>> is 4.5.2.
>
> Strictly speaking Solaris 11 does not ship with gcc, one can install
> it [from the OS vendor] with pkg and there is a choice of versions.
>
> # pkg list -a | grep gcc-c
>
>
> I have gcc versions installed: 4.9.5, 5.5.0, 6.4.0, 7.3.0 and 8.2.0.
>
>
>
>> I also have Sun Studio 12.5 installed but I have not even tried to
>> compile dovecot wit that yet.
>
> Current Release - Oracle Developer Studio 12.6.
>
>
>
>
>
> James.

Appears we need more thoroughly ensure -mfunction-return=thunk actually
works.

Aki


Re: v2.3.3 rc1 - Error: sieve: !!BUG!!: Binary compiled from dovecot.sieve is still corrupt

2018-09-28 Thread James

On 27/09/2018 16:14, Sami Ketola wrote:


It was studio cc.  gcc doesn't make it through configure and I didn't ask why.


Can you share a little bit more info on how did the compile (or configure even) 
fail with gcc on Solaris 11?



$ ./configure $ARGS
...
checking Linux compatible mremap()... no
checking whether shared mmaps get updated by write()s... no
checking whether fd passing works... no
configure: error: fd passing is required for Dovecot to work

Which in the log corresponds to:

configure:22685: ./conftest
./configure[2026]: eval: line 1: 22335: Memory fault(coredump)


Appears to the option "-mfunction-return=thunk" that cause the problem, 
remove and no core dump.  Older gccs do not have -mfunction-return.







as I have no problems in compiling dovecot and pigeonhole on my Solaris 11.3 
system with gcc. The version that ships with my Solaris is 4.5.2.


Strictly speaking Solaris 11 does not ship with gcc, one can install it 
[from the OS vendor] with pkg and there is a choice of versions.


# pkg list -a | grep gcc-c


I have gcc versions installed: 4.9.5, 5.5.0, 6.4.0, 7.3.0 and 8.2.0.




I also have Sun Studio 12.5 installed but I have not even tried to compile 
dovecot wit that yet.


Current Release - Oracle Developer Studio 12.6.





James.


Re: v2.3.3 rc1 - Error: sieve: !!BUG!!: Binary compiled from dovecot.sieve is still corrupt

2018-09-28 Thread James

On 27/09/2018 14:55, Josef 'Jeff' Sipek wrote:

On Thu, Sep 27, 2018 at 10:42:16 +0100, James wrote:

$ dovecot -c dovecot.conf -n
# 2.3.3.rc1 (14e4920d8): dovecot.conf
# Pigeonhole version 0.5.2 (7704de5e)
# OS: SunOS 5.11 i86pc


Out of curiosity, is this a Solaris system or an illumos system?


Not Illumos.
Test builds on 10 and 11.3 - RC exercise, I'll add Sparc when my machine 
is powered on.

Tested run on Solaris 10 and 11.3  - RC exercise.
Reports from 11.3, results so far the same either way.
Packages built on Solaris 10 as LCD unless there is good reason to have 
a package per rev.


Re: v2.3.3 rc1 - Error: sieve: !!BUG!!: Binary compiled from dovecot.sieve is still corrupt

2018-09-27 Thread Sami Ketola



> On 27 Sep 2018, at 16.53, James  wrote:
> 
> On 27/09/2018 13:40, Stephan Bosch wrote:
> 
>>> Address   Line  Code
>>> :   DEBUG BLOCK: 3
>>> 0001:   EXTENSIONS [1]:
>>> 0002: vacation
>>> 0004:2: VACATION
>>> 0007:4:   seconds: NUM 5
>>> 0009: Binary is corrupt.
>>> 
>>> The line numbers differs and 86400 is read as 5.  It is like it has
>>> forgotten the size of an integer or is confused about endianness.
>>> There is something strange, like an #if that guesses wrong.  At least
>>> I have somewhere to start looking.
>>> 
>>> Thank you for checking at your end, I was worried the RC had
>>> introduced an error and your result suggests not.  RCs are for testing
>>> and I am.
>> 
>> The number is stored as a chain of bytes of which the most significant
>> bit indicates whether the next byte still belongs to the number. If this
>> bit is somehow interpreted wrong, the first byte of this number would
>> read as 5, thereby returning '5' as the result and ignoring subsequent
>> bytes (causing corruption at the next item to read).
>> 
>> Since you're using SunOS, your compiler may be doing something funky.
>> Which compiler is used anyway? Perhaps different versions for the
>> Dovecot releases that do and don't work?
> 
> It was studio cc.  gcc doesn't make it through configure and I didn't ask 
> why.  I have some other things to do but will look at this again later.  
> Thank you for the byte code explanations.  The coding at this point is hard 
> to follow with the pointers-to-functions and #defines.


Can you share a little bit more info on how did the compile (or configure even) 
fail with gcc on Solaris 11?

as I have no problems in compiling dovecot and pigeonhole on my Solaris 11.3 
system with gcc. The version that ships with my Solaris is 4.5.2.

I also have Sun Studio 12.5 installed but I have not even tried to compile 
dovecot wit that yet.

Sami



Re: v2.3.3 rc1 - Error: sieve: !!BUG!!: Binary compiled from dovecot.sieve is still corrupt

2018-09-27 Thread James

On 27/09/2018 13:40, Stephan Bosch wrote:


Address   Line  Code
:   DEBUG BLOCK: 3
0001:   EXTENSIONS [1]:
0002: vacation
0004:2: VACATION
0007:4:   seconds: NUM 5
0009: Binary is corrupt.

The line numbers differs and 86400 is read as 5.  It is like it has
forgotten the size of an integer or is confused about endianness.
There is something strange, like an #if that guesses wrong.  At least
I have somewhere to start looking.

Thank you for checking at your end, I was worried the RC had
introduced an error and your result suggests not.  RCs are for testing
and I am.


The number is stored as a chain of bytes of which the most significant
bit indicates whether the next byte still belongs to the number. If this
bit is somehow interpreted wrong, the first byte of this number would
read as 5, thereby returning '5' as the result and ignoring subsequent
bytes (causing corruption at the next item to read).

Since you're using SunOS, your compiler may be doing something funky.
Which compiler is used anyway? Perhaps different versions for the
Dovecot releases that do and don't work?


It was studio cc.  gcc doesn't make it through configure and I didn't 
ask why.  I have some other things to do but will look at this again 
later.  Thank you for the byte code explanations.  The coding at this 
point is hard to follow with the pointers-to-functions and #defines.




James.



Re: v2.3.3 rc1 - Error: sieve: !!BUG!!: Binary compiled from dovecot.sieve is still corrupt

2018-09-27 Thread Josef 'Jeff' Sipek
On Thu, Sep 27, 2018 at 10:42:16 +0100, James wrote:
> On 25/09/2018 22:39, Stephan Bosch wrote:
> 
> > Something mightily weird is going on at your end. It doesn't fail here
> > (see below). First of all, what is your configuration (output from
> > `dovecot -n`)?
> 
> You have dovecot.conf but...
> 
> $ dovecot -c dovecot.conf -n
> # 2.3.3.rc1 (14e4920d8): dovecot.conf
> # Pigeonhole version 0.5.2 (7704de5e)
> # OS: SunOS 5.11 i86pc

Out of curiosity, is this a Solaris system or an illumos system?

Jeff.

-- 
I'm somewhere between geek and normal.
- Linus Torvalds


Re: v2.3.3 rc1 - Error: sieve: !!BUG!!: Binary compiled from dovecot.sieve is still corrupt

2018-09-27 Thread Stephan Bosch




Op 27-9-2018 om 11:42 schreef James:

On 25/09/2018 22:39, Stephan Bosch wrote:


Something mightily weird is going on at your end. It doesn't fail here
(see below). First of all, what is your configuration (output from
`dovecot -n`)?


You have dovecot.conf but...

$ dovecot -c dovecot.conf -n
# 2.3.3.rc1 (14e4920d8): dovecot.conf
# Pigeonhole version 0.5.2 (7704de5e)
# OS: SunOS 5.11 i86pc
# Hostname: mailhost
doveconf: Warning: please set ssl_dh=doveconf: Warning: You can generate it with: dd 
if=/var/opt/xxx/lib/dovecot/ssl-parameters.dat bs=1 skip=88 | openssl 
dhparam -inform der > /etc/opt/xxx/dovecot/dh.pem

mail_debug = yes
mail_gid = staff
mail_location = maildir:/path/to/%d/%n/Maildir
mail_uid = james
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope 
encoded-character vacation subaddress comparator-i;ascii-numeric 
relational regex imap4flags copy include variables body enotify 
environment mailbox date index ihave duplicate mime foreverypart 
extracttext

postmaster_address = postmas...@domain.tld
ssl_dh = # hidden, use -P to show it




Also, can you make a hex dump of the binary (using `sieve-dump -h
.svbin`).


As said the svbin is identical to the one create by the previous version.

Comparing the dump:
Block 0 differs because it has the source file name.
Block 1 is identical
Block 2 is identical. It is this block that is declared corrupt.




Finally, can you try to explicitly delete the binary (preferably after
preserving it elsewhere) so that it is guaranteed to be created fresh?


I did each time.




## Success at my end:


Spot the difference...


Address   Line  Code
:   DEBUG BLOCK: 3
0001:   EXTENSIONS [1]:
0002: vacation
0004:    3: VACATION
0007:    5:   seconds: NUM 86400


Address   Line  Code
:   DEBUG BLOCK: 3
0001:   EXTENSIONS [1]:
0002: vacation
0004:    2: VACATION
0007:    4:   seconds: NUM 5
0009: Binary is corrupt.

The line numbers differs and 86400 is read as 5.  It is like it has 
forgotten the size of an integer or is confused about endianness.  
There is something strange, like an #if that guesses wrong.  At least 
I have somewhere to start looking.


Thank you for checking at your end, I was worried the RC had 
introduced an error and your result suggests not.  RCs are for testing 
and I am.


The number is stored as a chain of bytes of which the most significant 
bit indicates whether the next byte still belongs to the number. If this 
bit is somehow interpreted wrong, the first byte of this number would 
read as 5, thereby returning '5' as the result and ignoring subsequent 
bytes (causing corruption at the next item to read).


Since you're using SunOS, your compiler may be doing something funky. 
Which compiler is used anyway? Perhaps different versions for the 
Dovecot releases that do and don't work?


Does it help when you change the "> 0" at the following code position to 
"!= 0" ?


https://github.com/dovecot/pigeonhole/blob/master/src/lib-sieve/sieve-binary-code.c#L300

Regards,

Stephan.



Re: v2.3.3 rc1 - Error: sieve: !!BUG!!: Binary compiled from dovecot.sieve is still corrupt

2018-09-27 Thread James

On 25/09/2018 22:39, Stephan Bosch wrote:


Something mightily weird is going on at your end. It doesn't fail here
(see below). First of all, what is your configuration (output from
`dovecot -n`)?


You have dovecot.conf but...

$ dovecot -c dovecot.conf -n
# 2.3.3.rc1 (14e4920d8): dovecot.conf
# Pigeonhole version 0.5.2 (7704de5e)
# OS: SunOS 5.11 i86pc
# Hostname: mailhost
doveconf: Warning: please set ssl_dh=doveconf: Warning: You can generate it with: dd 
if=/var/opt/xxx/lib/dovecot/ssl-parameters.dat bs=1 skip=88 | openssl 
dhparam -inform der > /etc/opt/xxx/dovecot/dh.pem

mail_debug = yes
mail_gid = staff
mail_location = maildir:/path/to/%d/%n/Maildir
mail_uid = james
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope 
encoded-character vacation subaddress comparator-i;ascii-numeric 
relational regex imap4flags copy include variables body enotify 
environment mailbox date index ihave duplicate mime foreverypart extracttext

postmaster_address = postmas...@domain.tld
ssl_dh = # hidden, use -P to show it




Also, can you make a hex dump of the binary (using `sieve-dump -h
.svbin`).


As said the svbin is identical to the one create by the previous version.

Comparing the dump:
Block 0 differs because it has the source file name.
Block 1 is identical
Block 2 is identical. It is this block that is declared corrupt.




Finally, can you try to explicitly delete the binary (preferably after
preserving it elsewhere) so that it is guaranteed to be created fresh?


I did each time.




## Success at my end:


Spot the difference...


Address   Line  Code
:   DEBUG BLOCK: 3
0001:   EXTENSIONS [1]:
0002: vacation
0004:3: VACATION
0007:5:   seconds: NUM 86400


Address   Line  Code
:   DEBUG BLOCK: 3
0001:   EXTENSIONS [1]:
0002: vacation
0004:2: VACATION
0007:4:   seconds: NUM 5
0009: Binary is corrupt.

The line numbers differs and 86400 is read as 5.  It is like it has 
forgotten the size of an integer or is confused about endianness.  There 
is something strange, like an #if that guesses wrong.  At least I have 
somewhere to start looking.


Thank you for checking at your end, I was worried the RC had introduced 
an error and your result suggests not.  RCs are for testing and I am.















Re: v2.3.3 rc1 - Error: sieve: !!BUG!!: Binary compiled from dovecot.sieve is still corrupt

2018-09-25 Thread Stephan Bosch

Hi,

Something mightily weird is going on at your end. It doesn't fail here 
(see below). First of all, what is your configuration (output from 
`dovecot -n`)?


Also, can you make a hex dump of the binary (using `sieve-dump -h 
.svbin`). See below for an example at my end.


Finally, can you try to explicitly delete the binary (preferably after 
preserving it elsewhere) so that it is guaranteed to be created fresh? 
That should not matter, but you never know.


## Success at my end:

$ sieve-test -D -d - -t - -Tlevel=matching ~/frop.sieve ~/message.eml
sieve-test(stephan)<27390><>: Debug: Loading modules from directory: 
/usr/lib/dovecot/modules
sieve-test(stephan)<27390><>: Debug: Module loaded: 
/usr/lib/dovecot/modules/lib01_acl_plugin.so
sieve-test(stephan)<27390><>: Debug: Module loaded: 
/usr/lib/dovecot/modules/lib20_virtual_plugin.so

sieve-test(stephan): Debug: Effective uid=1000, gid=1000, home=/home/stephan
sieve-test(stephan): Debug: acl: No acl_shared_dict setting - shared 
mailbox listing is disabled
sieve-test(stephan): Debug: Namespace inbox: type=private, 
prefix=INBOX/, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes 
location=maildir:~/Maildir
sieve-test(stephan): Debug: maildir++: root=/home/stephan/Maildir, 
index=, indexpvt=, control=, inbox=/home/stephan/Maildir, alt=

sieve-test(stephan): Debug: acl: initializing backend with data: vfile
sieve-test(stephan): Debug: acl: acl username = stephan
sieve-test(stephan): Debug: acl: owner = 1
sieve-test(stephan): Debug: acl vfile: Global ACLs disabled
sieve-test(stephan): Debug: Namespace : type=private, prefix=Archive/, 
sep=/, inbox=no, hidden=no, list=yes, subscriptions=yes 
location=maildir:~/MailArchive
sieve-test(stephan): Debug: maildir++: root=/home/stephan/MailArchive, 
index=, indexpvt=, control=, inbox=, alt=

sieve-test(stephan): Debug: acl: initializing backend with data: vfile
sieve-test(stephan): Debug: acl: acl username = stephan
sieve-test(stephan): Debug: acl: owner = 1
sieve-test(stephan): Debug: acl vfile: Global ACLs disabled
sieve-test(stephan): Debug: Namespace : type=public, prefix=Public/, 
sep=/, inbox=no, hidden=no, list=yes, subscriptions=no 
location=maildir:/var/mail/public
sieve-test(stephan): Debug: maildir++: root=/var/mail/public, index=, 
indexpvt=, control=, inbox=, alt=

sieve-test(stephan): Debug: acl: initializing backend with data: vfile
sieve-test(stephan): Debug: acl: acl username = stephan
sieve-test(stephan): Debug: acl: owner = 0
sieve-test(stephan): Debug: acl vfile: Global ACLs disabled
sieve-test(stephan): Debug: Namespace : type=private, prefix=virtual/, 
sep=/, inbox=no, hidden=no, list=yes, subscriptions=yes 
location=virtual:~/Maildir/virtual
sieve-test(stephan): Debug: fs: root=/home/stephan/Maildir/virtual, 
index=, indexpvt=, control=, inbox=, alt=

sieve-test(stephan): Debug: acl: initializing backend with data: vfile
sieve-test(stephan): Debug: acl: acl username = stephan
sieve-test(stephan): Debug: acl: owner = 1
sieve-test(stephan): Debug: acl vfile: Global ACLs disabled
sieve-test(stephan): Debug: Namespace : type=private, prefix=, sep=, 
inbox=no, hidden=yes, list=no, subscriptions=no location=fail::LAYOUT=none
sieve-test(stephan): Debug: none: root=, index=, indexpvt=, control=, 
inbox=, alt=
sieve-test(stephan): Debug: sieve: Pigeonhole version 0.5.3.rc1 
(b29d6a24) initializing
sieve-test(stephan): Debug: sieve: Sieve imapsieve plugin for Pigeonhole 
version 0.5.3.rc1 (b29d6a24) loaded
sieve-test(stephan): Debug: sieve: Sieve Extprograms plugin for 
Pigeonhole version 0.5.3.rc1 (b29d6a24) loaded
sieve-test(stephan): Debug: sieve: vnd.dovecot.pipe extension: no bin or 
socket directory specified; extension is unconfigured (both 
sieve_pipe_bin_dir and sieve_pipe_socket_dir are not set)
sieve-test(stephan): Debug: sieve: vnd.dovecot.filter extension: no bin 
or socket directory specified; extension is unconfigured (both 
sieve_filter_bin_dir and sieve_filter_socket_dir are not set)

debug: file storage: Using Sieve script path: /home/stephan/frop.sieve.
debug: file script: Opened script `frop' from `/home/stephan/frop.sieve'.
debug: binary save: not saving binary /home/stephan/frop.svbin, because 
it is already stored.


* Script metadata (block: 0):

class = file
class.version = 0
location = /home/stephan/frop.sieve

* Required extensions (block: 1):

  0: vacation (id: 9)

* Main program (block: 2):

Address   Line  Code
:   DEBUG BLOCK: 3
0001:   EXTENSIONS [1]:
0002: vacation
0004:    3: VACATION
0007:    5:   seconds: NUM 86400
000c:    6:   subject: STR[19] "Out of office reply"
0023:   10:   addresses: STRLIST [2] (end: 0054)
0029:   STR[17] "j@company.dom"
003d:   STR[20] "john@company.dom"
0055:   11:   reason: STR[75] "I'm out of office, please contact 
Joan Doe instead.??Best regards??John Doe"
00a3:    3:   handle: STR[117] "I'm out of office, please contact 
Joan 

Re: v2.3.3 rc1 - Error: sieve: !!BUG!!: Binary compiled from dovecot.sieve is still corrupt

2018-09-25 Thread Stephan Bosch

Ok, will fix...


Op 24-9-2018 om 15:06 schreef James:

On 24/09/2018 13:35, Stephan Bosch wrote:


You can enable `-d -' and `-t - -Tlevel=matching' as well.


$ sieve-test -D -d - -t - -Tlevel=matching -c dovecot.conf sieve message
sieve-test(james): Debug: Effective uid=1001, gid=10, home=/home/james
sieve-test(james): Debug: maildir++: root=/path/to//james/Maildir, 
index=, indexpvt=, control=, inbox=/path/to//james/Maildir, alt=
sieve-test(james): Debug: sieve: Pigeonhole version 0.5.2 (7704de5e) 
initializing
sieve-test(james): Debug: sieve: include: sieve_global is not set; it 
is currently not possible to include `:global' scripts.

debug: file storage: Using Sieve script path: /home/james/sieve.
debug: file script: Opened script `sieve' from `/home/james/sieve'.
debug: Script `sieve' from /home/james/sieve successfully compiled.

* Script metadata (block: 0):

class = file
class.version = 0
location = /home/james/sieve

* Required extensions (block: 1):

  0: vacation (id: 9)

* Main program (block: 2):

Address   Line  Code
:   DEBUG BLOCK: 3
0001:   EXTENSIONS [1]:
0002: vacation
0004:    2: VACATION
0007:    4:   seconds: NUM 5
0009: Binary is corrupt.


  ## Started executing script 'sieve'
  VACATION: #ERROR#: unknown optional operand
   2: [[EXECUTION ABORTED]]
  ## Finished executing script 'sieve'

sieve-test(james): Info: corrupt binary deleted.
sieve-test(james): Error: unlink((null)) failed: Bad address (in 
sieve-test.c:426)
sieve-test(james): Info: final result: failed; resolved with 
successful implicit keep






Re: v2.3.3 rc1 - Error: sieve: !!BUG!!: Binary compiled from dovecot.sieve is still corrupt

2018-09-24 Thread James

On 24/09/2018 13:35, Stephan Bosch wrote:


You can enable `-d -' and `-t - -Tlevel=matching' as well.


$ sieve-test -D -d - -t - -Tlevel=matching -c dovecot.conf sieve message
sieve-test(james): Debug: Effective uid=1001, gid=10, home=/home/james
sieve-test(james): Debug: maildir++: root=/path/to//james/Maildir, 
index=, indexpvt=, control=, inbox=/path/to//james/Maildir, alt=
sieve-test(james): Debug: sieve: Pigeonhole version 0.5.2 (7704de5e) 
initializing
sieve-test(james): Debug: sieve: include: sieve_global is not set; it is 
currently not possible to include `:global' scripts.

debug: file storage: Using Sieve script path: /home/james/sieve.
debug: file script: Opened script `sieve' from `/home/james/sieve'.
debug: Script `sieve' from /home/james/sieve successfully compiled.

* Script metadata (block: 0):

class = file
class.version = 0
location = /home/james/sieve

* Required extensions (block: 1):

  0: vacation (id: 9)

* Main program (block: 2):

Address   Line  Code
:   DEBUG BLOCK: 3
0001:   EXTENSIONS [1]:
0002: vacation
0004:2: VACATION
0007:4:   seconds: NUM 5
0009: Binary is corrupt.


  ## Started executing script 'sieve'
  VACATION: #ERROR#: unknown optional operand
   2: [[EXECUTION ABORTED]]
  ## Finished executing script 'sieve'

sieve-test(james): Info: corrupt binary deleted.
sieve-test(james): Error: unlink((null)) failed: Bad address (in 
sieve-test.c:426)
sieve-test(james): Info: final result: failed; resolved with successful 
implicit keep




Re: v2.3.3 rc1 - Error: sieve: !!BUG!!: Binary compiled from dovecot.sieve is still corrupt

2018-09-24 Thread Stephan Bosch

You can enable `-d -' and `-t - -Tlevel=matching' as well.


Op 24-9-2018 om 13:34 schreef James:

On 24/09/2018 11:51, Stephan Bosch wrote:


Can you try with the sieve-test command-line tool, in particular with
trace debugging enabled?


Thank you for the debugging tip, is this useful?


$ sieve-test -D -c dovecot.conf sieve message
sieve-test(james): Debug: sieve: Pigeonhole version 0.5.3.rc1 
(716b1b49) initializing
sieve-test(james): Debug: sieve: include: sieve_global is not set; it 
is currently not possible to include `:global' scripts.

debug: file storage: Using Sieve script path: /home/james/sieve.
debug: file script: Opened script `sieve' from `/home/james/sieve'.
debug: Script `sieve' from /home/james/sieve successfully compiled.
sieve-test(james): Info: corrupt binary deleted.
sieve-test(james): Error: unlink((null)) failed: Bad address (in 
sieve-test.c:426)
sieve-test(james): Info: final result: failed; resolved with 
successful implicit keep





$ cat dovecot.conf
mail_uid = james
mail_gid = staff
mail_location = maildir:/path/to/%d/%n/Maildir
postmaster_address = postmas...@domain.tld



$ cat sieve
require ["vacation"];
vacation
  # Reply at most once a day to a same sender
  :days 1
  :subject "Out of office reply"
  # List of additional recipient addresses which are included in the 
auto replying.
  # If a mail's recipient is not the envelope recipient and it's not 
on this list,

  # no vacation reply is sent for it.
  :addresses ["j@company.dom", "john@company.dom"]
"I'm out of office, please contact Joan Doe instead.
Best regards
John Doe";



$ cat message
Subject: test
From: m...@domain.tld

testing 123




Re: v2.3.3 rc1 - Error: sieve: !!BUG!!: Binary compiled from dovecot.sieve is still corrupt

2018-09-24 Thread James

On 24/09/2018 12:54, James wrote:

Remove 2.3.3 rc1, install 2.3.2 and 0.5.2, success with sieve-test 
including ":days 1"


Re: v2.3.3 rc1 - Error: sieve: !!BUG!!: Binary compiled from dovecot.sieve is still corrupt

2018-09-24 Thread James

On 24/09/2018 12:34, James wrote:


$ cat sieve
require ["vacation"];
vacation
  # Reply at most once a day to a same sender
  :days 1


...removing the ":days 1" stops the corruption:

$ sieve-test -D -c dovecot.conf sieve.2 message
sieve-test(james): Debug: Effective uid=1001, gid=10, home=/home/james
sieve-test(james): Debug: maildir++: root=/path/to//james/Maildir, 
index=, indexpvt=, control=, inbox=/path/to//james/Maildir, alt=
sieve-test(james): Debug: sieve: Pigeonhole version 0.5.3.rc1 (716b1b49) 
initializing
sieve-test(james): Debug: sieve: include: sieve_global is not set; it is 
currently not possible to include `:global' scripts.

debug: file storage: Using Sieve script path: /home/james/sieve.2.
debug: file script: Opened script `sieve.2' from `/home/james/sieve.2'.
debug: Script `sieve.2' from /home/james/sieve.2 successfully compiled.

Performed actions:

 * send vacation message:
=> seconds : 604800
=> subject : Out of office reply
=> handle  : I'm out of office, please contact Joan Doe instead.
Best regards
John DoeOut of office reply

START MESSAGE
I'm out of office, please contact Joan Doe instead.
Best regards
John Doe
END MESSAGE

Implicit keep:

 * store message in folder: INBOX

sieve-test(james): Info: final result: success




$ cat sieve.2
require ["vacation"];
vacation
  # Reply at most once a day to a same sender
# :days 1
  :subject "Out of office reply"
  # List of additional recipient addresses which are included in the 
auto replying.
  # If a mail's recipient is not the envelope recipient and it's not on 
this list,

  # no vacation reply is sent for it.
  :addresses ["j@company.dom", "john@company.dom"]
"I'm out of office, please contact Joan Doe instead.
Best regards
John Doe";



Re: v2.3.3 rc1 - Error: sieve: !!BUG!!: Binary compiled from dovecot.sieve is still corrupt

2018-09-24 Thread James

On 24/09/2018 11:51, Stephan Bosch wrote:


Can you try with the sieve-test command-line tool, in particular with
trace debugging enabled?


Thank you for the debugging tip, is this useful?


$ sieve-test -D -c dovecot.conf sieve message
sieve-test(james): Debug: sieve: Pigeonhole version 0.5.3.rc1 (716b1b49) 
initializing
sieve-test(james): Debug: sieve: include: sieve_global is not set; it is 
currently not possible to include `:global' scripts.

debug: file storage: Using Sieve script path: /home/james/sieve.
debug: file script: Opened script `sieve' from `/home/james/sieve'.
debug: Script `sieve' from /home/james/sieve successfully compiled.
sieve-test(james): Info: corrupt binary deleted.
sieve-test(james): Error: unlink((null)) failed: Bad address (in 
sieve-test.c:426)
sieve-test(james): Info: final result: failed; resolved with successful 
implicit keep





$ cat dovecot.conf
mail_uid = james
mail_gid = staff
mail_location = maildir:/path/to/%d/%n/Maildir
postmaster_address = postmas...@domain.tld



$ cat sieve
require ["vacation"];
vacation
  # Reply at most once a day to a same sender
  :days 1
  :subject "Out of office reply"
  # List of additional recipient addresses which are included in the 
auto replying.
  # If a mail's recipient is not the envelope recipient and it's not on 
this list,

  # no vacation reply is sent for it.
  :addresses ["j@company.dom", "john@company.dom"]
"I'm out of office, please contact Joan Doe instead.
Best regards
John Doe";



$ cat message
Subject: test
From: m...@domain.tld

testing 123


Re: v2.3.3 rc1 - Error: sieve: !!BUG!!: Binary compiled from dovecot.sieve is still corrupt

2018-09-24 Thread Stephan Bosch
Can you try with the sieve-test command-line tool, in particular with 
trace debugging enabled?




Op 24-9-2018 om 12:03 schreef James:
I have a sieve problem with dovecot v2.3.3 rc1 with either of 
pigeonhole 0.5.2 or 0.5.3.rc1.  The the change that triggers this is 
in dovecot not pigeonhole.  Sieve filtering has been working with 
v2.3.2 and many earlier versions.



Log report:
Sep 24 10:36:13 mailhost dovecot: [ID 702911 mail.error] 
lmtp(u...@domain.tld)<15816>: Error: sieve: 
!!BUG!!: Binary compiled from /path/to/domain/user/dovecot.sieve is 
still corrupt; bailing out and reverting to default delivery



This is a sieve script with a vacation handler.  My other sieve 
filters are working.  My actual sieve filter worked before and was 
written by Roundcube web mail.  My failing test script is cut-n-paste 
from the sieve examples 
https://wiki2.dovecot.org/Pigeonhole/Sieve/Examples so should not be 
in doubt.


The text script compiles to dovecot.svbin and newly compiled files are 
identical to older versions, the compilation has not changed.




James.