faild to rename deleted mailbox, or how conversation db sucks again

2019-03-01 Thread Michael Menge

I


i have now a user request to restore a deleted mailbox.

This failed with "Invalid mailbox name" in cyradm. which is wrong in  
the fist place,

because the new name was the original name.

In the Log files I found "can't rename a deleted mailbox" and I discovered
this in the source :-(


/* we can't rename back from a deleted mailbox, because the conversations
 * information will be wrong.  Ideally we might re-calculate, but for now
 * we just throw a big fat error */
if (config_getswitch(IMAPOPT_CONVERSATIONS) &&
mboxname_isdeletedmailbox(oldmailbox->name, NULL)) {
syslog(LOG_ERR, "can't rename a deleted mailbox %s",  
oldmailbox->name);

return IMAP_MAILBOX_BADNAME;
}


So conversation db breaks one of the mail reasons "delete_mode: delayed"
(restoring deleted folders) without resorting to a filebased backup.

Is there an other way than disabling
- conversation db,
- restoring the folder,
- enabeling conversation db again (so that squat files are used for  
header searches),
- rebuilding conversation db for all users (because there will be some  
new mails between

  disabling and re-enabling conversation db).

Kind regards.

   Michael Menge


M.MengeTel.: (49) 7071/29-70316
Universität Tübingen   Fax.: (49) 7071/29-5912
Zentrum für Datenverarbeitung  mail:  
michael.me...@zdv.uni-tuebingen.de

Wächterstraße 76
72074 Tübingen


Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Sieve script not working

2019-03-01 Thread Andrea Venturoli

On 3/1/19 3:18 PM, Willem Offermans wrote:

Dear Andrea and Cyrus friends,

That is exactly the point: it was not ``stupid`` in any way.
It was ignorance, which we can only avoid by improving the
documentation.


I blame myself for this; I'll be glad if the documentation was improved, 
obviously.





By the way, the debug/logging question is still not answered.
Debugging/logging might also enlighten the user/administrator.


That's right.
Better logs would be a very big improvement: what I was looking for was 
an option to write sieve activity (like "executing script ...", "message 
moved to folder ...", etc...).
That would have confirmed the script was NOT even executed (and avoided 
several attempts at modifying it).




 bye & Thanks
av.

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


Re: Sieve script not working

2019-03-01 Thread Willem Offermans
Dear Andrea and Cyrus friends,

That is exactly the point: it was not ``stupid`` in any way.
It was ignorance, which we can only avoid by improving the 
documentation.

By the way, the debug/logging question is still not answered.
Debugging/logging might also enlighten the user/administrator.



Wiel Offermans
wil...@offermans.rompen.nl




> On 1 Mar 2019, at 15:04, Andrea Venturoli  wrote:
> 
> On 3/1/19 12:31 PM, Michael Menge wrote:
> 
>> is the script activated?
> 
> Uh, no!
> 
> 
> 
>> a user can have multiple scripts stored on the server
>> but only one can be activated at the same time. On the filesystem there 
>> should
>> be a "defaultbc"  which is a soft link to the active bc file.
> 
> There was no such link.
> 
> I have now "activated" this script and hope I can confirm it working the next 
> time this account receives spam.
> 
> 
> 
> I guess this was it and I'm glad it was somethin so "stupid" on my part.
> 
> Thanks.
> 
> 
> 
> bye
>   av.
> 
> Cyrus Home Page: http://www.cyrusimap.org/
> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
> To Unsubscribe:
> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Sieve script not working

2019-03-01 Thread Andrea Venturoli

On 3/1/19 12:31 PM, Michael Menge wrote:


is the script activated?


Uh, no!



a user can have multiple scripts stored on the 
server
but only one can be activated at the same time. On the filesystem there 
should

be a "defaultbc"  which is a soft link to the active bc file.


There was no such link.

I have now "activated" this script and hope I can confirm it working the 
next time this account receives spam.




I guess this was it and I'm glad it was somethin so "stupid" on my part.

Thanks.



 bye
av.

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Sieve script not working

2019-03-01 Thread Michael Menge

Hi


Quoting Willem Offermans :


Dear Michael and Cyrus friends,

Where is this documented?




I cannot find anything about this in

https://www.cyrusimap.org/imap/reference/admin/sieve.html  



The example shown in section "Testing the sieve server"
https://www.cyrusimap.org/imap/reference/admin/sieve.html#testing-the-sieve-server

# To place this script on the server run the following command:
#
# sieveshell servername
# Please enter your password: **
#> put myscript.script
#> activate myscript
#> quit
#
#This should place your script on the server and make it the active script.

As timsieved implements rfc5804 there is also
https://tools.ietf.org/html/rfc5804#section-1.4



How should a user/administrator know?

Pay attention to

https://www.cyrusimap.org/imap/reference/manpages/usercommands/sieveshell.html#std:cyrusman-sieveshell(1)  



and look at activate/deactivate.

This is sufficient documentation according to the developer, who  
spent many hours in the code, I guess.
However, an ignorant user only gets a hint at most. Where is  
defaultbc mentioned? Be aware that the
text the user reads is far away off what the user experiences, when  
he uses sieveshell. There is no

(visual) connection between the two. It is a challenge to find your way.



I don't know if the defaultbc is documented somewhere, google found
some old list mails from 2007 and a thread on a german linux forum.
So there is room for improvement.

The users can't normally see this file, it is only visible indirect as the
active script is shown / marked in timsieved / sieveshell "list" command.






M.MengeTel.: (49) 7071/29-70316
Universität Tübingen   Fax.: (49) 7071/29-5912
Zentrum für Datenverarbeitung  mail:  
michael.me...@zdv.uni-tuebingen.de

Wächterstraße 76
72074 Tübingen


Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Sieve script not working

2019-03-01 Thread Willem Offermans
Dear Michael and Cyrus friends,

Where is this documented?

I cannot find anything about this in

https://www.cyrusimap.org/imap/reference/admin/sieve.html 


How should a user/administrator know?

Pay attention to

https://www.cyrusimap.org/imap/reference/manpages/usercommands/sieveshell.html#std:cyrusman-sieveshell(1)
 


and look at activate/deactivate. 

This is sufficient documentation according to the developer, who spent many 
hours in the code, I guess.
However, an ignorant user only gets a hint at most. Where is defaultbc 
mentioned? Be aware that the 
text the user reads is far away off what the user experiences, when he uses 
sieveshell. There is no 
(visual) connection between the two. It is a challenge to find your way. 

I’m a bit ashamed, but I found a way to contribute to the documentation:

https://www.cyrusimap.org/imap/developer/documentation.html

It is better for me to contribute. 

I hope I can find some time ...



Wiel Offermans
wil...@offermans.rompen.nl




> On 1 Mar 2019, at 12:31, Michael Menge  
> wrote:
> 
> Hi
> 
> Quoting Andrea Venturoli :
> 
>> On 3/1/19 12:04 PM, Willem Offermans wrote:
>> 
>>> (big snip on the rest)
>>> $ man timsieved
>>> TIMSIEVED(8)   
>>> TIMSIEVED(8)
>> 
>> Just to make sure I've clarified this: the script *is* there.
>> 
>>> ls /var/imap/sieve/u/user1
>>> user1.sieve.bc  user1.sieve.script
>> 
> 
> is the script activated? a user can have multiple scripts stored on the server
> but only one can be activated at the same time. On the filesystem there should
> be a "defaultbc"  which is a soft link to the active bc file.
> 
>> The content of user1.sieve.script is the script I installed via sieveshell; 
>> user1.sieve.bc is a bytecode file where some strings (i.e. regex and folder 
>> names) match the original script, so I think it's right.
>> 
>> As I said, the same goes for user2 and user3, but for those users the script 
>> also works.
>> 
>> bye & Thanks
>>  av.
>> 
>> Cyrus Home Page: http://www.cyrusimap.org/
>> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
>> To Unsubscribe:
>> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus
> 
> 
> 
> 
> M.MengeTel.: (49) 7071/29-70316
> Universität Tübingen   Fax.: (49) 7071/29-5912
> Zentrum für Datenverarbeitung  mail: 
> michael.me...@zdv.uni-tuebingen.de
> Wächterstraße 76
> 72074 Tübingen
> 
> 
> Cyrus Home Page: http://www.cyrusimap.org/
> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
> To Unsubscribe:
> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Sieve script not working

2019-03-01 Thread Michael Menge

Hi

Quoting Andrea Venturoli :


On 3/1/19 12:04 PM, Willem Offermans wrote:


(big snip on the rest)
$ man timsieved
TIMSIEVED(8)   
 TIMSIEVED(8)


Just to make sure I've clarified this: the script *is* there.


ls /var/imap/sieve/u/user1
user1.sieve.bc  user1.sieve.script




is the script activated? a user can have multiple scripts stored on the server
but only one can be activated at the same time. On the filesystem there should
be a "defaultbc"  which is a soft link to the active bc file.

The content of user1.sieve.script is the script I installed via  
sieveshell; user1.sieve.bc is a bytecode file where some strings  
(i.e. regex and folder names) match the original script, so I think  
it's right.


As I said, the same goes for user2 and user3, but for those users  
the script also works.


 bye & Thanks
av.

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus





M.MengeTel.: (49) 7071/29-70316
Universität Tübingen   Fax.: (49) 7071/29-5912
Zentrum für Datenverarbeitung  mail:  
michael.me...@zdv.uni-tuebingen.de

Wächterstraße 76
72074 Tübingen


Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Sieve script not working

2019-03-01 Thread Andrea Venturoli

On 3/1/19 12:04 PM, Willem Offermans wrote:

> (big snip on the rest)

$ man timsieved
TIMSIEVED(8) 
  TIMSIEVED(8)


Just to make sure I've clarified this: the script *is* there.


ls /var/imap/sieve/u/user1
user1.sieve.bc  user1.sieve.script


The content of user1.sieve.script is the script I installed via 
sieveshell; user1.sieve.bc is a bytecode file where some strings (i.e. 
regex and folder names) match the original script, so I think it's right.


As I said, the same goes for user2 and user3, but for those users the 
script also works.


 bye & Thanks
av.

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Sieve script not working

2019-03-01 Thread Willem Offermans
Dear Andrea and Cyrus friends,

I remember from a long time ago, that documentation with respect to sieve was 
sparse.
It took me quite some time to set things up and to handle sieve back then. But 
even now
I wouldn’t know how to debug the sieve process. Most of the things in the 
background of the
sieve process are still mysterious to me. But it works very well from a 
perspective from a user.
Since then, it didn’t change for the better, I’m afraid.

It can happen with software development: nice and excellent code has been 
developed,
but the program is almost not useable or is only partly used with respect to 
its power, because of lack of 
documentation. Usually an excellent developer is a poor documenter. It is very 
time consuming and oh so boring to write
good documentation…. To a great frustration of the users … And this is not a 
judgement, I can understand both sides.

What can help in such a situation, is to dig into the original code.
If you are extremely lucky, the developer commented its code and you can 
follow, read and/or puzzle on
what is going on. It might give you hints on how to debug.
Also go through the original code distribution. Sometimes it includes ReadMe’s 
or examples, which can give you hints.
 
If you find something useful, or if you even can solve your problem, then 
please document it and try to get the documentation 
into the source distribution, or at least into the mailing list, so that others 
can benefit from it.

The following is illustrative of what I mean:


$ ll /usr/local/cyrus/bin/*ieve*
-rwxr-xr-x  1 root  wheel  uarch 1191104 Nov  7  2016 
/usr/local/cyrus/bin/sievec
-rwxr-xr-x  1 root  wheel  uarch 1182048 Nov  7  2016 
/usr/local/cyrus/bin/sieved
-rwxr-xr-x  1 root  wheel  uarch 1512864 Nov  7  2016 
/usr/local/cyrus/bin/compile_sieve
-rwxr-xr-x  1 root  wheel  uarch 1544432 Nov  7  2016 
/usr/local/cyrus/bin/timsieved
-r-xr-xr-x  1 root  wheel  uarch4976 Nov  7  2016 
/usr/local/cyrus/bin/masssievec
$ man sievec
No manual entry for sievec
$ man sieved
No manual entry for sieved
$ man compile_sieve
No manual entry for compile_sieve
$ man masssievec
No manual entry for masssievec
$ man timsieved
TIMSIEVED(8)  TIMSIEVED(8)



 *

NAME
   timsieved - CMU hack for getting sieve scripts onto the server

SYNOPSIS
   timsieved [ -C config-file ]

DESCRIPTION
   timsieved  is a server that allows users to remotely manage their sieve
   scripts kept on the server.  It accepts commands on its standard  input
   and  responds  on  its standard output. It MUST be invoked by master(8)
   with those descriptors attached to a remote client connection.

   Cyrus admins that authenticate and authorize as themselves (e.g.  don't
   proxy) manage global scripts.

   Timsieved reads its configuration options out of the imapd.conf(5) file
   unless specified otherwise by -C.


OPTIONS
   -C config-file
  Read configuration options from config-file.

FILES
   /etc/imapd.conf

SEE ALSO
   imapd.conf(5), master(8)



CMU  Project CyrusTIMSIEVED(8)



man  is usually the starting point of your journey.  



Wiel Offermans
wil...@offermans.rompen.nl




> On 1 Mar 2019, at 11:16, Andrea Venturoli  wrote:
> 
> On 3/1/19 11:01 AM, Merlin Hartley wrote:
>> Is this a shared mailbox?
> 
> No.
> 
> 
> 
>> Have you actually compiled the script or just
>> put the plain text there? Did you install the file by hand or use something 
>> like timsieved?
> 
> I install the scripts via sieveshell.
> 
> 
> 
>> You haven’t really given us much to go on…
> 
> Unfortunately, I really don't know which information I should post.
> My original question was if I could enable some logs to see what was going on.
> If there is other info that can be useful to solve this problem, I'm willing 
> to report it.
> 
> 
> 
> bye & Thanks
>   av.
> 
> Cyrus Home Page: http://www.cyrusimap.org/
> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
> To Unsubscribe:
> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Sieve script not working

2019-03-01 Thread Andrea Venturoli

On 3/1/19 11:01 AM, Merlin Hartley wrote:

Is this a shared mailbox?


No.




Have you actually compiled the script or just
put the plain text there? Did you install the file by hand or use 
something like timsieved?


I install the scripts via sieveshell.




You haven’t really given us much to go on…


Unfortunately, I really don't know which information I should post.
My original question was if I could enable some logs to see what was 
going on.
If there is other info that can be useful to solve this problem, I'm 
willing to report it.




 bye & Thanks
av.

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Sieve script not working

2019-03-01 Thread Merlin Hartley
Is this a shared mailbox? Have you actually compiled the script or just put the 
plain text there? Did you install the file by hand or use something like 
timsieved?

You haven’t really given us much to go on…


Merlin
--
Merlin Hartley
Computer Officer
MRC Mitochondrial Biology Unit
University of Cambridge
Cambridge, CB2 0XY
United Kingdom

> On 1 Mar 2019, at 09:02, Andrea Venturoli  wrote:
> 
> On 2/6/19 6:43 PM, Bron Gondwana wrote:
> 
>> Yeah, it's just called test.c in the sieve directory. Here's our buildscript 
>> code:
>> ...
> 
> I'm giving up on this: I cannot get to build this test binary; besides, I'm 
> *sure* the script is correct, since it works for other 2 mailboxes.
> 
> Thanks for your help anyway.
> 
> bye
>   av.
> 
> Cyrus Home Page: http://www.cyrusimap.org/
> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
> To Unsubscribe:
> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Sieve script not working

2019-03-01 Thread Andrea Venturoli

On 2/6/19 6:43 PM, Bron Gondwana wrote:

Yeah, it's just called test.c in the sieve directory. Here's our 
buildscript code:

...


I'm giving up on this: I cannot get to build this test binary; besides, 
I'm *sure* the script is correct, since it works for other 2 mailboxes.


Thanks for your help anyway.

 bye
av.

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus