Re: Sieve not getting recompiled

2024-04-20 Thread Joan Moreau via dovecot

I changed it to the following to stick to the doc

   sieve = file:/mails/%d/%n/sieve/
sieve_after = file:/mails/sieve/after.sieve
sieve_default = file:/mails/sieve/before.sieve
sieve_before = file:/mails/sieve/before.sieve

Still no scripts are compiled/executed (and it was working fine before 
!)


On 2024-04-21 09:21, Joan Moreau wrote:


Hi

I have

sieve = /mails/%d/%n/sieve/roundcube.sieve
sieve_after = /mails/sieve/after.sieve
sieve_before = /mails/sieve/before.sieve
sieve_dir = /mails/%d/%n/sieve/
sieve_global_dir = /mails/sieve/

But sieve scripts are not compiled and not executed

It was working until I removed the setting "sieve_global_path"

Something I dont understand ?

Thank you

___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Sieve not getting recompiled

2024-04-20 Thread Joan Moreau via dovecot

Hi

I have

sieve = /mails/%d/%n/sieve/roundcube.sieve
sieve_after = /mails/sieve/after.sieve
sieve_before = /mails/sieve/before.sieve
sieve_dir = /mails/%d/%n/sieve/
sieve_global_dir = /mails/sieve/

But sieve scripts are not compiled and not executed

It was working until I removed the setting "sieve_global_path"

Something I dont understand ?

Thank you
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Re: exfat not supported ?

2024-04-20 Thread Joan Moreau via dovecot

That resolve the fisrt bug

but I get now :

Error: link(/xxx/dovecot.list.index.log, /xxx/dovecot.list.index.log.2) 
failed: Operation not permitted


On 2024-04-21 02:02, Aki Tuomi via dovecot wrote:


Try setting lock_method = dotlock

Aki
On 20/04/2024 15:32 EEST Joan Moreau via dovecot
 wrote:

I tried and get the following:

Error: Couldn't create mailbox list lock /xxx/mailboxes.lock:
file_create_locked(/xxx/mailboxes.lock) failed:
link(/xxx/mailboxes.locka94f3757318b0b90, /xxx/mailboxes.lock)
failed:
Operation not permitted

On 2024-04-20 17:39, Aki Tuomi via dovecot wrote:

On 20/04/2024 12:27 EEST Joan Moreau via dovecot
 wrote:

Hi

Would placing my storage on a exfat partition work ? If no,
why ?

Thank you
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

I can't see any reason why not. As long as it behaves like
POSIX
filesystem.

Aki
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Re: exfat not supported ?

2024-04-20 Thread Joan Moreau via dovecot

I tried and get the following:

Error: Couldn't create mailbox list lock /xxx/mailboxes.lock: 
file_create_locked(/xxx/mailboxes.lock) failed: 
link(/xxx/mailboxes.locka94f3757318b0b90, /xxx/mailboxes.lock) failed: 
Operation not permitted


On 2024-04-20 17:39, Aki Tuomi via dovecot wrote:


On 20/04/2024 12:27 EEST Joan Moreau via dovecot
 wrote:

Hi

Would placing my storage on a exfat partition work ? If no, why ?

Thank you
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

I can't see any reason why not. As long as it behaves like POSIX 
filesystem.


Aki
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


thread->detach() creates confusion of dovecot

2024-04-20 Thread Joan Moreau via dovecot

Hi

When I try to "detach" 
(https://en.cppreference.com/w/cpp/thread/thread/detach) a thread 
running inside a plugin, it seems the core dovecot has some influence on 
that , tries to close this for some unknown reason and usually ends up 
crashing


What is the cause of this ?

Thank you
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


exfat not supported ?

2024-04-20 Thread Joan Moreau via dovecot

Hi

Would placing my storage on a exfat partition work ? If no, why ?

Thank you
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Re: [EXT] Re: How to get a memory pointer in the core process

2024-03-14 Thread Joan Moreau via dovecot
Thanks Eduardo

I am trying to avoid closing/ reopening a file pointer to the exact same file
between each call to the plugin



On 14 March 2024 20:08:37 Eduardo M KALINOWSKI via dovecot
 wrote:

 On 14/03/2024 02:49, Joan Moreau via dovecot wrote:
  No, you don´t understand
  There is a core process (/usr/bin/dovecot) running all the
  time. So I want to
  allocate a memory block, the core process keep it and it is
  retrievable by the
  pluging when laded again
  At exit of /usr/bin/dovecot, it just does a "delete()" of
  the said allocation

 While I cannot help you with plugin writing or dovecot internals,
 this 
 does seem like an example of the XY problem[0]. Perhaps if you
 provide a 
 high level description of what you're attempting to do someone might 
 come up with a way to achieve that.

 [0] https://en.wikipedia.org/wiki/XY_problem

 -- 
 Eduardo M KALINOWSKI
 edua...@kalinowski.com.br

 ___
 dovecot mailing list -- dovecot@dovecot.org
 To unsubscribe send an email to dovecot-le...@dovecot.org

___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Re: [EXT] Re: How to get a memory pointer in the core process

2024-03-13 Thread Joan Moreau via dovecot
No, you don´t understand
There is a core process (/usr/bin/dovecot) running all the time. So I want to
allocate a memory block, the core process keep it and it is retrievable by the
pluging when laded again
At exit of /usr/bin/dovecot, it just does a "delete()" of the said allocation


On 2024-03-14 13:25, Aki Tuomi via dovecot wrote:
 Hi!

 Sorry but that's just not possible, ther is no "core" where to create
 such object. There is no "dovecot" where to store things.

 When user logs in, dovecot executes /usr/libexec/dovecot/imap and
 transfers the connection fd there. then plugins and stuff are loaded,
 and the user does what he does, and then plugins and stuff are
 unloaded and process exists and no longer exists in memory.

 You are clearly asking about memory persistence between sessions, and
 this can be done with

 a) services (internal or external), such as redis, sql, or something
 else
 b) storing things to disk

 Aki

  On 13/03/2024 18:45 EET Joan Moreau via dovecot
   wrote:

   
  No, I am not referring to that

  I want to create an object at first call in memory

  that object would be retrievable at second and furthers
  calls of the
  plugin, as long as dovecot is running

  On 2024-03-13 16:29, Aki Tuomi via dovecot wrote:

   Not really no. You should use e.g. dict inteface
   for storing this kind
   of stateful data. When deinit is called the
   calling core process will
   likely die too.

   Aki

   On 13/03/2024 10:19 EET Joan Moreau
wrote:

   Keep a pointer in memory retrievable each time a
   plugin is called

   So the plugin keep the memory, not has to restart
   everything at each
   call

   On 12 March 2024 08:53:38 Aki Tuomi via dovecot
   
   wrote:

   On 11/03/2024 10:42 EET Joan Moreau
wrote:

   Hi
   Is it possible, from a plugin perspective, to
   create and recover a
   pointer in the core process (i.e. memory not lost
   between 2 calls to
   the plugin, even after the "deinit" of the
   plugin" ) ?

   Thanks
   Hi Joan!

   May I ask what you are attempting to achieve in
   more detail?

   Aki
   ___
   dovecot mailing list -- dovecot@dovecot.org
   To unsubscribe send an email to dovecot-
   le...@dovecot.org
    ___
  dovecot mailing list -- dovecot@dovecot.org
  To unsubscribe send an email to dovecot-
  leave@dovecot.orgNo, I am not referring to that
  I want to create an object at first call in memory
  that object would be retrievable at second and furthers
  calls of the plugin, as
  long as dovecot is running




  On 2024-03-13 16:29, Aki Tuomi via dovecot wrote:
       Not really no. You should use e.g. dict inteface for
  storing this
       kind of stateful data. When deinit is called the
  calling core process
       will likely die too.

       Aki

            On 13/03/2024 10:19 EET Joan Moreau
   wrote:


            Keep a pointer in memory retrievable each time a
  plugin is
            called

            So the plugin keep the memory, not has to restart
            everything at each call



            On 12 March 2024 08:53:38 Aki Tuomi via dovecot
             wrote:

                      On 11/03/2024 10:42 EET Joan Moreau
                       wrote:


                      Hi
                      Is it possible, from a plugin
                      perspective, to create and recover a
                      pointer in the core process (i.e.
                      memory not lost between 2 calls to the
                      plugin, even after the "deinit" of the
                      plugin" ) ?

                      Thanks

                 Hi Joan!

                 May I ask what you are attempting to achieve
  in
                 more detail?

                 Aki
               
   ___
                 dovecot mailing list -- dovecot@dovecot.org
                 To unsubscribe send an email to dovecot-
                 le...@dovecot.org
       __

Re: [EXT] Re: How to get a memory pointer in the core process

2024-03-13 Thread Joan Moreau via dovecot
No, I am not referring to that
I want to create an object at first call in memory
that object would be retrievable at second and furthers calls of the plugin, as
long as dovecot is running




On 2024-03-13 16:29, Aki Tuomi via dovecot wrote:
 Not really no. You should use e.g. dict inteface for storing this
 kind of stateful data. When deinit is called the calling core process
 will likely die too.

 Aki

  On 13/03/2024 10:19 EET Joan Moreau  wrote:


  Keep a pointer in memory retrievable each time a plugin is
  called

  So the plugin keep the memory, not has to restart
  everything at each call



  On 12 March 2024 08:53:38 Aki Tuomi via dovecot
   wrote:

On 11/03/2024 10:42 EET Joan Moreau
 wrote:


Hi
Is it possible, from a plugin
perspective, to create and recover a
pointer in the core process (i.e.
memory not lost between 2 calls to the
plugin, even after the "deinit" of the
plugin" ) ?

Thanks

   Hi Joan!

   May I ask what you are attempting to achieve in
   more detail?

   Aki
   ___
   dovecot mailing list -- dovecot@dovecot.org
   To unsubscribe send an email to dovecot-
   le...@dovecot.org
 ___
 dovecot mailing list -- dovecot@dovecot.org
 To unsubscribe send an email to dovecot-le...@dovecot.org

___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Re: How to get a memory pointer in the core process

2024-03-13 Thread Joan Moreau via dovecot
Keep a pointer in memory retrievable each time a plugin is called

So the plugin keep the memory, not has to restart everything at each call



On 12 March 2024 08:53:38 Aki Tuomi via dovecot  wrote:

  On 11/03/2024 10:42 EET Joan Moreau  wrote:


  Hi
  Is it possible, from a plugin perspective, to create and
  recover a pointer in the core process (i.e. memory not lost
  between 2 calls to the plugin, even after the "deinit" of
  the plugin" ) ?

  Thanks

 Hi Joan!

 May I ask what you are attempting to achieve in more detail?

 Aki
 ___
 dovecot mailing list -- dovecot@dovecot.org
 To unsubscribe send an email to dovecot-le...@dovecot.org

___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


How to get a memory pointer in the core process

2024-03-11 Thread Joan Moreau via dovecot
Hi
Is it possible, from a plugin perspective, to create and recover a pointer in
the core process (i.e. memory not lost between 2 calls to the plugin, even
after the "deinit" of the plugin" ) ?

Thanks
___
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org


Re: FTS Xapian -> FTS core issue

2019-06-09 Thread Joan Moreau via dovecot
The issue is not in plug-in then. 


Maybe Aki or Timo knows where does this bug come from ?

On 2019-06-07 14:09, Daniel Miller wrote:

Yes, latest git version.  

The logs show (as I read them) returned results - yet nothing shows in the client. The logs look the same (with different numbers) when querying "regular" folders - but results are shown in clients.  


--
Daniel 

On June 6, 2019 12:16:08 AM Joan Moreau  wrote: 

Hi 

Are you using the latest git version ? 

WHich part exactly of your logs relates to "virtual folders do not work" ? 

On 2019-06-05 13:08, Daniel Miller via dovecot wrote: 
Logs:


Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
Opening DB (RO) 
/var/mail/amfes.com/dmiller/sdbox/xapian-indexes/db_f2857830c70c844e2f1d3bc41c5f
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: FLAG=AND
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: FTS Xapian: Query= (subject:"dovecot" OR 
from:"dovecot" OR to:"dovecot" OR cc:"dovecot" OR bcc:"dovecot" OR message-id:"dovecot" OR 
body:"dovecot")
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: 0 results in 1 ms
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
Opening DB (RO) 
/var/mail/amfes.com/dmiller/sdbox/xapian-indexes/db_78544714f3f1ae5b9b0d3bda95b5
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: FLAG=AND
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: FTS Xapian: Query= (subject:"dovecot" OR 
from:"dovecot" OR to:"dovecot" OR cc:"dovecot" OR bcc:"dovecot" OR message-id:"dovecot" OR 
body:"dovecot")
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: 53 results in 40 ms
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
Opening DB (RO) 
/var/mail/amfes.com/dmiller/sdbox/xapian-indexes/db_bdcb8e2172fadf4db50b3bc41c5f
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: FLAG=AND
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: FTS Xapian: Query= (subject:"dovecot" OR 
from:"dovecot" OR to:"dovecot" OR cc:"dovecot" OR bcc:"dovecot" OR message-id:"dovecot" OR 
body:"dovecot")
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: 0 results in 12 ms
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
Opening DB (RO) 
/var/mail/amfes.com/dmiller/sdbox/xapian-indexes/db_be25c00241fedf4de00b3bc41c5f
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: FLAG=AND
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: FTS Xapian: Query= (subject:"dovecot" OR 
from:"dovecot" OR to:"dovecot" OR cc:"dovecot" OR bcc:"dovecot" OR message-id:"dovecot" OR 
body:"dovecot")
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: 3 results in 32 ms
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
Opening DB (RO) 
/var/mail/amfes.com/dmiller/sdbox/xapian-indexes/db_a7e75820d9fadf4dd90b3bc41c5f
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: FLAG=AND
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: FTS Xapian: Query= (subject:"dovecot" OR 
from:"dovecot" OR to:"dovecot" OR cc:"dovecot" OR bcc:"dovecot" OR message-id:"dovecot" OR 
body:"dovecot")
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: 0 results in 11 ms
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
Opening DB (RO) 
/var/mail/amfes.com/dmiller/sdbox/xapian-indexes/db_6fa78f2738cbdf4d007b3bc41c5f
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: FLAG=AND
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: FTS Xapian: Query= (subject:"dovecot" OR 
from:"dovecot" OR to:"dovecot" OR cc:"dovecot" OR bcc:"dovecot" OR message-id:"dovecot" OR 
body:"dovecot")
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: 0 results in 21 ms
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
Opening DB (RO) 
/var/mail/amfes.com/dmiller/sdbox/xapian-indexes/db_6ea78f2738cbdf4d007b3bc41c5f
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: FLAG=AND
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: FTS Xapian: Query= (subject:"dovecot" OR 
from:"dovecot" OR to:"dovecot" OR cc:"dovecot" OR bcc:"dovecot" OR message-id:"dovecot" OR 
body:"dovecot")
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: 0 results in 1 ms
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
Opening DB (RO) 
/var/mail/amfes.com/dmiller/sdbox/xapian-indexes/db_f2c3522c5d9b9d4f8847e130c744
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: FLAG=AND
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: FTS Xapian: Query= (subject:"dovecot" OR 
from:"dovecot" OR to:"dovecot" OR cc:"dovecot" OR bcc:"dovecot" OR message-id:"dovecot" OR 
body:"dovecot")
Jun 5 06:02:25 bubba dovecot: 

Re: FTS Xapian

2019-06-09 Thread Joan Moreau via dovecot
Hi 

Are you using the latest git version ? 


WHich part exactly of your logs relates to "virtual folders do not work"
? 


On 2019-06-05 13:08, Daniel Miller via dovecot wrote:


Logs:

Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
Opening DB (RO) 
/var/mail/amfes.com/dmiller/sdbox/xapian-indexes/db_f2857830c70c844e2f1d3bc41c5f
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: FLAG=AND
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: FTS Xapian: Query= (subject:"dovecot" OR 
from:"dovecot" OR to:"dovecot" OR cc:"dovecot" OR bcc:"dovecot" OR message-id:"dovecot" OR 
body:"dovecot")
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: 0 results in 1 ms
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
Opening DB (RO) 
/var/mail/amfes.com/dmiller/sdbox/xapian-indexes/db_78544714f3f1ae5b9b0d3bda95b5
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: FLAG=AND
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: FTS Xapian: Query= (subject:"dovecot" OR 
from:"dovecot" OR to:"dovecot" OR cc:"dovecot" OR bcc:"dovecot" OR message-id:"dovecot" OR 
body:"dovecot")
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: 53 results in 40 ms
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
Opening DB (RO) 
/var/mail/amfes.com/dmiller/sdbox/xapian-indexes/db_bdcb8e2172fadf4db50b3bc41c5f
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: FLAG=AND
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: FTS Xapian: Query= (subject:"dovecot" OR 
from:"dovecot" OR to:"dovecot" OR cc:"dovecot" OR bcc:"dovecot" OR message-id:"dovecot" OR 
body:"dovecot")
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: 0 results in 12 ms
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
Opening DB (RO) 
/var/mail/amfes.com/dmiller/sdbox/xapian-indexes/db_be25c00241fedf4de00b3bc41c5f
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: FLAG=AND
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: FTS Xapian: Query= (subject:"dovecot" OR 
from:"dovecot" OR to:"dovecot" OR cc:"dovecot" OR bcc:"dovecot" OR message-id:"dovecot" OR 
body:"dovecot")
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: 3 results in 32 ms
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
Opening DB (RO) 
/var/mail/amfes.com/dmiller/sdbox/xapian-indexes/db_a7e75820d9fadf4dd90b3bc41c5f
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: FLAG=AND
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: FTS Xapian: Query= (subject:"dovecot" OR 
from:"dovecot" OR to:"dovecot" OR cc:"dovecot" OR bcc:"dovecot" OR message-id:"dovecot" OR 
body:"dovecot")
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: 0 results in 11 ms
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
Opening DB (RO) 
/var/mail/amfes.com/dmiller/sdbox/xapian-indexes/db_6fa78f2738cbdf4d007b3bc41c5f
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: FLAG=AND
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: FTS Xapian: Query= (subject:"dovecot" OR 
from:"dovecot" OR to:"dovecot" OR cc:"dovecot" OR bcc:"dovecot" OR message-id:"dovecot" OR 
body:"dovecot")
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: 0 results in 21 ms
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
Opening DB (RO) 
/var/mail/amfes.com/dmiller/sdbox/xapian-indexes/db_6ea78f2738cbdf4d007b3bc41c5f
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: FLAG=AND
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: FTS Xapian: Query= (subject:"dovecot" OR 
from:"dovecot" OR to:"dovecot" OR cc:"dovecot" OR bcc:"dovecot" OR message-id:"dovecot" OR 
body:"dovecot")
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: 0 results in 1 ms
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
Opening DB (RO) 
/var/mail/amfes.com/dmiller/sdbox/xapian-indexes/db_f2c3522c5d9b9d4f8847e130c744
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: FLAG=AND
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: FTS Xapian: Query= (subject:"dovecot" OR 
from:"dovecot" OR to:"dovecot" OR cc:"dovecot" OR bcc:"dovecot" OR message-id:"dovecot" OR 
body:"dovecot")
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: 43 results in 51 ms
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
Opening DB (RO) 
/var/mail/amfes.com/dmiller/sdbox/xapian-indexes/db_58c26f3b9085134fe04b3bc41c5f
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: 
FTS Xapian: FLAG=AND
Jun 5 06:02:25 bubba dovecot: imap(dmil...@amfes.com)<25877>: FTS Xapian: Query= (subject:"dovecot" OR 
from:"dovecot" OR 

Re: FTS Xapian

2019-06-04 Thread Joan Moreau via dovecot

Hi

Can you post your dovecot conf file and the subset of the log files related 
to the issue ?


thanks


On June 5, 2019 9:29:13 AM Daniel Miller via dovecot  
wrote:



For my primary namespace this is working fine - thanks to the developers!


It also appears to work great for shared folders as well.


But my virtual folders aren't returning results - at least not to the
client. The logs show FTS Xapian opening several DB files and getting
results - but nothing is being returned to client. Is this a config
issue on my side or is this a current limitation of the plugin?
--
Daniel






Further issues on FTS engine

2019-05-20 Thread Joan Moreau via dovecot
Hi, 


Additionally to the long list of problem on the FTS previously
discussed, here a new: 


WHen I reset the indexes, the indexer-worker seems paralelleizing the
indexing (which is good), however, the number available in "ps aux |
grep dove" shows that it does not move: 


dovecot 28549 0.0 0.0 8620 3920 ? S 06:20 0:00 dovecot/indexer [0
clients, 3 requests]
mailuse+ 28550 98.6 0.1 167412 86916 ? R 06:20 5:28
dovecot/indexer-worker [j...@grosjo.net  - 800/37755] 


Looking further, if I put a tracer in teh backend, it treats the *same*
message several times in parallel, and therefore does not move very fast
on the global indexing of the box 

ANy clue ? 


THanks

Re: FTS delays

2019-04-21 Thread Joan Moreau via dovecot

for instance, if I do a search from roundcube, the inbo name is NOT
passed to the backend (which is normal) 


the same search from the command line add the mailbox name ADDITIONALLY
to the mailbox * pointer 


However, passing a search from roudcube ask TWICE the backend  (first
with AND flag, second with OR flag) 


THis is obviously a clear bug form the part calling the backend (even if
the backend may need improvements ! this is really not the point here) 


Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: Get last UID of Sent =
61714
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: Get last UID of Sent =
61714
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: Query: FLAG=AND
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: Query(1/1): add
term(wilcard) : milao
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: Query(2/1): add
term(wilcard) : milao
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: Query(3/1): add
term(wilcard) : milao
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: Query(4/1): add
term(wilcard) : milao
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: Query(5/1): add
term(wilcard) : milao
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: SEARCH_OR
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: MATCH NOT : 0
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: Testing if wildcard
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: Query: set GLOBAL (no
specified header)
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: Query : ( bcc:milao OR
body:milao OR cc:milao OR from:milao OR message-id:milao OR
subject:milao OR to:milao )
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: Query: 0 results in 0 ms
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: Query: FLAG=OR
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: Query(1): add
term(SUBJECT) : milao
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: SEARCH_HEADER
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: MATCH NOT : 0
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: Query(2): add term(TO) :
milao
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: SEARCH_HEADER
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: MATCH NOT : 0
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: Query(3): add term(FROM)
: milao
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: SEARCH_HEADER
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: MATCH NOT : 0
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: Query(4): add term(CC) :
milao
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: SEARCH_HEADER
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: MATCH NOT : 0
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: Query(5): add term(BCC) :
milao
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: SEARCH_HEADER
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: MATCH NOT : 0
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: Testing if wildcard
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: Query : ( bcc:milao ) OR
( cc:milao ) OR ( from:milao ) OR ( subject:milao ) OR ( to:milao )
Apr 21 11:08:39 gjserver dovecot[14251]:
imap(j...@grosjo.net)<15709>: Query: 0 results in 0 ms

On 2019-04-21 11:56, Joan Moreau via dovecot wrote:

Timo, 

A little of logic here : 

1 - the mailbox is passed by dovecot to the backend as a mailbox * pointer  , NOT as a search parameter. 

-> It works properly when entering a search from roundcube or evolution for instance. 

-> therefore this is a clear bug of the command line 

2 - the loop : Actually, the timeout occurs because the dovecot core is DISCARDING the results of the backend and do its own search (ie. in my example , it search fo "milan" in my inbox , which is huge , without even considering the backend results 


-> This is a enormous error.

On 2019-04-21 11:29, Timo Sirainen wrote: It's because you're misunderstanding how the lookup() function works. It gets ALL the search parameters, including the "mailbox inbox". This is intentional, and not a bug. Two reasons being: 

1) The FTS plugin in theory could support indexing/searching any kinds of searches, not just regular word searches. So I didn't want to limit it unnecessari

Re: FTS delays

2019-04-21 Thread Joan Moreau via dovecot
Timo, 

A little of logic here : 


1 - the mailbox is passed by dovecot to the backend as a mailbox *
pointer  , NOT as a search parameter. 


-> It works properly when entering a search from roundcube or evolution
for instance. 

-> therefore this is a clear bug of the command line 


2 - the loop : Actually, the timeout occurs because the dovecot core is
DISCARDING the results of the backend and do its own search (ie. in my
example , it search fo "milan" in my inbox , which is huge , without
even considering the backend results 


-> This is a enormous error.

On 2019-04-21 11:29, Timo Sirainen wrote:

It's because you're misunderstanding how the lookup() function works. It gets ALL the search parameters, including the "mailbox inbox". This is intentional, and not a bug. Two reasons being: 

1) The FTS plugin in theory could support indexing/searching any kinds of searches, not just regular word searches. So I didn't want to limit it unnecessarily. 

2) Especially with "mailbox inbox" this is important when searching from virtual mailboxes. If you configure "All mails in all folders" virtual mailbox, you can do a search in there that restricts which physical mailboxes are matched. In this case the FTS backend can optimize this lookup so it can filter only the physical mailboxes that have matches, leaving the others out. And it can do this in a single query if all the mailboxes are in the same FTS index. 

So again: Your lookup() function needs to be changed to only use those search args that it really wants to search, and ignore the others. Use solr_add_definite_query_args() as the template. 

Also I see now the reason for the timeout problem. It's because you're not setting search_arg->match_always=TRUE. These need to be set for the search args that you're actually using to generate the Xapian query. If it's not set, then Dovecot core doesn't think that the arg was part of the FTS search and it processes it itself. Meaning that it opens all the emails and does the search the slow way, practically making the FTS lookup ignored. 

On 21 Apr 2019, at 19.50, Joan Moreau  wrote: 

No, the parsing is made by dovecot core, that is nothing the backend can do about it. The backend shall *never*  reveive this. (would it be buggy or no) 

PLease, have a look deeper 


And the loop is a very big problem as it times out all the time (and once 
again, this is not in any of the backend  functions)

On 2019-04-21 10:42, Timo Sirainen via dovecot wrote: 
Inbox appears in the list of arguments, because fts_backend_xapian_lookup() is parsing the search args wrong. Not sure about the other issue. 

On 21 Apr 2019, at 19.31, Joan Moreau  wrote: 

For this first point, the problem is that dovecot core sends TWICE the request and "Inbox" appears in the list of arguments ! (inbox shall serve to select teh right mailbox, never sent to the backend) 

And even if this would be solved, the dovecot core loops *after* the backend hs returneds the results 


# doveadm search -u j...@grosjo.net mailbox inbox text milan
doveadm(j...@grosjo.net): Info: Get last UID of INBOX = 315526
doveadm(j...@grosjo.net): Info: Get last UID of INBOX = 315526
doveadm(j...@grosjo.net): Info: Query: FLAG=AND
doveadm(j...@grosjo.net): Info: Query(1): add term(wilcard) : inbox
doveadm(j...@grosjo.net): Info: Query(2): add term(wilcard) : milan
doveadm(j...@grosjo.net): Info: Testing if wildcard
doveadm(j...@grosjo.net): Info: Query: set GLOBAL (no specified header)
doveadm(j...@grosjo.net): Info: Query : ( bcc:inbox OR body:inbox OR cc:inbox 
OR from:inbox OR message-id:inbox OR subject:inbox OR to:inbox ) AND ( 
bcc:milan OR body:milan OR cc:milan OR from:milan OR message-id:milan OR 
subject:milan OR to:milan )
DOVEADM(j...@grosjo.net): INFO: QUERY: 2 RESULTS IN 1 MS // THIS IS WHEN 
BACKEND HAS FOUND RESULTS AND STOPPED
d82b4b0f550d3859364495331209 847
d82b4b0f550d3859364495331209 1569
d82b4b0f550d3859364495331209 2260
d82b4b0f550d3859364495331209 2575
d82b4b0f550d3859364495331209 2811
d82b4b0f550d3859364495331209 2885
d82b4b0f550d3859364495331209 3038
D82B4B0F550D3859364495331209 3121 -> LOOPING FOREVER 

On 2019-04-21 09:57, Timo Sirainen via dovecot wrote: 
On 3 Apr 2019, at 20.30, Joan Moreau via dovecot  wrote: doveadm search -u j...@grosjo.net mailbox inbox text milan

output

doveadm(j...@grosjo.net): Info: Query : ( bcc:inbox OR body:inbox OR cc:inbox 
OR from:inbox OR message-id:inbox OR subject:inbox OR to:inbox OR uid:inbox ) 
AND ( bcc:milan OR body:milan OR cc:milan OR from:milan OR message-id:milan OR 
subject:milan OR to:milan OR uid:milan )

1 - The query is wrong 
That's because fts_backend_xapian_lookup() isn't anywhere close to being correct. Try to copy the logic based on solr_add_definite_query_args().

Re: FTS delays

2019-04-21 Thread Joan Moreau via dovecot

No, the parsing is made by dovecot core, that is nothing the backend can
do about it. The backend shall *never*  reveive this. (would it be buggy
or no) 

PLease, have a look deeper 


And the loop is a very big problem as it times out all the time (and
once again, this is not in any of the backend  functions)

On 2019-04-21 10:42, Timo Sirainen via dovecot wrote:

Inbox appears in the list of arguments, because fts_backend_xapian_lookup() is parsing the search args wrong. Not sure about the other issue. 

On 21 Apr 2019, at 19.31, Joan Moreau  wrote: 

For this first point, the problem is that dovecot core sends TWICE the request and "Inbox" appears in the list of arguments ! (inbox shall serve to select teh right mailbox, never sent to the backend) 

And even if this would be solved, the dovecot core loops *after* the backend hs returneds the results 


# doveadm search -u j...@grosjo.net mailbox inbox text milan
doveadm(j...@grosjo.net): Info: Get last UID of INBOX = 315526
doveadm(j...@grosjo.net): Info: Get last UID of INBOX = 315526
doveadm(j...@grosjo.net): Info: Query: FLAG=AND
doveadm(j...@grosjo.net): Info: Query(1): add term(wilcard) : inbox
doveadm(j...@grosjo.net): Info: Query(2): add term(wilcard) : milan
doveadm(j...@grosjo.net): Info: Testing if wildcard
doveadm(j...@grosjo.net): Info: Query: set GLOBAL (no specified header)
doveadm(j...@grosjo.net): Info: Query : ( bcc:inbox OR body:inbox OR cc:inbox 
OR from:inbox OR message-id:inbox OR subject:inbox OR to:inbox ) AND ( 
bcc:milan OR body:milan OR cc:milan OR from:milan OR message-id:milan OR 
subject:milan OR to:milan )
DOVEADM(j...@grosjo.net): INFO: QUERY: 2 RESULTS IN 1 MS // THIS IS WHEN 
BACKEND HAS FOUND RESULTS AND STOPPED
d82b4b0f550d3859364495331209 847
d82b4b0f550d3859364495331209 1569
d82b4b0f550d3859364495331209 2260
d82b4b0f550d3859364495331209 2575
d82b4b0f550d3859364495331209 2811
d82b4b0f550d3859364495331209 2885
d82b4b0f550d3859364495331209 3038
D82B4B0F550D3859364495331209 3121 -> LOOPING FOREVER 

On 2019-04-21 09:57, Timo Sirainen via dovecot wrote: 
On 3 Apr 2019, at 20.30, Joan Moreau via dovecot  wrote: doveadm search -u j...@grosjo.net mailbox inbox text milan

output

doveadm(j...@grosjo.net): Info: Query : ( bcc:inbox OR body:inbox OR cc:inbox 
OR from:inbox OR message-id:inbox OR subject:inbox OR to:inbox OR uid:inbox ) 
AND ( bcc:milan OR body:milan OR cc:milan OR from:milan OR message-id:milan OR 
subject:milan OR to:milan OR uid:milan )

1 - The query is wrong 
That's because fts_backend_xapian_lookup() isn't anywhere close to being correct. Try to copy the logic based on solr_add_definite_query_args().

Re: FTS delays

2019-04-21 Thread Joan Moreau via dovecot

Antoher example so you understand how may understand the bug in dovecote
core : 

# doveadm search -u j...@grosjo.net mailbox SENT text milan 


doveadm(j...@grosjo.net): Info: Get last UID of Sent = 61707 -> CORRECTLY
ASSIGNED THE PROPER MAILBOX TO THE BACK END
doveadm(j...@grosjo.net): Info: Get last UID of Sent = 61707
doveadm(j...@grosjo.net): Info: Query: FLAG=AND
doveadm(j...@grosjo.net): Info: Query(1): add term(wilcard) : Sent -> WHY
IS "SENT" AMONG THE SERACH PARAMETERS ???
doveadm(j...@grosjo.net): Info: Query(2): add term(wilcard) : milan
doveadm(j...@grosjo.net): Info: Testing if wildcard
doveadm(j...@grosjo.net): Info: Query: set GLOBAL (no specified header)
doveadm(j...@grosjo.net): Info: Query : ( bcc:milan OR body:milan OR
cc:milan OR from:milan OR message-id:milan OR subject:milan OR to:milan
) AND ( bcc:sent OR body:sent OR cc:sent OR from:sent OR message-id:sent
OR subject:sent OR to:sent )
doveadm(j...@grosjo.net): Info: Query: 7 results in 71 ms 

(AND SAME LOOP) 


In this example, the "Sent" shall *never*  be passed as argument to the
backend (xapian, solr or any other), only the mailbox reference.
However, it appears in the search parameters 


On 2019-04-21 10:31, Joan Moreau via dovecot wrote:

For this first point, the problem is that dovecot core sends TWICE the request and "Inbox" appears in the list of arguments ! (inbox shall serve to select teh right mailbox, never sent to the backend) 

And even if this would be solved, the dovecot core loops *after* the backend hs returneds the results 


# doveadm search -u j...@grosjo.net mailbox inbox text milan
doveadm(j...@grosjo.net): Info: Get last UID of INBOX = 315526
doveadm(j...@grosjo.net): Info: Get last UID of INBOX = 315526
doveadm(j...@grosjo.net): Info: Query: FLAG=AND
doveadm(j...@grosjo.net): Info: Query(1): add term(wilcard) : inbox
doveadm(j...@grosjo.net): Info: Query(2): add term(wilcard) : milan
doveadm(j...@grosjo.net): Info: Testing if wildcard
doveadm(j...@grosjo.net): Info: Query: set GLOBAL (no specified header)
doveadm(j...@grosjo.net): Info: Query : ( bcc:inbox OR body:inbox OR cc:inbox 
OR from:inbox OR message-id:inbox OR subject:inbox OR to:inbox ) AND ( 
bcc:milan OR body:milan OR cc:milan OR from:milan OR message-id:milan OR 
subject:milan OR to:milan )
DOVEADM(j...@grosjo.net): INFO: QUERY: 2 RESULTS IN 1 MS // THIS IS WHEN 
BACKEND HAS FOUND RESULTS AND STOPPED
d82b4b0f550d3859364495331209 847
d82b4b0f550d3859364495331209 1569
d82b4b0f550d3859364495331209 2260
d82b4b0f550d3859364495331209 2575
d82b4b0f550d3859364495331209 2811
d82b4b0f550d3859364495331209 2885
d82b4b0f550d3859364495331209 3038
D82B4B0F550D3859364495331209 3121 -> LOOPING FOREVER 

On 2019-04-21 09:57, Timo Sirainen via dovecot wrote: 
On 3 Apr 2019, at 20.30, Joan Moreau via dovecot  wrote: doveadm search -u j...@grosjo.net mailbox inbox text milan

output

doveadm(j...@grosjo.net): Info: Query : ( bcc:inbox OR body:inbox OR cc:inbox 
OR from:inbox OR message-id:inbox OR subject:inbox OR to:inbox OR uid:inbox ) 
AND ( bcc:milan OR body:milan OR cc:milan OR from:milan OR message-id:milan OR 
subject:milan OR to:milan OR uid:milan )

1 - The query is wrong 
That's because fts_backend_xapian_lookup() isn't anywhere close to being correct. Try to copy the logic based on solr_add_definite_query_args().

Re: FTS delays

2019-04-21 Thread Joan Moreau via dovecot

For this first point, the problem is that dovecot core sends TWICE the
request and "Inbox" appears in the list of arguments ! (inbox shall
serve to select teh right mailbox, never sent to the backend) 


And even if this would be solved, the dovecot core loops *after* the
backend hs returneds the results 


# doveadm search -u j...@grosjo.net mailbox inbox text milan
doveadm(j...@grosjo.net): Info: Get last UID of INBOX = 315526
doveadm(j...@grosjo.net): Info: Get last UID of INBOX = 315526
doveadm(j...@grosjo.net): Info: Query: FLAG=AND
doveadm(j...@grosjo.net): Info: Query(1): add term(wilcard) : inbox
doveadm(j...@grosjo.net): Info: Query(2): add term(wilcard) : milan
doveadm(j...@grosjo.net): Info: Testing if wildcard
doveadm(j...@grosjo.net): Info: Query: set GLOBAL (no specified header)
doveadm(j...@grosjo.net): Info: Query : ( bcc:inbox OR body:inbox OR
cc:inbox OR from:inbox OR message-id:inbox OR subject:inbox OR to:inbox
) AND ( bcc:milan OR body:milan OR cc:milan OR from:milan OR
message-id:milan OR subject:milan OR to:milan )
DOVEADM(j...@grosjo.net): INFO: QUERY: 2 RESULTS IN 1 MS // THIS IS WHEN
BACKEND HAS FOUND RESULTS AND STOPPED
d82b4b0f550d3859364495331209 847
d82b4b0f550d3859364495331209 1569
d82b4b0f550d3859364495331209 2260
d82b4b0f550d3859364495331209 2575
d82b4b0f550d3859364495331209 2811
d82b4b0f550d3859364495331209 2885
d82b4b0f550d3859364495331209 3038
D82B4B0F550D3859364495331209 3121 -> LOOPING FOREVER 


On 2019-04-21 09:57, Timo Sirainen via dovecot wrote:

On 3 Apr 2019, at 20.30, Joan Moreau via dovecot  wrote: 


doveadm search -u j...@grosjo.net mailbox inbox text milan
output

doveadm(j...@grosjo.net): Info: Query : ( bcc:inbox OR body:inbox OR cc:inbox 
OR from:inbox OR message-id:inbox OR subject:inbox OR to:inbox OR uid:inbox ) 
AND ( bcc:milan OR body:milan OR cc:milan OR from:milan OR message-id:milan OR 
subject:milan OR to:milan OR uid:milan )

1 - The query is wrong


That's because fts_backend_xapian_lookup() isn't anywhere close to being 
correct. Try to copy the logic based on solr_add_definite_query_args().

Re: FTS delays

2019-04-20 Thread Joan Moreau via dovecot
I have no idea how to use git-bitsec 


On 2019-04-15 15:31, Josef 'Jeff' Sipek wrote:


On Sun, Apr 14, 2019 at 21:09:54 +0800, Joan Moreau wrote:
... 


THe "loop" part seems the most urgent : It breaks everything (search
timeout 100% of the time)


Any luck with git-bisect?

Jeff.

On 2019-04-06 09:56, Joan Moreau via dovecot wrote:

For the point 1, this is not "suboptimal", it is plain wrong (results are damn 
wrong ! and this is not related to the backend, but the FTS logic in Dovecot core)

For the point 2 , this has been discussed already numerous times but without action. The dovecot core shall be the one re-submitting the emails to scan, not the backend to try to figure out where and which are the emails to be re-scaned 

For the point 3, I will do a bit of research in the existing code and will get back to you 

For the point 4, this is random. FTS backend (xapian, lucene, solr, whatever..) returns X, then dovecot core choose to select only Y emails. THis is a clear bug. 

On 2019-04-05 20:08, Josef 'Jeff' Sipek via dovecot wrote: 
On Fri, Apr 05, 2019 at 19:33:57 +0800, Joan Moreau via dovecot wrote: Hi 

If you plan to fix the FTS part of Dovecot, I will be very gratefull. 
I'm trying to figure out what is causing the 3rd issue you listed, so we can

decide how severe it is and therefore how quickly it needs to be fixed.  At
the moment we are unable to reproduce it, and therefore we cannot fix it.

Not sure this is related to any specific commit but rahter the overall
design 
Ok.


The list of bugs so far 


1 - Double call to fts plugins with inconsistent parameter (first call
diferent from second call for the same request) 
Understood.  It is my understanding that this is simply suboptimal rather

than causing crashes/etc.

2 - "Rescan" features for now consists of deleting indexes. SHall be
resending emails to rescan to the fts plugin instead 
I'm not sure I follow.  The rescan operation is invoked on the fts backend

and it is up to the implementation to somehow ensure that after it is done
the fts index is up to date.  The easiest way to implement it is to simply
delete the fts index and re-index all the mails.  That is what currently
happens in the solr backend.

The lucene fts backend does a more complicated matching of the fts index
with the emails.  Finally, the deprecated squat backend seem to ignore the
rescan requests (its rescan vfunc is NULL).

3 - the loop when body search (just do a "doveadm search -u user@domain
mailbox inbox text whatevertexte") 


Refer to my email to Timo on 2019-04-03 18:30 on the same thread for bug
details 

(especially the loop) 
This seems to be the most important of the 4 issues you listed, so I'd like

to focus on this one for now.

As I mentioned, we cannot reproduce this ourselves.  So, we need your help
to narrow things down.  Therefore, can you give us the commit hashes of
revisions that you know are good and which are bad?  You can use git-bisect
to narrow the range down.

4 - Most notably, I notice that header search usually does not care
about fts plugin (even with fts_enforced) and rely on some internal
search , which si total non-sense 
You're right, that doesn't seem to make sense.  Can you provide a test case?


Jeff.

Let me know how can I help on thos 4 points 


On 2019-04-05 18:37, Josef 'Jeff' Sipek wrote:

On Fri, Apr 05, 2019 at 17:45:36 +0800, Joan Moreau wrote: 

I am on master (very latest) 

No clue exactly when this problem appears, but 


1 - the "request twice the fts plugin instead of once" issue has always
been there (since my first RC release of fts-xapian) 
Ok, good to know.


2 - the body/text loop has appeared recently (maybe during the month of
March) 
Our testing doesn't seem to be able to reproduce this.  Can you try to

git-bisect this to find which commit broke it?

Thanks,

Jeff.

On 2019-04-05 16:36, Josef 'Jeff' Sipek via dovecot wrote:

On Wed, Apr 03, 2019 at 19:02:52 +0800, Joan Moreau via dovecot wrote: 

issue seems in the Git version : 
Which git revision?


Before you updated to the broken revision, which revision/version were you
running?

Can you try it with 5f6e39c50ec79ba8847b2fdb571a9152c71cd1b6 (the commit
just before the fts_enforced=body introduction)?  That's the only recent fts
change.

Thanks,

Jeff.

On 2019-04-03 18:58, @lbutlr via dovecot wrote:

On 3 Apr 2019, at 04:30, Joan Moreau via dovecot  wrote: 

doveadm search -u j...@grosjo.net mailbox inbox text milan 
Did that search over my list mail and got 83 results, not able to duplicate your issue.


What version of dovecot and have you tried to reindex?

dovecot-2.3.5.1 here.

Re: FTS delays

2019-04-14 Thread Joan Moreau via dovecot

I have tried to spend some time of understanding the logic (if any !) of
the fts part 


Honestly, the one who created this mess shall be the one to fix it, or
one shall refactor it totally. 

Basically, the fts "core" should be able to do 

- select the backend according to conf file 

- send new emails/maiblox to backend 

- send teh ID of the emails to be removed 

- resend an entire mailbox ('rescan') 


- send the search parameters (from client) to backend and return the
email to front end based on backend results (and NOTHING more) 

Today, the fts part is plain wong and must be totally reviewed. 


I do not have the time but I can participate in testing if someone is
ready to roll up its sleeves on teh mater 


THe "loop" part seems the most urgent : It breaks everything (search
timeout 100% of the time) 


On 2019-04-06 09:56, Joan Moreau via dovecot wrote:


For the point 1, this is not "suboptimal", it is plain wrong (results are damn 
wrong ! and this is not related to the backend, but the FTS logic in Dovecot core)

For the point 2 , this has been discussed already numerous times but without action. The dovecot core shall be the one re-submitting the emails to scan, not the backend to try to figure out where and which are the emails to be re-scaned 

For the point 3, I will do a bit of research in the existing code and will get back to you 

For the point 4, this is random. FTS backend (xapian, lucene, solr, whatever..) returns X, then dovecot core choose to select only Y emails. THis is a clear bug. 

On 2019-04-05 20:08, Josef 'Jeff' Sipek via dovecot wrote: 
On Fri, Apr 05, 2019 at 19:33:57 +0800, Joan Moreau via dovecot wrote: Hi 

If you plan to fix the FTS part of Dovecot, I will be very gratefull. 
I'm trying to figure out what is causing the 3rd issue you listed, so we can

decide how severe it is and therefore how quickly it needs to be fixed.  At
the moment we are unable to reproduce it, and therefore we cannot fix it.

Not sure this is related to any specific commit but rahter the overall
design 
Ok.


The list of bugs so far 


1 - Double call to fts plugins with inconsistent parameter (first call
diferent from second call for the same request) 
Understood.  It is my understanding that this is simply suboptimal rather

than causing crashes/etc.

2 - "Rescan" features for now consists of deleting indexes. SHall be
resending emails to rescan to the fts plugin instead 
I'm not sure I follow.  The rescan operation is invoked on the fts backend

and it is up to the implementation to somehow ensure that after it is done
the fts index is up to date.  The easiest way to implement it is to simply
delete the fts index and re-index all the mails.  That is what currently
happens in the solr backend.

The lucene fts backend does a more complicated matching of the fts index
with the emails.  Finally, the deprecated squat backend seem to ignore the
rescan requests (its rescan vfunc is NULL).

3 - the loop when body search (just do a "doveadm search -u user@domain
mailbox inbox text whatevertexte") 


Refer to my email to Timo on 2019-04-03 18:30 on the same thread for bug
details 

(especially the loop) 
This seems to be the most important of the 4 issues you listed, so I'd like

to focus on this one for now.

As I mentioned, we cannot reproduce this ourselves.  So, we need your help
to narrow things down.  Therefore, can you give us the commit hashes of
revisions that you know are good and which are bad?  You can use git-bisect
to narrow the range down.

4 - Most notably, I notice that header search usually does not care
about fts plugin (even with fts_enforced) and rely on some internal
search , which si total non-sense 
You're right, that doesn't seem to make sense.  Can you provide a test case?


Jeff.

Let me know how can I help on thos 4 points 


On 2019-04-05 18:37, Josef 'Jeff' Sipek wrote:

On Fri, Apr 05, 2019 at 17:45:36 +0800, Joan Moreau wrote: 

I am on master (very latest) 

No clue exactly when this problem appears, but 


1 - the "request twice the fts plugin instead of once" issue has always
been there (since my first RC release of fts-xapian) 
Ok, good to know.


2 - the body/text loop has appeared recently (maybe during the month of
March) 
Our testing doesn't seem to be able to reproduce this.  Can you try to

git-bisect this to find which commit broke it?

Thanks,

Jeff.

On 2019-04-05 16:36, Josef 'Jeff' Sipek via dovecot wrote:

On Wed, Apr 03, 2019 at 19:02:52 +0800, Joan Moreau via dovecot wrote: 

issue seems in the Git version : 
Which git revision?


Before you updated to the broken revision, which revision/version were you
running?

Can you try it with 5f6e39c50ec79ba8847b2fdb571a9152c71cd1b6 (the commit
just before the fts_enforced=body introduction)?  That's the only recent fts
change.

Thanks,

Jeff.

On 2019-04-03 18:58, @lbutlr via dovecot wrote:

On 3 Apr 2019, at 04:30, Joan Moreau via dovecot  w

Re: FTS delays

2019-04-05 Thread Joan Moreau via dovecot

For the point 1, this is not "suboptimal", it is plain wrong (results
are damn wrong ! and this is not related to the backend, but the FTS
logic in Dovecot core)

For the point 2 , this has been discussed already numerous times but
without action. The dovecot core shall be the one re-submitting the
emails to scan, not the backend to try to figure out where and which are
the emails to be re-scaned 


For the point 3, I will do a bit of research in the existing code and
will get back to you 


For the point 4, this is random. FTS backend (xapian, lucene, solr,
whatever..) returns X, then dovecot core choose to select only Y emails.
THis is a clear bug. 


On 2019-04-05 20:08, Josef 'Jeff' Sipek via dovecot wrote:

On Fri, Apr 05, 2019 at 19:33:57 +0800, Joan Moreau via dovecot wrote: 

Hi 


If you plan to fix the FTS part of Dovecot, I will be very gratefull.


I'm trying to figure out what is causing the 3rd issue you listed, so we can
decide how severe it is and therefore how quickly it needs to be fixed.  At
the moment we are unable to reproduce it, and therefore we cannot fix it.


Not sure this is related to any specific commit but rahter the overall
design


Ok.

The list of bugs so far 


1 - Double call to fts plugins with inconsistent parameter (first call
diferent from second call for the same request)


Understood.  It is my understanding that this is simply suboptimal rather
than causing crashes/etc.


2 - "Rescan" features for now consists of deleting indexes. SHall be
resending emails to rescan to the fts plugin instead


I'm not sure I follow.  The rescan operation is invoked on the fts backend
and it is up to the implementation to somehow ensure that after it is done
the fts index is up to date.  The easiest way to implement it is to simply
delete the fts index and re-index all the mails.  That is what currently
happens in the solr backend.

The lucene fts backend does a more complicated matching of the fts index
with the emails.  Finally, the deprecated squat backend seem to ignore the
rescan requests (its rescan vfunc is NULL).


3 - the loop when body search (just do a "doveadm search -u user@domain
mailbox inbox text whatevertexte") 


Refer to my email to Timo on 2019-04-03 18:30 on the same thread for bug
details 


(especially the loop)


This seems to be the most important of the 4 issues you listed, so I'd like
to focus on this one for now.

As I mentioned, we cannot reproduce this ourselves.  So, we need your help
to narrow things down.  Therefore, can you give us the commit hashes of
revisions that you know are good and which are bad?  You can use git-bisect
to narrow the range down.


4 - Most notably, I notice that header search usually does not care
about fts plugin (even with fts_enforced) and rely on some internal
search , which si total non-sense


You're right, that doesn't seem to make sense.  Can you provide a test case?

Jeff.

Let me know how can I help on thos 4 points 


On 2019-04-05 18:37, Josef 'Jeff' Sipek wrote:

On Fri, Apr 05, 2019 at 17:45:36 +0800, Joan Moreau wrote: 

I am on master (very latest) 

No clue exactly when this problem appears, but 


1 - the "request twice the fts plugin instead of once" issue has always
been there (since my first RC release of fts-xapian) 
Ok, good to know.


2 - the body/text loop has appeared recently (maybe during the month of
March) 
Our testing doesn't seem to be able to reproduce this.  Can you try to

git-bisect this to find which commit broke it?

Thanks,

Jeff.

On 2019-04-05 16:36, Josef 'Jeff' Sipek via dovecot wrote:

On Wed, Apr 03, 2019 at 19:02:52 +0800, Joan Moreau via dovecot wrote: 

issue seems in the Git version : 
Which git revision?


Before you updated to the broken revision, which revision/version were you
running?

Can you try it with 5f6e39c50ec79ba8847b2fdb571a9152c71cd1b6 (the commit
just before the fts_enforced=body introduction)?  That's the only recent fts
change.

Thanks,

Jeff.

On 2019-04-03 18:58, @lbutlr via dovecot wrote:

On 3 Apr 2019, at 04:30, Joan Moreau via dovecot  wrote: 

doveadm search -u j...@grosjo.net mailbox inbox text milan 
Did that search over my list mail and got 83 results, not able to duplicate your issue.


What version of dovecot and have you tried to reindex?

dovecot-2.3.5.1 here.

Re: FTS delays

2019-04-05 Thread Joan Moreau via dovecot
Hi 


If you plan to fix the FTS part of Dovecot, I will be very gratefull.
Not sure this is related to any specific commit but rahter the overall
design 

The list of bugs so far 


1 - Double call to fts plugins with inconsistent parameter (first call
diferent from second call for the same request) 


2 - "Rescan" features for now consists of deleting indexes. SHall be
resending emails to rescan to the fts plugin instead 


3 - the loop when body search (just do a "doveadm search -u user@domain
mailbox inbox text whatevertexte") 


Refer to my email to Timo on 2019-04-03 18:30 on the same thread for bug
details 

(especially the loop) 


4 - Most notably, I notice that header search usually does not care
about fts plugin (even with fts_enforced) and rely on some internal
search , which si total non-sense 

Let me know how can I help on thos 4 points 


On 2019-04-05 18:37, Josef 'Jeff' Sipek wrote:

On Fri, Apr 05, 2019 at 17:45:36 +0800, Joan Moreau wrote: 

I am on master (very latest) 

No clue exactly when this problem appears, but 


1 - the "request twice the fts plugin instead of once" issue has always
been there (since my first RC release of fts-xapian)


Ok, good to know.


2 - the body/text loop has appeared recently (maybe during the month of
March)


Our testing doesn't seem to be able to reproduce this.  Can you try to
git-bisect this to find which commit broke it?

Thanks,

Jeff.

On 2019-04-05 16:36, Josef 'Jeff' Sipek via dovecot wrote:

On Wed, Apr 03, 2019 at 19:02:52 +0800, Joan Moreau via dovecot wrote: 

issue seems in the Git version : 
Which git revision?


Before you updated to the broken revision, which revision/version were you
running?

Can you try it with 5f6e39c50ec79ba8847b2fdb571a9152c71cd1b6 (the commit
just before the fts_enforced=body introduction)?  That's the only recent fts
change.

Thanks,

Jeff.

On 2019-04-03 18:58, @lbutlr via dovecot wrote:

On 3 Apr 2019, at 04:30, Joan Moreau via dovecot  wrote: 

doveadm search -u j...@grosjo.net mailbox inbox text milan 
Did that search over my list mail and got 83 results, not able to duplicate your issue.


What version of dovecot and have you tried to reindex?

dovecot-2.3.5.1 here.

Re: FTS delays

2019-04-05 Thread Joan Moreau via dovecot
I am on master (very latest) 

No clue exactly when this problem appears, but 


1 - the "request twice the fts plugin instead of once" issue has always
been there (since my first RC release of fts-xapian) 


2 - the body/text loop has appeared recently (maybe during the month of
March) 


On 2019-04-05 16:36, Josef 'Jeff' Sipek via dovecot wrote:

On Wed, Apr 03, 2019 at 19:02:52 +0800, Joan Moreau via dovecot wrote: 


issue seems in the Git version :


Which git revision?

Before you updated to the broken revision, which revision/version were you
running?

Can you try it with 5f6e39c50ec79ba8847b2fdb571a9152c71cd1b6 (the commit
just before the fts_enforced=body introduction)?  That's the only recent fts
change.

Thanks,

Jeff.

On 2019-04-03 18:58, @lbutlr via dovecot wrote:

On 3 Apr 2019, at 04:30, Joan Moreau via dovecot  wrote: 

doveadm search -u j...@grosjo.net mailbox inbox text milan 
Did that search over my list mail and got 83 results, not able to duplicate your issue.


What version of dovecot and have you tried to reindex?

dovecot-2.3.5.1 here.

Re: FTS delays

2019-04-03 Thread Joan Moreau via dovecot
issue seems in the Git version : 

FTS search in teh body ends up with looping 

Other search call twice the FTS plugin (for no reason) 


On 2019-04-03 18:58, @lbutlr via dovecot wrote:

On 3 Apr 2019, at 04:30, Joan Moreau via dovecot  wrote: 


doveadm search -u j...@grosjo.net mailbox inbox text milan


Did that search over my list mail and got 83 results, not able to duplicate 
your issue.

What version of dovecot and have you tried to reindex?

dovecot-2.3.5.1 here.

Re: FTS delays

2019-04-03 Thread Joan Moreau via dovecot
Example from real life 

From Roubdcube, I serach "milan" in full message (body & headers) 


Logs : 


Apr 3 10:24:01 gjserver dovecot[29778]:
imap(j...@grosjo.net)<30311><4pACp52FfCF/AAAB>: Query : ( bcc:milan OR
body:milan OR cc:milan OR from:milan OR message-id:milan OR
subject:milan OR to:milan OR uid:milan )
Apr 3 10:24:01 gjserver dovecot[29778]:
imap(j...@grosjo.net)<30311><4pACp52FfCF/AAAB>: Query: 81 results in 2 ms


81 results is correct 

but Roundcube times out 

from command line, I do : 

doveadm search -u j...@grosjo.net mailbox inbox text milan 

output 


doveadm(j...@grosjo.net): Info: Query : ( bcc:inbox OR body:inbox OR
cc:inbox OR from:inbox OR message-id:inbox OR subject:inbox OR to:inbox
OR uid:inbox ) AND ( bcc:milan OR body:milan OR cc:milan OR from:milan
OR message-id:milan OR subject:milan OR to:milan OR uid:milan )
doveadm(j...@grosjo.net): Info: Query: 1 results in 1 ms
d82b4b0f550d3859364495331209 847
d82b4b0f550d3859364495331209 1569
d82b4b0f550d3859364495331209 2260
d82b4b0f550d3859364495331209 2575
d82b4b0f550d3859364495331209 2811
d82b4b0f550d3859364495331209 2885
d82b4b0f550d3859364495331209 3038
d82b4b0f550d3859364495331209 3121
d82b4b0f550d3859364495331209 3170 

1 - The query is wrong 

2 - teh last line "d8...209 3170" gets repeated for ages 


On 2019-04-02 16:30, Timo Sirainen wrote:

On 2 Apr 2019, at 6.38, Joan Moreau via dovecot  wrote: 


Further on this topic:

When choosing any headers in the search box, dovecot core calls the plugin 
TWICE (and returns the results quickly, but not immediatly after getting the 
IDs from the plugins)

When choosing the BODY search, dovecot core calls the plugin ONCE (and never 
returns) (whereas the plugins returns properly the IDs)


If we simplify this, do you mean this calls it once and is fast:

doveadm search -u user@domain mailbox inbox body helloworld

But this calls twice and is slow:

doveadm search -u user@domain mailbox inbox text helloworld

And what about searching e.g. subject? :

doveadm search -u user@domain mailbox inbox subject helloworld

And does the slowness depend on whether there were any matches or not?


This is based on GIT version. (previous versions were working properly)


Previous versions were fast? Do you mean v2.3.5?

Re: FTS delays

2019-04-01 Thread Joan Moreau via dovecot
Further on this topic: 


When choosing any headers in the search box, dovecot core calls the
plugin TWICE (and returns the results quickly, but not immediatly after
getting the IDs from the plugins) 


When choosing the BODY search, dovecot core calls the plugin ONCE (and
never returns) (whereas the plugins returns properly the IDs) 

This is based on GIT version. (previous versions were working properly) 

Looking for feedback 


Thank you

On 2019-03-30 21:48, Joan Moreau wrote:

it is already on 

On March 31, 2019 03:47:52 Aki Tuomi via dovecot  wrote: 

On 30 March 2019 21:37 Joan Moreau via dovecot  wrote: 

Hi 

When I do a FTS search (using Xapian plugin) in the BODY part, the plugins returns the matching IDs within few milliseconds (as seen in the log). 

However, roundcube (connected on dovecot) takes ages to show (headers only vie IMAP) the few results (I tested with a matching requests of 9 emails) 

What could be the root cause ? 

Thank you 

does it help if you set 

plugin { 
fts_enforced=yes 
} 


---
Aki Tuomi

Re: FTS delays

2019-03-30 Thread Joan Moreau via dovecot

it is already on

On March 31, 2019 03:47:52 Aki Tuomi via dovecot  wrote:



On 30 March 2019 21:37 Joan Moreau via dovecot  wrote:





Hi

When I do a FTS search (using Xapian plugin) in the BODY part, the plugins 
returns the matching IDs within few milliseconds (as seen in the log).


However, roundcube (connected on dovecot) takes ages to show (headers only 
vie IMAP) the few results (I tested with a matching requests of 9 emails)


What could be the root cause ?

Thank you


does it help if you set

plugin {
  fts_enforced=yes
}
---
Aki Tuomi




FTS delays

2019-03-30 Thread Joan Moreau via dovecot
Hi 


When I do a FTS search (using Xapian plugin) in the BODY part, the
plugins returns the matching IDs within few milliseconds (as seen in the
log). 


However, roundcube (connected on dovecot) takes ages to show (headers
only vie IMAP) the few results (I tested with a matching requests of 9
emails) 

What could be the root cause ? 


Thank you

Re: [grosjo/fts-xapian] `doveadm fts rescan` removes all indices (#15)

2019-02-18 Thread Joan Moreau via dovecot

Can you clarify the piece of code or give an example on how to  "Get
list of UIDs for all mails in each folder " and how to get the "list of
all folder/mailbox"  from a *backend input ?

On 2019-02-17 14:52, Aki Tuomi wrote:


Not really, as the steps outlined by Timo would not get done.

Aki

On 17 February 2019 at 10:56 Joan Moreau via dovecot  
wrote:

In such case, as long as the API is not upgraded, should 

doveadm index -A -q \* 

be considered a replacement of 


doveadm fts rescan

On 2019-02-14 16:24, Timo Sirainen via dovecot wrote:

Hi, 

The rescan() function is a bit badly designed. Currently what you could do what fts-lucene does and: 
- Get list of UIDs for all mails in each folder 
- If Xapian has UID that doesn't exist -> delete it from Xapian 
- If UID is missing from Xapian -> expunge the rest of the UIDs in that folder, so the next indexing will cause them to be indexed 

The expunging of rest of the mails is rather ugly, yes.. A better API would be if backend simply had a way to iterate all mails in the index, preferrably sorted by folder. Then a more generic code could go through them and expunge the necessary mails and index the missing mails. Although not all FTS backends support indexing in the middle. Anyway, we don't really have time to implement this new API soon. 

I'm not sure if this is a big problem though. I don't think most people running FTS have ever run rescan. 

On 8 Feb 2019, at 9.54, Joan Moreau via dovecot  wrote: 

Hi, 

THis is a core problem in Dovecot in my understanding. 

In my opinion, the rescan in dovecot should send to the FTS plugin the list of "supposedly" indexed emails (UID), and the plugin shall purge the redundant UID (i..e UID present in the index but not in the list sent by dovecot) and send back the list of UID not in its indexes to dovecot, so Dovect can send one by one the missing emails 

WHat do you think ? 

 Original Message  


SUBJECT:
[grosjo/fts-xapian] `doveadm fts rescan` removes all indices (#15)

DATE:
2019-02-08 08:28

FROM:
Leonard Lausen 

TO:
grosjo/fts-xapian 

CC:
Subscribed 

REPLY-TO:
grosjo/fts-xapian 


doveadm fts rescan -A deletes all indices, ie. all folders and files in the xapian-indexes are deleted. However, according to man doveadm fts, the rescan command should only 


Scan what mails exist in the full text search index and compare those to what
actually exist in mailboxes. This removes mails from the index that have already
been expunged and makes sure that the next doveadm index will index all the
missing mails (if any). 

Deleting all indices does not seem to be the intended action, especially as constructing the index anew may take very long on large mailboxes. 


--
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub [1 [1]], or mute the thread [2].  


Links:
--
[1] https://github.com/grosjo/fts-xapian/issues/15
[2]
https://github.com/notifications/unsubscribe-auth/ACLmB9OB-7GaKIvhNc8sCgi7KQTrjNnoks5vLScugaJpZM4auCWp



Links:
--
[1] https://github.com/grosjo/fts-xapian/issues/15

Re: [grosjo/fts-xapian] `doveadm fts rescan` removes all indices (#15)

2019-02-17 Thread Joan Moreau via dovecot
In such case, as long as the API is not upgraded, should 

doveadm index -A -q \* 

be considered a replacement of 


doveadm fts rescan

On 2019-02-14 16:24, Timo Sirainen via dovecot wrote:

Hi, 

The rescan() function is a bit badly designed. Currently what you could do what fts-lucene does and: 
- Get list of UIDs for all mails in each folder 
- If Xapian has UID that doesn't exist -> delete it from Xapian 
- If UID is missing from Xapian -> expunge the rest of the UIDs in that folder, so the next indexing will cause them to be indexed 

The expunging of rest of the mails is rather ugly, yes.. A better API would be if backend simply had a way to iterate all mails in the index, preferrably sorted by folder. Then a more generic code could go through them and expunge the necessary mails and index the missing mails. Although not all FTS backends support indexing in the middle. Anyway, we don't really have time to implement this new API soon. 

I'm not sure if this is a big problem though. I don't think most people running FTS have ever run rescan. 

On 8 Feb 2019, at 9.54, Joan Moreau via dovecot  wrote: 

Hi, 

THis is a core problem in Dovecot in my understanding. 

In my opinion, the rescan in dovecot should send to the FTS plugin the list of "supposedly" indexed emails (UID), and the plugin shall purge the redundant UID (i..e UID present in the index but not in the list sent by dovecot) and send back the list of UID not in its indexes to dovecot, so Dovect can send one by one the missing emails 

WHat do you think ? 

 Original Message  


SUBJECT:
[grosjo/fts-xapian] `doveadm fts rescan` removes all indices (#15)

DATE:
2019-02-08 08:28

FROM:
Leonard Lausen 

TO:
grosjo/fts-xapian 

CC:
Subscribed 

REPLY-TO:
grosjo/fts-xapian 


doveadm fts rescan -A deletes all indices, ie. all folders and files in the xapian-indexes are deleted. However, according to man doveadm fts, the rescan command should only 


Scan what mails exist in the full text search index and compare those to what
actually exist in mailboxes. This removes mails from the index that have already
been expunged and makes sure that the next doveadm index will index all the
missing mails (if any). 

Deleting all indices does not seem to be the intended action, especially as constructing the index anew may take very long on large mailboxes. 


--
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub [1], or mute the thread [2].



Links:
--
[1] https://github.com/grosjo/fts-xapian/issues/15
[2]
https://github.com/notifications/unsubscribe-auth/ACLmB9OB-7GaKIvhNc8sCgi7KQTrjNnoks5vLScugaJpZM4auCWp

Re: Fwd: [grosjo/fts-xapian] `doveadm fts rescan` removes all indices (#15)

2019-02-13 Thread Joan Moreau via dovecot
Hi 


Anyone ?

On 2019-02-08 08:54, Joan Moreau via dovecot wrote:

Hi, 

THis is a core problem in Dovecot in my understanding. 

In my opinion, the rescan in dovecot should send to the FTS plugin the list of "supposedly" indexed emails (UID), and the plugin shall purge the redundant UID (i..e UID present in the index but not in the list sent by dovecot) and send back the list of UID not in its indexes to dovecot, so Dovect can send one by one the missing emails 

WHat do you think ? 

 Original Message  


SUBJECT:
[grosjo/fts-xapian] `doveadm fts rescan` removes all indices (#15)

DATE:
2019-02-08 08:28

FROM:
Leonard Lausen 

TO:
grosjo/fts-xapian 

CC:
Subscribed 

REPLY-TO:
grosjo/fts-xapian 


doveadm fts rescan -A deletes all indices, ie. all folders and files in the 
xapian-indexes are deleted. However, according to man doveadm fts, the rescan 
command should only


Scan what mails exist in the full text search index and compare those to what
actually exist in mailboxes. This removes mails from the index that have already
been expunged and makes sure that the next doveadm index will index all the
missing mails (if any).


Deleting all indices does not seem to be the intended action, especially as constructing the index anew may take very long on large mailboxes. 


--
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub [1], or mute the thread [2].



Links:
--
[1] https://github.com/grosjo/fts-xapian/issues/15
[2]
https://github.com/notifications/unsubscribe-auth/ACLmB9OB-7GaKIvhNc8sCgi7KQTrjNnoks5vLScugaJpZM4auCWp

Fwd: [grosjo/fts-xapian] `doveadm fts rescan` removes all indices (#15)

2019-02-07 Thread Joan Moreau via dovecot
Hi, 

THis is a core problem in Dovecot in my understanding. 


In my opinion, the rescan in dovecot should send to the FTS plugin the
list of "supposedly" indexed emails (UID), and the plugin shall purge
the redundant UID (i..e UID present in the index but not in the list
sent by dovecot) and send back the list of UID not in its indexes to
dovecot, so Dovect can send one by one the missing emails 

WHat do you think ? 

 Original Message  


SUBJECT:
[grosjo/fts-xapian] `doveadm fts rescan` removes all indices 
(#15)

DATE:
2019-02-08 08:28

FROM:
Leonard Lausen 

TO:
grosjo/fts-xapian 

CC:
Subscribed 

REPLY-TO:
grosjo/fts-xapian


doveadm fts rescan -A deletes all indices, ie. all folders and files in
the xapian-indexes are deleted. However, according to man doveadm fts,
the rescan command should only


Scan what mails exist in the full text search index and compare those to what
actually exist in mailboxes. This removes mails from the index that have already
been expunged and makes sure that the next doveadm index will index all the
missing mails (if any).


Deleting all indices does not seem to be the intended action, especially
as constructing the index anew may take very long on large mailboxes. 


--
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub [1], or mute the thread
[2]. 




Links:
--
[1] https://github.com/grosjo/fts-xapian/issues/15
[2]
https://github.com/notifications/unsubscribe-auth/ACLmB9OB-7GaKIvhNc8sCgi7KQTrjNnoks5vLScugaJpZM4auCWp

Re: Solr - complete setup (update)

2019-01-29 Thread Joan Moreau via dovecot

On 2019-01-30 07:33, Stephan Bosch wrote:


(forgot to CC mailing list)

Op 26/01/2019 om 20:07 schreef Joan Moreau via dovecot: 


*- Bugs so far*

-> Line 620 of fts_solr dovecot plugin : the size oof header is improperly calculated 
("huge header" warning for a simple email, which kilss the index of that 
considered email, so basically MOST emails as the calculation is wrong) *You can check that 
regularly in dovecot log file. My guess is the mix of Unicode which is not properly 
addressed here.*


Does this happen with specific messages? Do you have a sample message
for me? I don't see how Unicode could cause this. 


MY ONLY GUESS IS THAT IT REFERS TO SOME 'STRLEN', WHICH IS WRONG OF
COURSE IN CASE OF UNICODE EMAILS. THIS IS JUST A GUESS. 


BUT DO A GREP FOR "HUGE" IN THE DOVECOT LOG OF A BUSY SERVER TO FIND
EXAMPLES. 


(SORRY, I SWITCHED TO XAPIAN, AS SOLR IS CREATING TOO MUCH TROUBLES FOR
MY SERVER, SO NO MORE CONCRETE EXAMPLE) 


-> The UID returned by SOlr is to be considered as a STRING (and that is maybe the source of 
problem of the "out of bound" errors in fts_solr dovecot, as "long" is not enough)

*This is just highly visible in Solr schema.xml. Swithcing it to "long" in 
schema.xml returns plenty of errors.*


I cannot reproduce this so far (see modified schema below). In a simple
test I just get the desired results and no errors logged. 


I got this with large mailboxes (where UID seems not acceptable for Solr
). The fault is not on Dovecot side but Solr, and the returned UID(s)
for a search is garbage instead of a proper value -> Putting it as
string solves this


-> Java errors : A lot of non sense for me, I am not expert in Java. But, with 
increased memory, it seems not crashing, even if complaining quite a lot in the 
logs

Can you elaborate on the errors you have seen so far? When do these happen? How 
can I reproduce them?

*Honestly, I have no clue what the problems are. I just increased the memory of 
the JVM and the systems stopped crashing. Log files are huge anyway.*


What errors do you see? I see only INFO entries in my
/var/solr/logs/solr.log. Looks like Solr is pretty verbose by default
(lots of INFO output), but there must be a way to reduce that. 

I DELETED SOLR. NO MORE LOGS. MAYBE SOMEONE ELSE CAN TELL. 




id
















































Re: Solr - complete setup (update)

2019-01-26 Thread Joan Moreau via dovecot

*- Installation:*

-> Create a clean install using the default, (at least in the Archlinux package), and do 
a "sudo -u solr solr create -c dovecot ". The config files are then in 
/opt/solr/server/solr/dovecot/conf and datafiles in /opt/solr/server/solr/dovecot/data


On my system (Debian) these directories are wildly different (e.g. data
is under /var), but other than that, this information is OK.

Used this as a side-reference for Debian installation:
https://tecadmin.net/install-apache-solr-on-debian/

Accessed http://solr-host.tld:8983/solr/ to check whether all is OK. 


MAKE SURE YOU HAVE A DOVECOT INSTANCE (NOT THE DEFAULT INSTANCE) , WITH
THE FUNCTION BELOW: 

SOLR CREATE -C DOVECOT (OR WHATEVER NAME) 


Weirdly, rescan returns immediately here. When I perform `doveadm index INBOX` 
for my test user, I do see a lot of fts and HTTP activity.


THE SOLR PLUGIN IS NOT CODED ENTIRELY, REFRESH AND RESCAN FUNCTIONS ARE
MISSING : 


https://github.com/dovecot/core/blob/master/src/plugins/fts-solr/fts-backend-solr.c


static int fts_backend_solr_refresh(struct fts_backend *backend
ATTR_UNUSED)
{
return 0;
} 


static int fts_backend_solr_rescan(struct fts_backend *backend)
{
/* FIXME: proper rescan needed. for now we'll just reset the
last-uids */
return fts_backend_reset_last_uids(backend);
} 


*- Bugs so far*

-> Line 620 of fts_solr dovecot plugin : the size oof header is improperly calculated 
("huge header" warning for a simple email, which kilss the index of that 
considered email, so basically MOST emails as the calculation is wrong)


YOU CAN CHECK THAT REGULARLY IN DOVECOT LOG FILE. MY GUESS IS THE MIX OF
UNICODE WHICH IS NOT PROPERLY ADDRESSED HERE. 


-> The UID returned by SOlr is to be considered as a STRING (and that is maybe the source of 
problem of the "out of bound" errors in fts_solr dovecot, as "long" is not enough)


THIS IS JUST HIGHLY VISIBLE IN SOLR SCHEMA.XML. SWITHCING IT TO "LONG"
IN SCHEMA.XML RETURNS PLENTY OF ERRORS. 

-> Java errors : A lot of non sense for me, I am not expert in Java. But, with increased memory, it seems not crashing, even if complaining quite a lot in the logs 


Can you elaborate on the errors you have seen so far? When do these happen? How 
can I reproduce them?


HONESTLY, I HAVE NO CLUE WHAT THE PROBLEMS ARE. I JUST INCREASED THE
MEMORY OF THE JVM AND THE SYSTEMS STOPPED CRASHING. LOG FILES ARE HUGE
ANYWAY.

[FTS Xapian] RC release

2019-01-24 Thread Joan Moreau via dovecot
Hi, 


FTS Xapian matches my targets for the plugins (replacing deprecated
fts-squat in a production environment) 

https://github.com/grosjo/fts-xapian 

Please do not hesitate to add "issues" on github, if the case happen 

Hope it helps 


JM

Encoding input

2019-01-22 Thread Joan Moreau via dovecot
Hi 


Are data inputs of fts_backend_update_build_more(struct
fts_backend_update_context *_ctx, const unsigned char *data, size_t
size) already converted to UTF8 ? 


Thanks

Re: Solr -> Xapian ?

2019-01-22 Thread Joan Moreau via dovecot
To get back on thi "build_more" function: 

this is what I receive: 

(see below) 


2 poitns : the header name seems to be added at the end of the *data.
not always, why so ? 

where is the body ? 


Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA(mime-version)=1.0MIME-VERSION
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA2(mime-version)=1.0MIME-VERSION
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
Start indexing 'Sent'
(/data/mail/grosjo.net/jom/xapian-indexes/db_49fdf110ec9bc14c375bd6a3092d)
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA(content-type)=MULTIPART/ALTERNATIVE;
BOUNDARY="=_87A48D791CC8B262204294719234352F"CONTENT-TYPE
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA2(content-type)=MULTIPART/ALTERNATIVE;
BOUNDARY="=_87A48D791CC8B262204294719234352F"CONTENT-TYPE
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA(date)=TUE, 22 JAN 2019 09:25:49 +0100DATE
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA2(date)=TUE, 22 JAN 2019 09:25:49 +0100DATE
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA(from)="JOAN MOREAU" 
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA2(from)="JOAN MOREAU" 
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA(to)="JOAN MOREAU" 
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA2(to)="JOAN MOREAU" 
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA(subject)=TESTSUBJECT
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA2(subject)=TESTSUBJECT
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA(user-agent)=ROUNDCUBE WEBMAIL/1.4-GITUSER-AGENT
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA2(user-agent)=ROUNDCUBE WEBMAIL/1.4-GITUSER-AGENT
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA(message-id)=<1c18523a5a00849c8be7970f44276...@grosjo.net>MESSAGE-ID
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA2(message-id)=<1c18523a5a00849c8be7970f44276...@grosjo.net>MESSAGE-ID
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA(x-sender)=j...@grosjo.netx-SENDER
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA2(x-sender)=j...@grosjo.netx-SENDER
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA(content-transfer-encoding)=7BITCONTENT-TRANSFER-ENCODING
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA2(content-transfer-encoding)=7BITCONTENT-TRANSFER-ENCODING
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA(content-type)=TEXT/PLAIN; CHARSET=UTF-8; FORMAT=FLOWEDCONTENT-TYPE
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA2(content-type)=TEXT/PLAIN; CHARSET=UTF-8; FORMAT=FLOWEDCONTENT-TYPE
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA(content-transfer-encoding)=QUOTED-PRINTABLECONTENT-TRANSFER-ENCODING
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA2(content-transfer-encoding)=QUOTED-PRINTABLECONTENT-TRANSFER-ENCODING
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA(content-type)=TEXT/HTML; CHARSET=UTF-8CONTENT-TYPE
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
DATA2(content-type)=TEXT/HTML; CHARSET=UTF-8CONTENT-TYPE
Jan 22 08:25:50 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
Done indexing 'Sent' (1 msgs in 3 ms, rate: 333.3)
Jan 22 08:25:50 gjserver dovecot[20984]: imap-login: Login:
user=, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1,
mpid=21699, secured, session=<99GeuQeANlt/AAAB>
Jan 22 08:25:51 gjserver dovecot[20984]:
imap(j...@grosjo.net)<21699><99GeuQeANlt/AAAB>: Logged out in=20201
out=567147 deleted=0 expunged=0 trashed=0 hdr_count=200 hdr_bytes=62139
body_count=0 body_bytes=0
Jan 22 08:25:51 gjserver dovecot[20984]:
indexer-worker(j...@grosjo.net)<20998>:
Indexed 1 messages in Sent (UIDs 60585..60585) 


On 2019-01-08 04:24, Timo Sirainen wrote:

On 7 Jan 2019, at 16.05, Joan Moreau via dovecot  wrote: 


Hi

ANyone to answer specifically ?

Q1 : get_last_uid -> Is this the last UID indexed (which may be not the

Re: Solr - complete setup (update)

2019-01-18 Thread Joan Moreau via dovecot

Yes, the " -property update.autoCreateFields -value false " seems
interesting 

However, we smash the created schema just after 


On 2019-01-14 23:25, Stephan Bosch wrote:

Op 14/01/2019 om 07:44 schreef Joan Moreau via dovecot: 


Hi Stephan,

What's up with that ?

Thank you so much


Working on it, somewhat anyway.

BTW, did you see this ? :

"""
$ sudo -u solr /opt/solr/bin/solr create -c dovecot
WARNING: Using _default configset with data driven schema functionality. NOT 
RECOMMENDED for production use.
To turn off: bin/solr config -c dovecot -p 8983 -action set-user-property 
-property update.autoCreateFields -value false
INFO  - 2019-01-14 23:19:56.831; 
org.apache.solr.util.configuration.SSLCredentialProviderFactory; Processing SSL 
Credential Provider chain: env;sysprop

Created new core 'dovecot'
"""

I'll be trying your steps first, but the mentioned command might at least get 
rid of some of the cruft in the default config file.

Regards,

Stephan.

On 2019-01-05 02:04, Stephan Bosch wrote:

Hi,

Op 04/01/2019 om 05:36 schreef Joan Moreau via dovecot: 
Hi


This is the summary of my work with SOLR-Dovecot, in my *quest to reproduce the 
previoulsy excellent work of fts_squat*

@Aki : Based on the time I have spent on this, I would love to see you updating 
the Wiki with those improvements, and adding my name somewhere

@All : Hope it helps

I'll be going through the description below soon. I've recently independently 
installed fts-solr from scratch. Although this wasn't a flawless effort, I 
managed to get some basic indexing going. From this mail thread I understand 
that there are quite a few more problems than I've seen myself so far. Then 
again, I didn't perform extensive tests with actual searches.

Maybe we can turn all this into a test suite that we can run internally here at 
Dovecot. At the very least, the described Dovecot bugs need to be addressed and 
the wiki needs to be updated.

I'll get back to you.

Regards,

Stephan.

*- Installation:*

-> Create a clean install using the default, (at least in the Archlinux package), and do 
a "sudo -u solr solr create -c dovecot ". The config files are then in 
/opt/solr/server/solr/dovecot/conf and datafiles in /opt/solr/server/solr/dovecot/data

-> In /opt/solr/server/solr/dovecot/conf/solrconfig.xml:

* around line 313, change false to 
true

* around line 147, set 2000 (or above)

* around line 696 : uncomment hdr

* around line 1127, before , 
add 

* around line 1161, delete the whole 

* around line 1192, remove the whole 

-> Remove /opt/solr/server/solr/dovecot/conf/managed-schema

-> Change "schema.xml" by the one below to reproduce fts_squat behavior  (equivalent to 
" fts_squat = partial=3 full=25" in dovecot.conf) (note : such a huge trouble to replace a 
single line setup, anyway...)

-> Move /opt/solr/server/solr (or the subfolder data) to a partition with 
*space*, ideally ext4 or faster file system (it looks like Solr is not considering 
using a simple mysql database, which would make sense to avoid all the fuzz and 
let it transit to a non-java state, but that is another story)

-> Config of dovecot.conf is as below

-> The systemd unit shall specify high ulimit for files and proc (see below)

-> Increase the memory available for the JavaVM (I put 12Gb as I have quite a space on my 
server, but you may adapt it as per your specs) : in /opt/solr/bin/solr.in.sh, set 
SOLR_HEAP="12288m"

-> As Solr is complaining a lot, you may consider a filter for it in your 
syslog-ng or journald as it pollutes greatly your audit files

-> (re)Start solr (first) and dovecot by systemctl

-> Launch redindex ( doveadm fts rescan -u  )

-> wait for a big while to let the system re-index all your mail boxes

*- Bugs so far*

-> Line 620 of fts_solr dovecot plugin : the size oof header is improperly calculated 
("huge header" warning for a simple email, which kilss the index of that 
considered email, so basically MOST emails as the calculation is wrong)

-> The UID returned by SOlr is to be considered as a STRING (and that is maybe the source of 
problem of the "out of bound" errors in fts_solr dovecot, as "long" is not enough)

-> Java errors : A lot of non sense for me, I am not expert in Java. But, with 
increased memory, it seems not crashing, even if complaining quite a lot in the 
logs

*---SCHEMA.XML in /opt/solr/server/solr/dovecot/conf*



id















































*-- DOVECOT.CONF*

mail_plugins = fts fts_solr

plugin {
plugin = fts fts_solr managesieve sieve

fts = solr
fts_autoindex = yes
fts_enforced = yes
fts_solr = url=http://127.0.0.1:8983/solr/dovecot/

(replace 127.0.0.1 by your solr server if you want to use an external server)
(...)

}

*-- /etc/systemd/system/multi-user.target.wants/solr.service*

[Unit]
Description=Solr full text sea

Repetitive indexing nd LOCK WRITE error

2019-01-16 Thread Joan Moreau via dovecot
Hi, 


Monitoring the Xapian plugin, I notice that dovecot is re-indexing
multiple times the same Inbox for no apparent reason (not the last email
received but the whole mailbox, LAST UID being properly returned (with
the confusion already discussed) ) : Why so ? 


Also, I get a LOCK on the "dovecot.index.log" file during this heavy
indexing: 


Error: Timeout (180s) while waiting for lock for transaction log file
/data/mail/XXX/XX/mailboxes/INBOX/dbox-Mails/dovecot.index.log 

ANyone can clarify the cause of this ? 


Thank you

Re: [FTS Xapian] Beta release

2019-01-14 Thread Joan Moreau via dovecot

It is indeed better is you use the issue tracker of github:
https://github.com/grosjo/fts-xapian/issues 

I updated the Readme accordingly 


On 2019-01-14 14:24, Stephan Bosch wrote:

Op 14-1-2019 om 13:40 schreef Aki Tuomi: 


Just to remind that now that there is a github repo for fts-xapian, you could 
maybe open these issues there instead?

Although README.md currently says:

"Please feel free to send your questions, together with the dovecot log file, to j...@grosjo.net 
<mailto:j...@grosjo.net> or to the dovecot ML dovecot@dovecot.org 
<mailto:dovecot@dovecot.org>."

Regards,

Stephan.

Aki

On 14.1.2019 14.29, Odhiambo Washington wrote: Testing a compile on FreeBSD.

gmake[2]: Entering directory '/usr/home/wash/Tools/Dovecot/fts-xapian/src'
/bin/sh ../libtool  --tag=CXX   --mode=compile c++ -DHAVE_CONFIG_H -I. -I.. 
-I/opt/dovecot2.3/include/dovecot -I/opt/dovecot2.3/include/dovecot  -g -O2 
-MT fts-backend-xapian.lo -MD -MP -MF .deps/fts-backend-xapian.Tpo -c -o 
fts-backend-xapian.lo fts-backend-xapian.cpp
libtool: compile:  c++ -DHAVE_CONFIG_H -I. -I.. 
-I/opt/dovecot2.3/include/dovecot -I/opt/dovecot2.3/include/dovecot -g -O2 -MT 
fts-backend-xapian.lo -MD -MP -MF .deps/fts-backend-xapian.Tpo -c 
fts-backend-xapian.cpp  -fPIC -DPIC -o .libs/fts-backend-xapian.o
fts-backend-xapian.cpp:3:10: fatal error: 'xapian.h' file not found
#include 
^~

Well, I installed xapian-core and the xapian.h is in /usr/local/include/

I can overcome the fatal error by doing:

env CPPFLAGS=-I/usr/local/include PANDOC=false ./configure --prefix=/opt 
--with-dovecot=/opt/dovecot2.3/lib/dovecot/

Is that something that you can address within the code or we (*BSD) have to 
live with it?

During `make`, the following warning is generated:

/bin/sh ../libtool  --tag=CXX   --mode=compile c++ -DHAVE_CONFIG_H -I. -I.. 
-I/opt/dovecot2.3/include/dovecot  -I/usr/local/include 
-I/opt/dovecot2.3/include/dovecot  -g -O2 -MT fts-backend-xapian.lo -MD -MP 
-MF .deps/fts-backend-xapian.Tpo -c -o fts-backend-xapian.lo 
fts-backend-xapian.cpp
libtool: compile:  c++ -DHAVE_CONFIG_H -I. -I.. 
-I/opt/dovecot2.3/include/dovecot -I/usr/local/include 
-I/opt/dovecot2.3/include/dovecot -g -O2 -MT fts-backend-xapian.lo -MD -MP -MF 
.deps/fts-backend-xapian.Tpo -c fts-backend-xapian.cpp  -fPIC -DPIC -o 
.libs/fts-backend-xapian.o
fts-backend-xapian.cpp:486:14: warning: format string is not a string literal 
(potentially insecure) [-Wformat-security]
i_warning(e.get_msg().c_str());
^~~
fts-backend-xapian.cpp:486:14: note: treat the string as an argument to avoid 
this
i_warning(e.get_msg().c_str());
^
"%s",
1 warning generated.

Is that something you can look into as well?

On Mon, 14 Jan 2019 at 11:43, Joan Moreau mailto:j...@grosjo.net>> wrote:

THank you Odhiambo. I updated accordingly

On 2019-01-14 08:07, Odhiambo Washington wrote:

In your README.md, perhaps "This project intends to provide a
straightforward and simple *procedure *to configure FTS plugin
for Dovecot, leveraging the efforts by the Xapian.org team." is
better??
Also in the part after cloning from git:
./configure --prefix=/usr --with-dovecot=/path/to/dovecot [ This
/path/to/dovecot is not obvious. Is it the dovecot binary or what??]

On Mon, 14 Jan 2019 at 09:42, Joan Moreau via dovecot
mailto:dovecot@dovecot.org>> wrote:

Thank you Stephan.

The version here shall be up and running :
https://github.com/grosjo/fts-xapian

On 2019-01-14 00:07, Stephan Bosch wrote:

Op 13/01/2019 om 21:25 schreef Joan Moreau via dovecot:

I tried to combined it, the "autoreconf" errors are solved

Now, when I type "make install", the lib is not
pushed into dovecot folder, but somewhere in
/usr/local/...

How to adjust this to have it arriving in the proper folder ?

Depends on your system. It mostly a matter of setting a
proper --prefix directory for configure, but other paths
are configurable as well. I usually check what the
official distribution package for Dovecot is doing and
use that as a basis.

For Debian I use the following configure command:

./configure --with-ldap=plugin --with-ssl=openssl
--with-sql=plugin --with-lua=plugin --with-pgsql
--with-mysql --with-sqlite \
--with-gssapi=plugin --with-solr
--with-ioloop=best --enable-maintainer-mode \
--prefix=/usr --sysconfdir=/etc
--libexecdir=/usr/lib --localstatedir=/var
--mandir=/usr/share/man \
--infodir=/usr/share/info
--with-moduledir=/usr/lib/dovecot/modules
--disable-rpath --disable-static

Regards,

Stephan

On 2019-01-13 21:01, Tuomi, Aki wrote:

You copied your Makefile.am there. Stephan made
you a working version, can you try that?
(sorry for dup)
Aki
 Original message 
From: Joan Moreau mailto:j...@grosjo.net>>
Date: 13/01/2019 21:39 (GMT+02:00)
To: Stephan Bosch mailto:step...@rename-it.nl>>
Cc: Aki Tuomi mailto:aki.tu...@open-xchange.com>>
Subject: Re: [FTS Xapian] Beta relea

Re: [FTS Xapian] Beta release

2019-01-14 Thread Joan Moreau via dovecot

It is indeed better is you use the issue tracker of github:
https://github.com/grosjo/fts-xapian/issues 

I updated the Readme accordingly 


On 2019-01-14 14:24, Stephan Bosch wrote:

Op 14-1-2019 om 13:40 schreef Aki Tuomi: 


Just to remind that now that there is a github repo for fts-xapian, you could 
maybe open these issues there instead?

Although README.md currently says:

"Please feel free to send your questions, together with the dovecot log file, to j...@grosjo.net 
 or to the dovecot ML dovecot@dovecot.org 
."

Regards,

Stephan.

Re: [FTS Xapian] Beta release

2019-01-14 Thread Joan Moreau via dovecot
THanks Paul 


Can you try indexing the same emails with "full=10" for instance in the
dovecot.conf ? 


On 2019-01-14 12:19, Paul Hecker via dovecot wrote:


Thank you. Here is the stack trace with all debug symbols:

On 14. Jan 2019, at 11:07, Stephan Bosch  wrote:

Op 14-1-2019 om 10:55 schreef Paul Hecker via dovecot: OK, got it (my fault, as 
always, put the LimitCORE in the wrong line). Here is the stack trace:

If you want to get rid of those "??" stack trace elements, you'll need to 
install debug symbols for the xapian library. It depends on your system how to do that 
(usually some separate package).

Regards,

Stephan.

On 14. Jan 2019, at 10:33, Joan Moreau via dovecot mailto:dovecot@dovecot.org>> wrote:

Difficult to figure out without a coredump + gdb

I have also battled quite a lot to make sure dovecot can core dump on my 
Archlinux servers.

I remember that the key point was putting*fs.suid_dumpable=2* in /etc/sysctl.d/ 
conf files, *LimitCORE=infinity* in 
/etc/systemd/system/multi-user.target.wants/dovecot.service,  and rebooting the 
server.

My own coredumps are on /var/lib/systemd/coredump/

Re: [FTS Xapian] Beta release

2019-01-14 Thread Joan Moreau via dovecot
Difficult to figure out without a coredump + gdb 


I have also battled quite a lot to make sure dovecot can core dump on my
Archlinux servers. 


I remember that the key point was putting FS.SUID_DUMPABLE=2 in
/etc/sysctl.d/ conf files, LIMITCORE=INFINITY in
/etc/systemd/system/multi-user.target.wants/dovecot.service,  and
rebooting the server. 

My own coredumps are on /var/lib/systemd/coredump/ 


On 2019-01-14 10:20, Paul Hecker via dovecot wrote:

Here it is: 


Jan 14 09:26:08 mail dovecot: 
indexer-worker(p...@iwascoding.com)<16777>: Debug: 
Effective uid=8, gid=8, home=/var/spool/mail/iwascoding/paul
Jan 14 09:26:08 mail dovecot: 
indexer-worker(p...@iwascoding.com)<16777>: Debug: 
Quota root: name=User quota backend=dict 
args=:file:/var/spool/mail/iwascoding/paul/dovecot-quota
Jan 14 09:26:08 mail dovecot: 
indexer-worker(p...@iwascoding.com)<16777>: Debug: 
Quota rule: root=User quota mailbox=* bytes=2147483648 messages=0
Jan 14 09:26:08 mail dovecot: 
indexer-worker(p...@iwascoding.com)<16777>: Debug: 
Quota rule: root=User quota mailbox=* bytes=2147483648 messages=6
Jan 14 09:26:08 mail dovecot: 
indexer-worker(p...@iwascoding.com)<16777>: Debug: 
Quota grace: root=User quota bytes=214748364 (10%)
Jan 14 09:26:08 mail dovecot: 
indexer-worker(p...@iwascoding.com)<16777>: Debug: dict 
quota: user=p...@iwascoding.com, uri=file:/var/spool/mail/iwascoding/paul/dovecot-quota, 
noenforcing=0
Jan 14 09:26:08 mail dovecot: 
indexer-worker(p...@iwascoding.com)<16777>: Debug: 
Namespace inbox: type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes, 
subscriptions=yes location=mdbox:~/mdbox
Jan 14 09:26:08 mail dovecot: 
indexer-worker(p...@iwascoding.com)<16777>: Debug: fs: 
root=/var/spool/mail/iwascoding/paul/mdbox, index=, indexpvt=, control=, inbox=, alt=
Jan 14 09:26:08 mail dovecot: 
indexer-worker(p...@iwascoding.com)<16777>: FTS Xapian: 
Partial=2, Full=20 DB_PATH=/var/spool/mail/iwascoding/paul/mdbox/xapian-indexes
Jan 14 09:26:08 mail dovecot: 
indexer-worker(p...@iwascoding.com)<16777>: Debug: 
quota: quota_over_flag check: quota_over_script unset - skipping
Jan 14 09:26:08 mail dovecot: 
indexer-worker(p...@iwascoding.com)<16777>: Debug: 
Mailbox sent: Mailbox opened because: indexing
Jan 14 09:26:08 mail dovecot: 
indexer-worker(p...@iwascoding.com)<16777>: FTS Xapian 
: Mailbox sent : Last UID=0
Jan 14 09:26:08 mail dovecot: 
indexer-worker(p...@iwascoding.com)<16777>: FTS Xapian 
: Mailbox sent : Last UID=0
Jan 14 09:26:08 mail dovecot: 
indexer-worker(p...@iwascoding.com)<16777>: Debug: 
Namespace : Using permissions from /var/spool/mail/iwascoding/paul/mdbox: mode=0700 
gid=default
Jan 14 09:26:08 mail dovecot: 
indexer-worker(p...@iwascoding.com)<16777>: Debug: 
Mailbox sent: UID 1: Opened mail because: fts indexing
Jan 14 09:26:08 mail dovecot: 
indexer-worker(p...@iwascoding.com)<16777>: Opening RW 
/var/spool/mail/iwascoding/paul/mdbox/xapian-indexes/db_9ddfe10d8a8a8a568c12654d370e
Jan 14 09:26:08 mail dovecot: 
indexer-worker(p...@iwascoding.com)<16777>: Debug: 
Mailbox sent: UID 2: Opened mail because: fts indexing
Jan 14 09:26:08 mail dovecot: 
indexer-worker(p...@iwascoding.com)<16777>: Debug: 
Mailbox sent: UID 3: Opened mail because: fts indexing

Thank you! 

On 14. Jan 2019, at 10:11, Joan Moreau via dovecot  wrote: 

Can you send the log part that includes the "init" of the plugins (something similar as below) ? 

WHich version of Xapian are you on ? 


Jan 14 09:10:04 gjserver dovecot[31082]: 
indexer-worker(ad...@grosjo.net)<14725>:
 FTS Xapian: Partial=2, Full=20 DB_PATH=/data/mail/grosjo.net/admin/xapian-indexes [1]
Jan 14 09:10:04 gjserver dovecot[31082]: 
indexer-worker(ad...@grosjo.net)<14725>:
 FTS Xapian : Mailbox Mail : Last UID=815055
Jan 14 09:10:04 gjserver dovecot[31082]: 
indexer-worker(ad...@grosjo.net)<14725>:
 FTS Xapian : Mailbox Mail : Last UID=815055
Jan 14 09:10:04 gjserver dovecot[31082]: indexer-worker(ad...@grosjo.net)<14725>: Opening RW /data/mail/grosjo.net/admin/xapian-indexes/db_5c935034609bc14c0e55d6a3092d [2] 

On 2019-01-14 10:08, Paul Hecker via dovecot wrote: 
Hi,


I installed and tested your version, but the indexer process crashes 
reproducible with the following command after about 2000 messages were indexed:

doveadm index -u p...@iwascoding.com -q \*

Jan 14 09:26:15 mail dovecot: 
indexer-worker(p...@iwascoding.com)<16777>: Debug: 
Mailbox sent: UID 2038: Opened mail because: fts indexing
Jan 14 09:26:15 mail dovecot: indexer-worker: Error: terminate called after 
throwing an instance of 'std::bad_alloc'
Jan 14 09:26:15 mail dovecot: indexer-worker: Error:   what():  std::bad_alloc
Jan 14 09:26:15 mail dovecot: indexer: Error: Indexer worker disconnected, 
discarding 48 requests for p...@iwascoding.com
Jan 14 09:26:15 mail dovecot: 
indexer-worker(p...@iwascodi

Re: [FTS Xapian] Beta release

2019-01-14 Thread Joan Moreau via dovecot

Can you send the log part that includes the "init" of the plugins
(something similar as below) ? 

WHich version of Xapian are you on ? 


Jan 14 09:10:04 gjserver dovecot[31082]:
indexer-worker(ad...@grosjo.net)<14725>:
FTS Xapian: Partial=2, Full=20
DB_PATH=/data/mail/grosjo.net/admin/xapian-indexes
Jan 14 09:10:04 gjserver dovecot[31082]:
indexer-worker(ad...@grosjo.net)<14725>:
FTS Xapian : Mailbox Mail : Last UID=815055
Jan 14 09:10:04 gjserver dovecot[31082]:
indexer-worker(ad...@grosjo.net)<14725>:
FTS Xapian : Mailbox Mail : Last UID=815055
Jan 14 09:10:04 gjserver dovecot[31082]:
indexer-worker(ad...@grosjo.net)<14725>:
Opening RW
/data/mail/grosjo.net/admin/xapian-indexes/db_5c935034609bc14c0e55d6a3092d


On 2019-01-14 10:08, Paul Hecker via dovecot wrote:


Hi,

I installed and tested your version, but the indexer process crashes 
reproducible with the following command after about 2000 messages were indexed:

doveadm index -u p...@iwascoding.com -q \*

Jan 14 09:26:15 mail dovecot: 
indexer-worker(p...@iwascoding.com)<16777>: Debug: 
Mailbox sent: UID 2038: Opened mail because: fts indexing
Jan 14 09:26:15 mail dovecot: indexer-worker: Error: terminate called after 
throwing an instance of 'std::bad_alloc'
Jan 14 09:26:15 mail dovecot: indexer-worker: Error:   what():  std::bad_alloc
Jan 14 09:26:15 mail dovecot: indexer: Error: Indexer worker disconnected, 
discarding 48 requests for p...@iwascoding.com
Jan 14 09:26:15 mail dovecot: 
indexer-worker(p...@iwascoding.com)<16777>: Fatal: 
master: service(indexer-worker): child 16777 killed with signal 6 (core dumps disabled - 
https://dovecot.org/bugreport.html#coredumps)

I tried to delete the message, but this does not help (crashes e.g. after 
message 2029 or 2044). Other folders with fewer messages were successfully 
indexed before.

Sorry, could not convince dovecot to create core dumps (read the docs, changed 
/proc/sys/kernel/core_pattern, added LimitCORE=unlimited/infinity, even created 
/etc/systemd/system/dovecot.service.d/coredump.conf to no avail). Custom 
Dovecot 2.3.4 on Debian Stretch.

Thanks,
Paul

On 14. Jan 2019, at 07:42, Joan Moreau via dovecot  wrote:

Thank you Stephan.

The version here shall be up and running : https://github.com/grosjo/fts-xapian

On 2019-01-14 00:07, Stephan Bosch wrote:

Op 13/01/2019 om 21:25 schreef Joan Moreau via dovecot: 
I tried to combined it, the "autoreconf" errors are solved


Now, when I type "make install", the lib is not pushed into dovecot folder, but 
somewhere in /usr/local/...

How to adjust this to have it arriving in the proper folder ?

Depends on your system. It mostly a matter of setting a proper --prefix 
directory for configure, but other paths are configurable as well. I usually 
check what the official distribution package for Dovecot is doing and use that 
as a basis.

For Debian I use the following configure command:

./configure --with-ldap=plugin --with-ssl=openssl --with-sql=plugin 
--with-lua=plugin --with-pgsql --with-mysql --with-sqlite \
--with-gssapi=plugin --with-solr --with-ioloop=best --enable-maintainer-mode \
--prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var 
--mandir=/usr/share/man \
--infodir=/usr/share/info --with-moduledir=/usr/lib/dovecot/modules 
--disable-rpath --disable-static

Regards,

Stephan

On 2019-01-13 21:01, Tuomi, Aki wrote:

You copied your Makefile.am there. Stephan made you a working version, can you 
try that?
(sorry for dup)
Aki
 Original message 
From: Joan Moreau 
Date: 13/01/2019 21:39 (GMT+02:00)
To: Stephan Bosch 
Cc: Aki Tuomi 
Subject: Re: [FTS Xapian] Beta release

I used the skeleton from Aki : https://github.com/grosjo/fts-xapian

However, when I try to act as a visitor, I reach teh follwoing error:

# autoreconf -vi
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf
autoreconf: running: /usr/bin/autoheader
autoreconf: running: automake --add-missing --copy --no-force
configure.ac:9: installing './compile'
configure.ac:11: installing './config.guess'
configure.ac:11: installing './config.sub'
configure.ac:7: installing './install-sh'
configure.ac:7: installing './missing'
src/Makefile.am: installing './depcomp'
/usr/share/automake-1.16/am/depend2.am: error: am__fastdepCXX does not appear 
in AM_CONDITIONAL
/usr/share/automake-1.16/am/depend2.am: The usual way to define 
'am__fastd

Re: [FTS Xapian] Beta release

2019-01-14 Thread Joan Moreau via dovecot
THank you Odhiambo. I updated accordingly 


On 2019-01-14 08:07, Odhiambo Washington wrote:

In your README.md, perhaps "This project intends to provide a straightforward and simple PROCEDURE to configure FTS plugin for Dovecot, leveraging the efforts by the Xapian.org team." is better?? 
Also in the part after cloning from git: 

./configure --prefix=/usr --with-dovecot=/path/to/dovecot [ This /path/to/dovecot is not obvious. Is it the dovecot binary or what??] 

On Mon, 14 Jan 2019 at 09:42, Joan Moreau via dovecot  wrote: 

Thank you Stephan. 

The version here shall be up and running : https://github.com/grosjo/fts-xapian 

On 2019-01-14 00:07, Stephan Bosch wrote: 

Op 13/01/2019 om 21:25 schreef Joan Moreau via dovecot: 
I tried to combined it, the "autoreconf" errors are solved


Now, when I type "make install", the lib is not pushed into dovecot folder, but 
somewhere in /usr/local/...

How to adjust this to have it arriving in the proper folder ?

Depends on your system. It mostly a matter of setting a proper --prefix 
directory for configure, but other paths are configurable as well. I usually 
check what the official distribution package for Dovecot is doing and use that 
as a basis.

For Debian I use the following configure command:

./configure --with-ldap=plugin --with-ssl=openssl --with-sql=plugin 
--with-lua=plugin --with-pgsql --with-mysql --with-sqlite \
--with-gssapi=plugin --with-solr --with-ioloop=best --enable-maintainer-mode \
--prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var 
--mandir=/usr/share/man \
--infodir=/usr/share/info --with-moduledir=/usr/lib/dovecot/modules 
--disable-rpath --disable-static

Regards,

Stephan

On 2019-01-13 21:01, Tuomi, Aki wrote:

You copied your Makefile.am there. Stephan made you a working version, can you 
try that?
(sorry for dup)
Aki
 Original message 
From: Joan Moreau 
Date: 13/01/2019 21:39 (GMT+02:00)
To: Stephan Bosch 
Cc: Aki Tuomi 
Subject: Re: [FTS Xapian] Beta release

I used the skeleton from Aki : https://github.com/grosjo/fts-xapian

However, when I try to act as a visitor, I reach teh follwoing error:

# autoreconf -vi
autoreconf: Entering directory `.'
autoreconf: configure.ac [1]: not using Gettext
autoreconf: running: aclocal -I m4
autoreconf: configure.ac [1]: tracing
autoreconf: running: libtoolize --copy
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf
autoreconf: running: /usr/bin/autoheader
autoreconf: running: automake --add-missing --copy --no-force
configure.ac:9 [2]: installing './compile'
configure.ac:11 [3]: installing './config.guess'
configure.ac:11 [3]: installing './config.sub'
configure.ac:7 [4]: installing './install-sh'
configure.ac:7 [4]: installing './missing'
src/Makefile.am: installing './depcomp'
/usr/share/automake-1.16/am/depend2.am [5]: error: am__fastdepCXX does not 
appear in AM_CONDITIONAL
/usr/share/automake-1.16/am/depend2.am [5]: The usual way to define 
'am__fastdepCXX' is to add 'AC_PROG_CXX'
/usr/share/automake-1.16/am/depend2.am [5]: to 'configure.ac [1]' and run 
'aclocal' and 'autoconf' again
src/Makefile.am: error: C++ source seen but 'CXX' is undefined
src/Makefile.am: The usual way to define 'CXX' is to add 'AC_PROG_CXX'
src/Makefile.am: to 'configure.ac [1]' and run 'autoconf' again.
src/Makefile.am:11: warning: variable 'NOPLUGIN_LDFLAGS' is defined but no 
program or
src/Makefile.am:11: library has 'NOPLUGIN' as canonical name (possible typo)
autoreconf: automake failed with exit status: 1

On 2019-01-13 20:24, Stephan Bosch wrote:

Oh, right, a distribution tarball doesn't include some of the
necessary files for your repository like autogen.sh and
.gitignore. The attached tarball includes all those and is ready
for `git init`. The previous tarball was made with `make
distcheck` from this one.

Regards,

Stephan.

Op 13/01/2019 om 20:14 schreef Stephan Bosch:

Hi Joan,

Op 13/01/2019 om 19:03 schreef Aki Tuomi:

Yes, from compiling point of view it is done.

Unfortunately what is not done is all the other work
involved, such as fixing all the inevitable bugs it has
and maintaining it. We do not want, at this moment, take
up maintaining and developing yet another FTS plugin as
we have plenty of things to do already.

I invite you to setup your own repository and provide
this plugin from there, being the maintainer of this
plugin. We can add a link to your plugin on our FTS page
so people can also find it.

There are other plugins like this, e.g.
https://github.com/st3fan/dovecot-xaps-plugin

I turned the code you provided into a separate plugin
package. The di

Re: Solr - complete setup (update)

2019-01-13 Thread Joan Moreau via dovecot
Hi Stephan, 

What's up with that ? 

Thank you so much 


On 2019-01-05 02:04, Stephan Bosch wrote:


Hi,

Op 04/01/2019 om 05:36 schreef Joan Moreau via dovecot: 


Hi

This is the summary of my work with SOLR-Dovecot, in my *quest to reproduce the 
previoulsy excellent work of fts_squat*

@Aki : Based on the time I have spent on this, I would love to see you updating 
the Wiki with those improvements, and adding my name somewhere

@All : Hope it helps

I'll be going through the description below soon. I've recently independently 
installed fts-solr from scratch. Although this wasn't a flawless effort, I 
managed to get some basic indexing going. From this mail thread I understand 
that there are quite a few more problems than I've seen myself so far. Then 
again, I didn't perform extensive tests with actual searches.

Maybe we can turn all this into a test suite that we can run internally here at 
Dovecot. At the very least, the described Dovecot bugs need to be addressed and 
the wiki needs to be updated.

I'll get back to you.

Regards,

Stephan.


*- Installation:*

-> Create a clean install using the default, (at least in the Archlinux package), and do 
a "sudo -u solr solr create -c dovecot ". The config files are then in 
/opt/solr/server/solr/dovecot/conf and datafiles in /opt/solr/server/solr/dovecot/data

-> In /opt/solr/server/solr/dovecot/conf/solrconfig.xml:

* around line 313, change false to 
true

* around line 147, set 2000 (or above)

* around line 696 : uncomment hdr

* around line 1127, before , 
add 

* around line 1161, delete the whole 

* around line 1192, remove the whole 

-> Remove /opt/solr/server/solr/dovecot/conf/managed-schema

-> Change "schema.xml" by the one below to reproduce fts_squat behavior  (equivalent to 
" fts_squat = partial=3 full=25" in dovecot.conf) (note : such a huge trouble to replace a 
single line setup, anyway...)

-> Move /opt/solr/server/solr (or the subfolder data) to a partition with 
*space*, ideally ext4 or faster file system (it looks like Solr is not considering 
using a simple mysql database, which would make sense to avoid all the fuzz and 
let it transit to a non-java state, but that is another story)

-> Config of dovecot.conf is as below

-> The systemd unit shall specify high ulimit for files and proc (see below)

-> Increase the memory available for the JavaVM (I put 12Gb as I have quite a space on my 
server, but you may adapt it as per your specs) : in /opt/solr/bin/solr.in.sh, set 
SOLR_HEAP="12288m"

-> As Solr is complaining a lot, you may consider a filter for it in your 
syslog-ng or journald as it pollutes greatly your audit files

-> (re)Start solr (first) and dovecot by systemctl

-> Launch redindex ( doveadm fts rescan -u  )

-> wait for a big while to let the system re-index all your mail boxes

*- Bugs so far*

-> Line 620 of fts_solr dovecot plugin : the size oof header is improperly calculated 
("huge header" warning for a simple email, which kilss the index of that 
considered email, so basically MOST emails as the calculation is wrong)

-> The UID returned by SOlr is to be considered as a STRING (and that is maybe the source of 
problem of the "out of bound" errors in fts_solr dovecot, as "long" is not enough)

-> Java errors : A lot of non sense for me, I am not expert in Java. But, with 
increased memory, it seems not crashing, even if complaining quite a lot in the 
logs

*---SCHEMA.XML in /opt/solr/server/solr/dovecot/conf*



id















































*-- DOVECOT.CONF*

mail_plugins = fts fts_solr

plugin {
plugin = fts fts_solr managesieve sieve

fts = solr
fts_autoindex = yes
fts_enforced = yes
fts_solr = url=http://127.0.0.1:8983/solr/dovecot/

(replace 127.0.0.1 by your solr server if you want to use an external server)
(...)

}

*-- /etc/systemd/system/multi-user.target.wants/solr.service*

[Unit]
Description=Solr full text search engine
After=network.target

[Service]
Type=simple
User=solr
Group=solr
PrivateTmp=yes
WorkingDirectory=/opt/solr
*LimitNOFILE=65000*
*LimitNPROC=65000*
ExecStart=/opt/solr/bin/solr start -f

[Install]
WantedBy=multi-user.target

Re: [FTS Xapian] Beta release

2019-01-13 Thread Joan Moreau via dovecot
Thank you Stephan. 


The version here shall be up and running :
https://github.com/grosjo/fts-xapian 


On 2019-01-14 00:07, Stephan Bosch wrote:

Op 13/01/2019 om 21:25 schreef Joan Moreau via dovecot: 


I tried to combined it, the "autoreconf" errors are solved

Now, when I type "make install", the lib is not pushed into dovecot folder, but 
somewhere in /usr/local/...

How to adjust this to have it arriving in the proper folder ?


Depends on your system. It mostly a matter of setting a proper --prefix 
directory for configure, but other paths are configurable as well. I usually 
check what the official distribution package for Dovecot is doing and use that 
as a basis.

For Debian I use the following configure command:

./configure --with-ldap=plugin --with-ssl=openssl --with-sql=plugin 
--with-lua=plugin --with-pgsql --with-mysql --with-sqlite \
--with-gssapi=plugin --with-solr --with-ioloop=best --enable-maintainer-mode \
--prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var 
--mandir=/usr/share/man \
--infodir=/usr/share/info --with-moduledir=/usr/lib/dovecot/modules 
--disable-rpath --disable-static

Regards,

Stephan

On 2019-01-13 21:01, Tuomi, Aki wrote:

You copied your Makefile.am there. Stephan made you a working version, can you 
try that?
(sorry for dup)
Aki
 Original message 
From: Joan Moreau 
Date: 13/01/2019 21:39 (GMT+02:00)
To: Stephan Bosch 
Cc: Aki Tuomi 
Subject: Re: [FTS Xapian] Beta release

I used the skeleton from Aki : https://github.com/grosjo/fts-xapian

However, when I try to act as a visitor, I reach teh follwoing error:

# autoreconf -vi
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf
autoreconf: running: /usr/bin/autoheader
autoreconf: running: automake --add-missing --copy --no-force
configure.ac:9: installing './compile'
configure.ac:11: installing './config.guess'
configure.ac:11: installing './config.sub'
configure.ac:7: installing './install-sh'
configure.ac:7: installing './missing'
src/Makefile.am: installing './depcomp'
/usr/share/automake-1.16/am/depend2.am: error: am__fastdepCXX does not appear 
in AM_CONDITIONAL
/usr/share/automake-1.16/am/depend2.am: The usual way to define 
'am__fastdepCXX' is to add 'AC_PROG_CXX'
/usr/share/automake-1.16/am/depend2.am: to 'configure.ac' and run 'aclocal' and 
'autoconf' again
src/Makefile.am: error: C++ source seen but 'CXX' is undefined
src/Makefile.am: The usual way to define 'CXX' is to add 'AC_PROG_CXX'
src/Makefile.am: to 'configure.ac' and run 'autoconf' again.
src/Makefile.am:11: warning: variable 'NOPLUGIN_LDFLAGS' is defined but no 
program or
src/Makefile.am:11: library has 'NOPLUGIN' as canonical name (possible typo)
autoreconf: automake failed with exit status: 1

On 2019-01-13 20:24, Stephan Bosch wrote:

Oh, right, a distribution tarball doesn't include some of the
necessary files for your repository like autogen.sh and
.gitignore. The attached tarball includes all those and is ready
for `git init`. The previous tarball was made with `make
distcheck` from this one.

Regards,

Stephan.

Op 13/01/2019 om 20:14 schreef Stephan Bosch:

Hi Joan,

Op 13/01/2019 om 19:03 schreef Aki Tuomi:

Yes, from compiling point of view it is done.

Unfortunately what is not done is all the other work
involved, such as fixing all the inevitable bugs it has
and maintaining it. We do not want, at this moment, take
up maintaining and developing yet another FTS plugin as
we have plenty of things to do already.

I invite you to setup your own repository and provide
this plugin from there, being the maintainer of this
plugin. We can add a link to your plugin on our FTS page
so people can also find it.

There are other plugins like this, e.g.
https://github.com/st3fan/dovecot-xaps-plugin

I turned the code you provided into a separate plugin
package. The distribution tarball is attached.

Notable changes:

- Added example copyright headers and COPYING and AUTHORS
files. You should modify those to your preference.
- Added README and INSTALL files (in markdown using Pandoc).
Those need to be amended with details.
- Amended the plugin code to display a debug message with the
plugin name and version upon plugin load.

I advise you to turn this into a git repository and continue from there.

I do not recommend releasing this plugin with the
-fpermissive flag and the resulting warning as it is now. But
I'm assuming this is still a work in pro

Re: [FTS Xapian] Beta release

2019-01-13 Thread Joan Moreau via dovecot

(or wherever dovecot installed its libraries)

On 2019-01-13 21:25, Joan Moreau via dovecot wrote:

I tried to combined it, the "autoreconf" errors are solved 

Now, when I type "make install", the lib is not pushed into dovecot folder, but somewhere in /usr/local/... 


How to adjust this to have it arriving in the proper folder ?

On 2019-01-13 21:01, Tuomi, Aki wrote: 
You copied your Makefile.am there. Stephan made you a working version, can you try that? 

(sorry for dup) 

Aki 

 Original message  
From: Joan Moreau  
Date: 13/01/2019 21:39 (GMT+02:00) 
To: Stephan Bosch  
Cc: Aki Tuomi  
Subject: Re: [FTS Xapian] Beta release 

I used the skeleton from Aki : https://github.com/grosjo/fts-xapian 

However, when I try to act as a visitor, I reach teh follwoing error: 


# autoreconf -vi
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf
autoreconf: running: /usr/bin/autoheader
autoreconf: running: automake --add-missing --copy --no-force
configure.ac:9: installing './compile'
configure.ac:11: installing './config.guess'
configure.ac:11: installing './config.sub'
configure.ac:7: installing './install-sh'
configure.ac:7: installing './missing'
src/Makefile.am: installing './depcomp'
/usr/share/automake-1.16/am/depend2.am: error: am__fastdepCXX does not appear 
in AM_CONDITIONAL
/usr/share/automake-1.16/am/depend2.am: The usual way to define 
'am__fastdepCXX' is to add 'AC_PROG_CXX'
/usr/share/automake-1.16/am/depend2.am: to 'configure.ac' and run 'aclocal' and 
'autoconf' again
src/Makefile.am: error: C++ source seen but 'CXX' is undefined
src/Makefile.am: The usual way to define 'CXX' is to add 'AC_PROG_CXX'
src/Makefile.am: to 'configure.ac' and run 'autoconf' again.
src/Makefile.am:11: warning: variable 'NOPLUGIN_LDFLAGS' is defined but no 
program or
src/Makefile.am:11: library has 'NOPLUGIN' as canonical name (possible typo)
autoreconf: automake failed with exit status: 1 

On 2019-01-13 20:24, Stephan Bosch wrote: 
Oh, right, a distribution tarball doesn't include some of the necessary files for your repository like autogen.sh and .gitignore. The attached tarball includes all those and is ready for `git init`. The previous tarball was made with `make distcheck` from this one.


Regards,

Stephan.

Op 13/01/2019 om 20:14 schreef Stephan Bosch: Hi Joan,

Op 13/01/2019 om 19:03 schreef Aki Tuomi: Yes, from compiling point of view it 
is done.

Unfortunately what is not done is all the other work involved, such as fixing 
all the inevitable bugs it has and maintaining it. We do not want, at this 
moment, take up maintaining and developing yet another FTS plugin as we have 
plenty of things to do already.

I invite you to setup your own repository and provide this plugin from there, 
being the maintainer of this plugin. We can add a link to your plugin on our 
FTS page so people can also find it.

There are other plugins like this, e.g. https://github.com/st3fan/dovecot-xaps-plugin 
I turned the code you provided into a separate plugin package. The distribution tarball is attached.


Notable changes:

- Added example copyright headers and COPYING and AUTHORS files. You should 
modify those to your preference.
- Added README and INSTALL files (in markdown using Pandoc). Those need to be 
amended with details.
- Amended the plugin code to display a debug message with the plugin name and 
version upon plugin load.

I advise you to turn this into a git repository and continue from there.

I do not recommend releasing this plugin with the -fpermissive flag and the 
resulting warning as it is now. But I'm assuming this is still a work in 
progress, so that is OK.

Regards,

Stephan.

On 13 January 2019 at 19:52 Joan Moreau  wrote:

The only point here of this fts-xapian is to get rid of solr (because it
is just a nightmare to setup) and squat (because it is considere
obsolete).

I already sent the changed in configure.ac, makefile.am, etc.. in order
to include it in the dovecot, and it compiles properly

The only remaining point is to push it in hte git (yes, everything is
already done)

On 2019-01-13 18:45, Aki Tuomi wrote:

On 13 January 2019 at 17:05 Joan Moreau via dovecot  wrote:

Hi

Please find attached the beta release of FTS Xapian, with the objective
to replace fts_squat that is being deprecated.

Configuration is exactly the same as for fts_squat:

plugin {

plugin = fts fts_xapian (...)
fts = xapian
fts_autoindex = ye

Re: [FTS Xapian] Beta release

2019-01-13 Thread Joan Moreau via dovecot
I tried to combined it, the "autoreconf" errors are solved 


Now, when I type "make install", the lib is not pushed into dovecot
folder, but somewhere in /usr/local/... 


How to adjust this to have it arriving in the proper folder ?

On 2019-01-13 21:01, Tuomi, Aki wrote:

You copied your Makefile.am there. Stephan made you a working version, can you try that? 

(sorry for dup) 

Aki 

 Original message  
From: Joan Moreau  
Date: 13/01/2019 21:39 (GMT+02:00) 
To: Stephan Bosch  
Cc: Aki Tuomi  
Subject: Re: [FTS Xapian] Beta release 

I used the skeleton from Aki : https://github.com/grosjo/fts-xapian 

However, when I try to act as a visitor, I reach teh follwoing error: 


# autoreconf -vi
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf
autoreconf: running: /usr/bin/autoheader
autoreconf: running: automake --add-missing --copy --no-force
configure.ac:9: installing './compile'
configure.ac:11: installing './config.guess'
configure.ac:11: installing './config.sub'
configure.ac:7: installing './install-sh'
configure.ac:7: installing './missing'
src/Makefile.am: installing './depcomp'
/usr/share/automake-1.16/am/depend2.am: error: am__fastdepCXX does not appear 
in AM_CONDITIONAL
/usr/share/automake-1.16/am/depend2.am: The usual way to define 
'am__fastdepCXX' is to add 'AC_PROG_CXX'
/usr/share/automake-1.16/am/depend2.am: to 'configure.ac' and run 'aclocal' and 
'autoconf' again
src/Makefile.am: error: C++ source seen but 'CXX' is undefined
src/Makefile.am: The usual way to define 'CXX' is to add 'AC_PROG_CXX'
src/Makefile.am: to 'configure.ac' and run 'autoconf' again.
src/Makefile.am:11: warning: variable 'NOPLUGIN_LDFLAGS' is defined but no 
program or
src/Makefile.am:11: library has 'NOPLUGIN' as canonical name (possible typo)
autoreconf: automake failed with exit status: 1 

On 2019-01-13 20:24, Stephan Bosch wrote: 
Oh, right, a distribution tarball doesn't include some of the necessary files for your repository like autogen.sh and .gitignore. The attached tarball includes all those and is ready for `git init`. The previous tarball was made with `make distcheck` from this one.


Regards,

Stephan.

Op 13/01/2019 om 20:14 schreef Stephan Bosch: Hi Joan,

Op 13/01/2019 om 19:03 schreef Aki Tuomi: Yes, from compiling point of view it 
is done.

Unfortunately what is not done is all the other work involved, such as fixing 
all the inevitable bugs it has and maintaining it. We do not want, at this 
moment, take up maintaining and developing yet another FTS plugin as we have 
plenty of things to do already.

I invite you to setup your own repository and provide this plugin from there, 
being the maintainer of this plugin. We can add a link to your plugin on our 
FTS page so people can also find it.

There are other plugins like this, e.g. https://github.com/st3fan/dovecot-xaps-plugin 
I turned the code you provided into a separate plugin package. The distribution tarball is attached.


Notable changes:

- Added example copyright headers and COPYING and AUTHORS files. You should 
modify those to your preference.
- Added README and INSTALL files (in markdown using Pandoc). Those need to be 
amended with details.
- Amended the plugin code to display a debug message with the plugin name and 
version upon plugin load.

I advise you to turn this into a git repository and continue from there.

I do not recommend releasing this plugin with the -fpermissive flag and the 
resulting warning as it is now. But I'm assuming this is still a work in 
progress, so that is OK.

Regards,

Stephan.

On 13 January 2019 at 19:52 Joan Moreau  wrote:

The only point here of this fts-xapian is to get rid of solr (because it
is just a nightmare to setup) and squat (because it is considere
obsolete).

I already sent the changed in configure.ac, makefile.am, etc.. in order
to include it in the dovecot, and it compiles properly

The only remaining point is to push it in hte git (yes, everything is
already done)

On 2019-01-13 18:45, Aki Tuomi wrote:

On 13 January 2019 at 17:05 Joan Moreau via dovecot  wrote:

Hi

Please find attached the beta release of FTS Xapian, with the objective
to replace fts_squat that is being deprecated.

Configuration is exactly the same as for fts_squat:

plugin {

plugin = fts fts_xapian (...)
fts = xapian
fts_autoindex = yes
fts_enforced = yes
fts_xapian = partial=2 full=20

This is installed on my production server (>120

Re: [FTS Xapian] Beta release

2019-01-13 Thread Joan Moreau via dovecot
I get the following error: 


# autoreconf -vi
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf
autoreconf: running: /usr/bin/autoheader
autoreconf: running: automake --add-missing --copy --no-force
configure.ac:9: installing './compile'
configure.ac:11: installing './config.guess'
configure.ac:11: installing './config.sub'
configure.ac:7: installing './install-sh'
configure.ac:7: installing './missing'
src/Makefile.am: installing './depcomp'
/USR/SHARE/AUTOMAKE-1.16/AM/DEPEND2.AM: ERROR: AM__FASTDEPCXX DOES NOT
APPEAR IN AM_CONDITIONAL
/USR/SHARE/AUTOMAKE-1.16/AM/DEPEND2.AM: THE USUAL WAY TO DEFINE
'AM__FASTDEPCXX' IS TO ADD 'AC_PROG_CXX'
/USR/SHARE/AUTOMAKE-1.16/AM/DEPEND2.AM: TO 'CONFIGURE.AC' AND RUN
'ACLOCAL' AND 'AUTOCONF' AGAIN
SRC/MAKEFILE.AM: ERROR: C++ SOURCE SEEN BUT 'CXX' IS UNDEFINED
SRC/MAKEFILE.AM: THE USUAL WAY TO DEFINE 'CXX' IS TO ADD 'AC_PROG_CXX'
SRC/MAKEFILE.AM: TO 'CONFIGURE.AC' AND RUN 'AUTOCONF' AGAIN.
SRC/MAKEFILE.AM:11: WARNING: VARIABLE 'NOPLUGIN_LDFLAGS' IS DEFINED BUT
NO PROGRAM OR
SRC/MAKEFILE.AM:11: LIBRARY HAS 'NOPLUGIN' AS CANONICAL NAME (POSSIBLE
TYPO)
AUTORECONF: AUTOMAKE FAILED WITH EXIT STATUS: 1 


On 2019-01-13 20:32, Joan Moreau via dovecot wrote:

Please kindly check https://github.com/grosjo/fts-xapian 

On 2019-01-13 20:11, Aki Tuomi wrote: 
If you had looked at what I sent, you'd seen it's quite different from what you sent.


Anyways, put the contents of skeleton.tar.gz and 


./src/plugins/fts-xapian/fts-xapian-plugin.h
./src/plugins/fts-xapian/fts-backend-xapian.cpp
./src/plugins/fts-xapian/Makefile.am
./src/plugins/fts-xapian/fts-backend-xapian-functions.cpp
./src/plugins/fts-xapian/fts-xapian-plugin.c

into src/ directory (included in skeleton.tar.gz), then put those into git.

You can compile it with 


autoreconf -vi
./configure --with-dovecot=/path/to/dovecot
make

Aki

On 13 January 2019 at 21:03 Joan Moreau  wrote:

THis is already what I send earlier (see : dovecot-xapian-1.0b2.tar.gz
[1 [1]]  ) 


What I would need is the files so one can download (git) it, and type
some command (make ?) to compile it and place it in the right forlder
(/usr/lib/dovecot/ or whatever is configured in the installed dovecot,
which may differ from distribution to distribution) 


On 2019-01-13 19:47, Aki Tuomi wrote:

You need the fts-xapian.c mostly. All the rest comes from automake (unless you 
decide to use cmake or something else).

I have attached you a skeleton plugin, which should work against dovecot master.

If you experience problems with the skeleton, let us know.

Aki

On 13 January 2019 at 20:23 Joan Moreau  wrote:

Ok for having a link on the FTS page.

PLease clarify what files are necessary to package it as a separate
package

On 2019-01-13 19:03, Aki Tuomi wrote:

Yes, from compiling point of view it is done.

Unfortunately what is not done is all the other work involved, such as fixing 
all the inevitable bugs it has and maintaining it. We do not want, at this 
moment, take up maintaining and developing yet another FTS plugin as we have 
plenty of things to do already.

I invite you to setup your own repository and provide this plugin from there, 
being the maintainer of this plugin. We can add a link to your plugin on our 
FTS page so people can also find it.

There are other plugins like this, e.g. 
https://github.com/st3fan/dovecot-xaps-plugin

Aki

On 13 January 2019 at 19:52 Joan Moreau  wrote:

The only point here of this fts-xapian is to get rid of solr (because it
is just a nightmare to setup) and squat (because it is considere
obsolete).

I already sent the changed in configure.ac, makefile.am, etc.. in order
to include it in the dovecot, and it compiles properly

The only remaining point is to push it in hte git (yes, everything is
already done)

On 2019-01-13 18:45, Aki Tuomi wrote:

On 13 January 2019 at 17:05 Joan Moreau via dovecot  wrote:

Hi

Please find attached the beta release of FTS Xapian, with the objective
to replace fts_squat that is being deprecated.

Configuration is exactly the same as for fts_squat:

plugin {

plugin = fts fts_xapian (...)
fts = xapian
fts_autoindex = yes
fts_enforced = yes
fts_xapian = partial=2 full=20

This is installed on my production server (>120Gb of mailboxes), and I
will observe it during the coming days.

I will definitely appreciate that this is added in the core git of
docevot, in order to have a versionning of it, to remove squat and let
basic users a

Re: [FTS Xapian] Beta release

2019-01-13 Thread Joan Moreau via dovecot
Please kindly check https://github.com/grosjo/fts-xapian 


On 2019-01-13 20:11, Aki Tuomi wrote:


If you had looked at what I sent, you'd seen it's quite different from what you 
sent.

Anyways, put the contents of skeleton.tar.gz and 


./src/plugins/fts-xapian/fts-xapian-plugin.h
./src/plugins/fts-xapian/fts-backend-xapian.cpp
./src/plugins/fts-xapian/Makefile.am
./src/plugins/fts-xapian/fts-backend-xapian-functions.cpp
./src/plugins/fts-xapian/fts-xapian-plugin.c

into src/ directory (included in skeleton.tar.gz), then put those into git.

You can compile it with 


autoreconf -vi
./configure --with-dovecot=/path/to/dovecot
make

Aki

On 13 January 2019 at 21:03 Joan Moreau  wrote:

THis is already what I send earlier (see : dovecot-xapian-1.0b2.tar.gz
[1 [1]]  ) 


What I would need is the files so one can download (git) it, and type
some command (make ?) to compile it and place it in the right forlder
(/usr/lib/dovecot/ or whatever is configured in the installed dovecot,
which may differ from distribution to distribution) 


On 2019-01-13 19:47, Aki Tuomi wrote:

You need the fts-xapian.c mostly. All the rest comes from automake (unless you 
decide to use cmake or something else).

I have attached you a skeleton plugin, which should work against dovecot master.

If you experience problems with the skeleton, let us know.

Aki

On 13 January 2019 at 20:23 Joan Moreau  wrote:

Ok for having a link on the FTS page.

PLease clarify what files are necessary to package it as a separate
package

On 2019-01-13 19:03, Aki Tuomi wrote:

Yes, from compiling point of view it is done.

Unfortunately what is not done is all the other work involved, such as fixing 
all the inevitable bugs it has and maintaining it. We do not want, at this 
moment, take up maintaining and developing yet another FTS plugin as we have 
plenty of things to do already.

I invite you to setup your own repository and provide this plugin from there, 
being the maintainer of this plugin. We can add a link to your plugin on our 
FTS page so people can also find it.

There are other plugins like this, e.g. 
https://github.com/st3fan/dovecot-xaps-plugin

Aki

On 13 January 2019 at 19:52 Joan Moreau  wrote:

The only point here of this fts-xapian is to get rid of solr (because it
is just a nightmare to setup) and squat (because it is considere
obsolete).

I already sent the changed in configure.ac, makefile.am, etc.. in order
to include it in the dovecot, and it compiles properly

The only remaining point is to push it in hte git (yes, everything is
already done)

On 2019-01-13 18:45, Aki Tuomi wrote:

On 13 January 2019 at 17:05 Joan Moreau via dovecot  wrote:

Hi

Please find attached the beta release of FTS Xapian, with the objective
to replace fts_squat that is being deprecated.

Configuration is exactly the same as for fts_squat:

plugin {

plugin = fts fts_xapian (...)
fts = xapian
fts_autoindex = yes
fts_enforced = yes
fts_xapian = partial=2 full=20

This is installed on my production server (>120Gb of mailboxes), and I
will observe it during the coming days.

I will definitely appreciate that this is added in the core git of
docevot, in order to have a versionning of it, to remove squat and let
basic users able to avoid Solr alternative as much as possible.

Thanks

JM
Hi!

I still recommend you setup a, say, github repository for your plugin. We are 
not able to currently include your work in dovecot core as it is more work than 
just pushing the code into the repo. Maybe it can be included in the future.

If you want, I can help you in setting up the required configuration scripts 
and such to make it possible to compile it as plugin.

Then anyone can download it and install it for their dovecot, even if dovecot 
itself has been installed from packages, and also makes it possible for package 
maintainers to consider including it in distributions.

Aki  


Links:
--
[1] https://grosjo.net/dovecot-xapian-1.0b2.tar.gz



Links:
--
[1] https://grosjo.net/dovecot-xapian-1.0b2.tar.gz

Re: Solr -> Xapian ?

2019-01-13 Thread Joan Moreau via dovecot
because fts_squat is set to be deleted 

Xapian and similar libraries offers a very easy interface for FTS 

(and basically, I have done it already) 


On 2019-01-07 18:31, Michael Slusarz wrote:

Maybe a dumb question (I admit I haven't followed this thread very closely)... 

But why are you writing a new FTS driver?  If squat allegedly does everything you need it to do, why don't you just take that plugin and fix it up to do what you need?  That seems way easier than trying to create a FTS driver from scratch. 

michael 

On January 7, 2019 at 7:05 AM Joan Moreau via dovecot  wrote: 

Hi 

ANyone to answer specifically ? 

Q1 : get_last_uid -> Is this the last UID indexed (which may be not the greatest value), or the gratest value (which may not be the latest) (the code of existing plugins is unclear about this, Solr looks for the greatest for insance) 

Q2 : WHen Indexing an email, the data is not passed by "build_key". Why so ? What is the link with "build_more" ? 

Q3 : Searching/Lookup : THe fheader in which to llok for (must be a least among "cc, to, from, subject, body") is not appearing in the 'struct' data. WHere to find it ? 

Q4 : Refresh : this is very unclear. How come there would not be the "latest" view on index. What is the real meaning of this function ? 

Q5 : Rescan : is it just a bout remonving all indexes for a specific mailbox ? 


Q6 : lokkup_multi : isn't the function the same for all plugnins (see below) ?

Re: [FTS Xapian] Beta release

2019-01-13 Thread Joan Moreau via dovecot

THis is already what I send earlier (see : dovecot-xapian-1.0b2.tar.gz
[1]  ) 


What I would need is the files so one can download (git) it, and type
some command (make ?) to compile it and place it in the right forlder
(/usr/lib/dovecot/ or whatever is configured in the installed dovecot,
which may differ from distribution to distribution) 


On 2019-01-13 19:47, Aki Tuomi wrote:


You need the fts-xapian.c mostly. All the rest comes from automake (unless you 
decide to use cmake or something else).

I have attached you a skeleton plugin, which should work against dovecot master.

If you experience problems with the skeleton, let us know.

Aki

On 13 January 2019 at 20:23 Joan Moreau  wrote:

Ok for having a link on the FTS page.

PLease clarify what files are necessary to package it as a separate
package

On 2019-01-13 19:03, Aki Tuomi wrote:

Yes, from compiling point of view it is done.

Unfortunately what is not done is all the other work involved, such as fixing 
all the inevitable bugs it has and maintaining it. We do not want, at this 
moment, take up maintaining and developing yet another FTS plugin as we have 
plenty of things to do already.

I invite you to setup your own repository and provide this plugin from there, 
being the maintainer of this plugin. We can add a link to your plugin on our 
FTS page so people can also find it.

There are other plugins like this, e.g. 
https://github.com/st3fan/dovecot-xaps-plugin

Aki

On 13 January 2019 at 19:52 Joan Moreau  wrote:

The only point here of this fts-xapian is to get rid of solr (because it
is just a nightmare to setup) and squat (because it is considere
obsolete).

I already sent the changed in configure.ac, makefile.am, etc.. in order
to include it in the dovecot, and it compiles properly

The only remaining point is to push it in hte git (yes, everything is
already done)

On 2019-01-13 18:45, Aki Tuomi wrote:

On 13 January 2019 at 17:05 Joan Moreau via dovecot  wrote:

Hi

Please find attached the beta release of FTS Xapian, with the objective
to replace fts_squat that is being deprecated.

Configuration is exactly the same as for fts_squat:

plugin {

plugin = fts fts_xapian (...)
fts = xapian
fts_autoindex = yes
fts_enforced = yes
fts_xapian = partial=2 full=20

This is installed on my production server (>120Gb of mailboxes), and I
will observe it during the coming days.

I will definitely appreciate that this is added in the core git of
docevot, in order to have a versionning of it, to remove squat and let
basic users able to avoid Solr alternative as much as possible.

Thanks

JM
Hi!

I still recommend you setup a, say, github repository for your plugin. We are 
not able to currently include your work in dovecot core as it is more work than 
just pushing the code into the repo. Maybe it can be included in the future.

If you want, I can help you in setting up the required configuration scripts 
and such to make it possible to compile it as plugin.

Then anyone can download it and install it for their dovecot, even if dovecot 
itself has been installed from packages, and also makes it possible for package 
maintainers to consider including it in distributions.

Aki



Links:
--
[1] https://grosjo.net/dovecot-xapian-1.0b2.tar.gz

Re: [FTS Xapian] Beta release

2019-01-13 Thread Joan Moreau via dovecot
Ok for having a link on the FTS page. 


PLease clarify what files are necessary to package it as a separate
package

On 2019-01-13 19:03, Aki Tuomi wrote:


Yes, from compiling point of view it is done.

Unfortunately what is not done is all the other work involved, such as fixing 
all the inevitable bugs it has and maintaining it. We do not want, at this 
moment, take up maintaining and developing yet another FTS plugin as we have 
plenty of things to do already.

I invite you to setup your own repository and provide this plugin from there, 
being the maintainer of this plugin. We can add a link to your plugin on our 
FTS page so people can also find it.

There are other plugins like this, e.g. 
https://github.com/st3fan/dovecot-xaps-plugin

Aki

On 13 January 2019 at 19:52 Joan Moreau  wrote:

The only point here of this fts-xapian is to get rid of solr (because it
is just a nightmare to setup) and squat (because it is considere
obsolete). 


I already sent the changed in configure.ac, makefile.am, etc.. in order
to include it in the dovecot, and it compiles properly 


The only remaining point is to push it in hte git (yes, everything is
already done) 


On 2019-01-13 18:45, Aki Tuomi wrote:

On 13 January 2019 at 17:05 Joan Moreau via dovecot  wrote:

Hi 


Please find attached the beta release of FTS Xapian, with the objective
to replace fts_squat that is being deprecated. 

Configuration is exactly the same as for fts_squat: 

plugin { 


plugin = fts fts_xapian (...)
fts = xapian
fts_autoindex = yes
fts_enforced = yes
fts_xapian = partial=2 full=20 


This is installed on my production server (>120Gb of mailboxes), and I
will observe it during the coming days. 


I will definitely appreciate that this is added in the core git of
docevot, in order to have a versionning of it, to remove squat and let
basic users able to avoid Solr alternative as much as possible. 

Thanks 

JM 
Hi!


I still recommend you setup a, say, github repository for your plugin. We are 
not able to currently include your work in dovecot core as it is more work than 
just pushing the code into the repo. Maybe it can be included in the future.

If you want, I can help you in setting up the required configuration scripts 
and such to make it possible to compile it as plugin.

Then anyone can download it and install it for their dovecot, even if dovecot 
itself has been installed from packages, and also makes it possible for package 
maintainers to consider including it in distributions.

Aki

Re: [FTS Xapian] Beta release

2019-01-13 Thread Joan Moreau via dovecot

The only point here of this fts-xapian is to get rid of solr (because it
is just a nightmare to setup) and squat (because it is considere
obsolete). 


I already sent the changed in configure.ac, makefile.am, etc.. in order
to include it in the dovecot, and it compiles properly 


The only remaining point is to push it in hte git (yes, everything is
already done) 


On 2019-01-13 18:45, Aki Tuomi wrote:


On 13 January 2019 at 17:05 Joan Moreau via dovecot  wrote:

Hi 


Please find attached the beta release of FTS Xapian, with the objective
to replace fts_squat that is being deprecated. 

Configuration is exactly the same as for fts_squat: 

plugin { 


plugin = fts fts_xapian (...)
fts = xapian
fts_autoindex = yes
fts_enforced = yes
fts_xapian = partial=2 full=20 


This is installed on my production server (>120Gb of mailboxes), and I
will observe it during the coming days. 


I will definitely appreciate that this is added in the core git of
docevot, in order to have a versionning of it, to remove squat and let
basic users able to avoid Solr alternative as much as possible. 

Thanks 


JM


Hi!

I still recommend you setup a, say, github repository for your plugin. We are 
not able to currently include your work in dovecot core as it is more work than 
just pushing the code into the repo. Maybe it can be included in the future.

If you want, I can help you in setting up the required configuration scripts 
and such to make it possible to compile it as plugin.

Then anyone can download it and install it for their dovecot, even if dovecot 
itself has been installed from packages, and also makes it possible for package 
maintainers to consider including it in distributions.

Aki

Indexing paralelism

2019-01-13 Thread Joan Moreau via dovecot
Hi 

Observing the processes of FTS, I observe the following: 


1 - For one user, indexer-wroker does not start several threads for each
request. On teh contrary, it waits for the first request to finish
before starting the second. How to make sure all requests (or a limited
number of it, for instance linked to the CPU number on the machine) are
started asap ? 


2 - If a IMAP query is received, the dovecot checks the last UID from
FTS and launch a request of indexing to finish the index *before*
running the search query . THis creates timeouts (and can take a while
if many request are pending - see point 1) How to prevent that (i.e. the
serach request is launched (read only) no matter what ? THe completeion
of missing UIDs is launched in a separate thread ? 


Thank you

[FTS Xapian] Beta release

2019-01-13 Thread Joan Moreau via dovecot
Hi 


Please find attached the beta release of FTS Xapian, with the objective
to replace fts_squat that is being deprecated. 

Configuration is exactly the same as for fts_squat: 

plugin { 


plugin = fts fts_xapian (...)
fts = xapian
fts_autoindex = yes
fts_enforced = yes
fts_xapian = partial=2 full=20 


This is installed on my production server (>120Gb of mailboxes), and I
will observe it during the coming days. 


I will definitely appreciate that this is added in the core git of
docevot, in order to have a versionning of it, to remove squat and let
basic users able to avoid Solr alternative as much as possible. 

Thanks 


JM

dovecot-xapian.tar.gz
Description: GNU Zip compressed data


Re: Solr -> Xapian ?

2019-01-13 Thread Joan Moreau via dovecot

I found the solution o this using
SEQ_RANGE_ARRAY_ADD(>DEFINITE_UIDS, UID); 


Now, I can see in the logs that several times, the dovecot calls the
fts_backend_xapian_update_set_mailbox with box == NULL. WHy so ? 

THank you 


On 2019-01-12 21:40, Joan Moreau via dovecot wrote:

I somehow fixed the folder issue. (seems some unix rights after too many tests) 

Getting back on the "fts_results" structure: 

I am trying: 


I_ARRAY_INIT(&(RESULT->DEFINITE_UIDS),R->SIZE);
I_ARRAY_INIT(&(RESULT->MAYBE_UIDS),0); 


uint32_t uid;
for(i=0;isize;i++)
{
try
{
uid=atol(backend->dbr->get_document(r->data[i]).get_value(1).c_str());
i_warning("Rresult UID=%d",uid);
ARRAY_IDX_SET(&(RESULT->DEFINITE_UIDS),I,);
}
catch(Xapian::Error e)
{
i_warning(e.get_msg().c_str());
}
} 

I can see in hte log that UID are properly found on Xapian database, but no results are transmitted to dovecot and to the imap client (roundcube in my case) 

Help please :) 

On 2019-01-12 18:15, Joan Moreau wrote: 

additionally, my logic is that the backend stores one databalse per mailox in /xapian-indexes (in the "root" dir of the user), the name od the database is the GUID of the mailbox 

For INBOX, that works perfectly, and database is properly createdm and backed starts indexing all emails 

For other folder, somehow, the process can not access that (root) folder. 

Am I missing something ? 

On 2019-01-12 17:37, Joan Moreau wrote: 

THank you 

Now, for the results 

I see the member of fts_result is : 


ARRAY_TYPE(seq_range) definite_uids;

I have the UID as a aray of uint32_t * 

How to put my UIDs into this "definite_uids" ? Obviously this is not a simple array/pointer. How to say someting similar to result->definite_uids[1]=my_uid ? 

On 2019-01-12 10:25, Timo Sirainen wrote: 
On 11 Jan 2019, at 21.23, Joan Moreau via dovecot  wrote: 
The below patch resolves the compilation error


$ diff -p compat.h compat.h.joan 
*** compat.h 2019-01-11 20:21:00.726625427 +0100

--- compat.h.joan 2019-01-11 20:14:41.729109919 +0100
*** struct iovec;
*** 202,207 
--- 202,211 
ssize_t i_my_writev(int fd, const struct iovec *iov, int iov_len);
#endif

+ #ifdef __cplusplus
+ extern "C" {
+ #endif

You should put this extern "C" into the C++ file you're creating. See for 
example how fts-lucene/lucene-wrapper.cc does this.

1 - WHat does represent "subargs" in mail_search_args 
It's set only for SEARCH_OR and SEARCH_SUB. So for example:


SEARCH TEXT foo TEXT bar TEXT baz

results in:

type=SEARCH_SUB
value.subargs = (
{ type=SEARCH, value.str="foo" },
{ type=SEARCH, value.str="bar" },
{ type=SEARCH, value.str="baz" },
)

Or similarly if there's SEARCH OR foo OR TEXT bar TEXT baz or some other 
combination of OR/ANDs.
2 - for rescan : who is responsible for passing again the new email ? Is
the Dovecot core sending again all the emails to index ? or the fts
shall somehow access the mailbox and read all emails ? Wouldn't just be
saying "delete all index and get_last_uid is now 0" the easy way ? or
the fts must process all emails (and block the current thread as a
mailbx maybe quite large) 
The next indexing run is responsible for it. If you return get_last_uid=0, then indexer starts feeding you all mails. So fts backend doesn't have to know about it.


3 - for get_last_uid : this uncertainity is very unclear. "If there is a
gap, then indexer first indexes all the missing" -> this mean at a
certain point, indexer maybe rebuilding a previous email, so *last* uid
is something different than max. And how indexer does know whther there
is a gap wihtout callong the fts backend (whch it does not as there are
no function for that) ? 
I mean if get_last_uid() returns for example 100, it means that UIDs 1..100 have been indexed by the FTS backend. It's possible that at this point there are already mails with UIDs 101..200 in the folder. So when UID=201 is delivered, indexer notices that FTS backend has only UIDs 1..100 indexed so far, and starts feeding it UIDs 101..201 in that order.


You can implement get_last_uid() simply by keeping track of it in 
dovecot.index* files, similar to how Lucene and Solr already do it with 
fts_index_get_header() / fts_index_set_header(). They also have a fallback that 
if the index doesn't have the last_uid value, they do a slower search from the 
Lucene/Solr index to find the last UID.

Re: Solr -> Xapian ?

2019-01-12 Thread Joan Moreau via dovecot

I somehow fixed the folder issue. (seems some unix rights after too many
tests) 

Getting back on the "fts_results" structure: 

I am trying: 


I_ARRAY_INIT(&(RESULT->DEFINITE_UIDS),R->SIZE);
I_ARRAY_INIT(&(RESULT->MAYBE_UIDS),0); 


uint32_t uid;
for(i=0;isize;i++)
{
  try
  {

uid=atol(backend->dbr->get_document(r->data[i]).get_value(1).c_str());

 i_warning("Rresult UID=%d",uid);
 ARRAY_IDX_SET(&(RESULT->DEFINITE_UIDS),I,);
  }
  catch(Xapian::Error e)
  {
 i_warning(e.get_msg().c_str());
  }
} 


I can see in hte log that UID are properly found on Xapian database, but
no results are transmitted to dovecot and to the imap client (roundcube
in my case) 

Help please :) 


On 2019-01-12 18:15, Joan Moreau wrote:

additionally, my logic is that the backend stores one databalse per mailox in /xapian-indexes (in the "root" dir of the user), the name od the database is the GUID of the mailbox 

For INBOX, that works perfectly, and database is properly createdm and backed starts indexing all emails 

For other folder, somehow, the process can not access that (root) folder. 

Am I missing something ? 

On 2019-01-12 17:37, Joan Moreau wrote: 

THank you 

Now, for the results 

I see the member of fts_result is : 


ARRAY_TYPE(seq_range) definite_uids;

I have the UID as a aray of uint32_t * 

How to put my UIDs into this "definite_uids" ? Obviously this is not a simple array/pointer. How to say someting similar to result->definite_uids[1]=my_uid ? 

On 2019-01-12 10:25, Timo Sirainen wrote: 
On 11 Jan 2019, at 21.23, Joan Moreau via dovecot  wrote: 
The below patch resolves the compilation error


$ diff -p compat.h compat.h.joan 
*** compat.h 2019-01-11 20:21:00.726625427 +0100

--- compat.h.joan 2019-01-11 20:14:41.729109919 +0100
*** struct iovec;
*** 202,207 
--- 202,211 
ssize_t i_my_writev(int fd, const struct iovec *iov, int iov_len);
#endif

+ #ifdef __cplusplus
+ extern "C" {
+ #endif

You should put this extern "C" into the C++ file you're creating. See for 
example how fts-lucene/lucene-wrapper.cc does this.

1 - WHat does represent "subargs" in mail_search_args 
It's set only for SEARCH_OR and SEARCH_SUB. So for example:


SEARCH TEXT foo TEXT bar TEXT baz

results in:

type=SEARCH_SUB
value.subargs = (
{ type=SEARCH, value.str="foo" },
{ type=SEARCH, value.str="bar" },
{ type=SEARCH, value.str="baz" },
)

Or similarly if there's SEARCH OR foo OR TEXT bar TEXT baz or some other 
combination of OR/ANDs.
2 - for rescan : who is responsible for passing again the new email ? Is
the Dovecot core sending again all the emails to index ? or the fts
shall somehow access the mailbox and read all emails ? Wouldn't just be
saying "delete all index and get_last_uid is now 0" the easy way ? or
the fts must process all emails (and block the current thread as a
mailbx maybe quite large) 
The next indexing run is responsible for it. If you return get_last_uid=0, then indexer starts feeding you all mails. So fts backend doesn't have to know about it.


3 - for get_last_uid : this uncertainity is very unclear. "If there is a
gap, then indexer first indexes all the missing" -> this mean at a
certain point, indexer maybe rebuilding a previous email, so *last* uid
is something different than max. And how indexer does know whther there
is a gap wihtout callong the fts backend (whch it does not as there are
no function for that) ? 
I mean if get_last_uid() returns for example 100, it means that UIDs 1..100 have been indexed by the FTS backend. It's possible that at this point there are already mails with UIDs 101..200 in the folder. So when UID=201 is delivered, indexer notices that FTS backend has only UIDs 1..100 indexed so far, and starts feeding it UIDs 101..201 in that order.


You can implement get_last_uid() simply by keeping track of it in 
dovecot.index* files, similar to how Lucene and Solr already do it with 
fts_index_get_header() / fts_index_set_header(). They also have a fallback that 
if the index doesn't have the last_uid value, they do a slower search from the 
Lucene/Solr index to find the last UID.

Re: Solr -> Xapian ?

2019-01-12 Thread Joan Moreau via dovecot

additionally, my logic is that the backend stores one databalse per
mailox in /xapian-indexes (in the "root" dir of the user), the name od
the database is the GUID of the mailbox 


For INBOX, that works perfectly, and database is properly createdm and
backed starts indexing all emails 


For other folder, somehow, the process can not access that (root)
folder. 

Am I missing something ? 


On 2019-01-12 17:37, Joan Moreau wrote:

THank you 

Now, for the results 

I see the member of fts_result is : 


ARRAY_TYPE(seq_range) definite_uids;

I have the UID as a aray of uint32_t * 

How to put my UIDs into this "definite_uids" ? Obviously this is not a simple array/pointer. How to say someting similar to result->definite_uids[1]=my_uid ? 

On 2019-01-12 10:25, Timo Sirainen wrote: 
On 11 Jan 2019, at 21.23, Joan Moreau via dovecot  wrote: 
The below patch resolves the compilation error


$ diff -p compat.h compat.h.joan 
*** compat.h 2019-01-11 20:21:00.726625427 +0100

--- compat.h.joan 2019-01-11 20:14:41.729109919 +0100
*** struct iovec;
*** 202,207 
--- 202,211 
ssize_t i_my_writev(int fd, const struct iovec *iov, int iov_len);
#endif

+ #ifdef __cplusplus
+ extern "C" {
+ #endif

You should put this extern "C" into the C++ file you're creating. See for 
example how fts-lucene/lucene-wrapper.cc does this.

1 - WHat does represent "subargs" in mail_search_args 
It's set only for SEARCH_OR and SEARCH_SUB. So for example:


SEARCH TEXT foo TEXT bar TEXT baz

results in:

type=SEARCH_SUB
value.subargs = (
{ type=SEARCH, value.str="foo" },
{ type=SEARCH, value.str="bar" },
{ type=SEARCH, value.str="baz" },
)

Or similarly if there's SEARCH OR foo OR TEXT bar TEXT baz or some other 
combination of OR/ANDs.
2 - for rescan : who is responsible for passing again the new email ? Is
the Dovecot core sending again all the emails to index ? or the fts
shall somehow access the mailbox and read all emails ? Wouldn't just be
saying "delete all index and get_last_uid is now 0" the easy way ? or
the fts must process all emails (and block the current thread as a
mailbx maybe quite large) 
The next indexing run is responsible for it. If you return get_last_uid=0, then indexer starts feeding you all mails. So fts backend doesn't have to know about it.


3 - for get_last_uid : this uncertainity is very unclear. "If there is a
gap, then indexer first indexes all the missing" -> this mean at a
certain point, indexer maybe rebuilding a previous email, so *last* uid
is something different than max. And how indexer does know whther there
is a gap wihtout callong the fts backend (whch it does not as there are
no function for that) ? 
I mean if get_last_uid() returns for example 100, it means that UIDs 1..100 have been indexed by the FTS backend. It's possible that at this point there are already mails with UIDs 101..200 in the folder. So when UID=201 is delivered, indexer notices that FTS backend has only UIDs 1..100 indexed so far, and starts feeding it UIDs 101..201 in that order.


You can implement get_last_uid() simply by keeping track of it in 
dovecot.index* files, similar to how Lucene and Solr already do it with 
fts_index_get_header() / fts_index_set_header(). They also have a fallback that 
if the index doesn't have the last_uid value, they do a slower search from the 
Lucene/Solr index to find the last UID.

Re: Solr -> Xapian ?

2019-01-12 Thread Joan Moreau via dovecot
THank you 

Now, for the results 

I see the member of fts_result is : 


ARRAY_TYPE(seq_range) definite_uids;

I have the UID as a aray of uint32_t * 


How to put my UIDs into this "definite_uids" ? Obviously this is not a
simple array/pointer. How to say someting similar to
result->definite_uids[1]=my_uid ? 


On 2019-01-12 10:25, Timo Sirainen wrote:

On 11 Jan 2019, at 21.23, Joan Moreau via dovecot  wrote: 


The below patch resolves the compilation error

$ diff -p compat.h compat.h.joan 
*** compat.h 2019-01-11 20:21:00.726625427 +0100

--- compat.h.joan 2019-01-11 20:14:41.729109919 +0100
*** struct iovec;
*** 202,207 
--- 202,211 
ssize_t i_my_writev(int fd, const struct iovec *iov, int iov_len);
#endif

+ #ifdef __cplusplus
+ extern "C" {
+ #endif


You should put this extern "C" into the C++ file you're creating. See for 
example how fts-lucene/lucene-wrapper.cc does this.


1 - WHat does represent "subargs" in mail_search_args


It's set only for SEARCH_OR and SEARCH_SUB. So for example:

SEARCH TEXT foo TEXT bar TEXT baz

results in:

type=SEARCH_SUB
value.subargs = (
{ type=SEARCH, value.str="foo" },
{ type=SEARCH, value.str="bar" },
{ type=SEARCH, value.str="baz" },
)

Or similarly if there's SEARCH OR foo OR TEXT bar TEXT baz or some other 
combination of OR/ANDs.


2 - for rescan : who is responsible for passing again the new email ? Is
the Dovecot core sending again all the emails to index ? or the fts
shall somehow access the mailbox and read all emails ? Wouldn't just be
saying "delete all index and get_last_uid is now 0" the easy way ? or
the fts must process all emails (and block the current thread as a
mailbx maybe quite large)


The next indexing run is responsible for it. If you return get_last_uid=0, then 
indexer starts feeding you all mails. So fts backend doesn't have to know about 
it.


3 - for get_last_uid : this uncertainity is very unclear. "If there is a
gap, then indexer first indexes all the missing" -> this mean at a
certain point, indexer maybe rebuilding a previous email, so *last* uid
is something different than max. And how indexer does know whther there
is a gap wihtout callong the fts backend (whch it does not as there are
no function for that) ?


I mean if get_last_uid() returns for example 100, it means that UIDs 1..100 
have been indexed by the FTS backend. It's possible that at this point there 
are already mails with UIDs 101..200 in the folder. So when UID=201 is 
delivered, indexer notices that FTS backend has only UIDs 1..100 indexed so 
far, and starts feeding it UIDs 101..201 in that order.

You can implement get_last_uid() simply by keeping track of it in 
dovecot.index* files, similar to how Lucene and Solr already do it with 
fts_index_get_header() / fts_index_set_header(). They also have a fallback that 
if the index doesn't have the last_uid value, they do a slower search from the 
Lucene/Solr index to find the last UID.

Re: [FTS Xapian] Status & Questions

2019-01-12 Thread Joan Moreau via dovecot

Sorted this out. sorry for noise

On 2019-01-12 11:39, Joan Moreau wrote:

The change of "Extern C" suggested by Timo actually solved the situation 

Now, further question : 

I put a "i_warning" at each of my functions, and I see in the log : 


Jan 12 10:33:27 
indexer-worker(j...@grosjo.net)<30970>:
 Warning: fts_backend_xapian_alloc
Jan 12 10:33:27 
indexer-worker(j...@grosjo.net)<30970>:
 Warning: fts_backend_xapian_init
Jan 12 10:33:27 
indexer-worker(j...@grosjo.net)<30970>:
 Warning: fts_xapian init (3,25)
Jan 12 10:33:27 
indexer-worker(j...@grosjo.net)<30970>:
 Warning: fts_backend_xapian_get_last_uid
Jan 12 10:33:27 
indexer-worker(j...@grosjo.net)<30970>:
 Error: Mailbox XXX: Status lookup failed: Internal error occurred. Refer to server log for 
more information. [2019-01-12 10:33:27]
Jan 12 10:33:27 
indexer-worker(j...@grosjo.net)<30970>:
 Warning: fts_backend_xapian_deinit
Jan 12 10:33:27 
indexer-worker(j...@grosjo.net)<30970>:
 Warning: fts_backend_xapian_unset_box
Jan 12 10:33:27 lda(j...@grosjo.net)<31367>: Warning: fts_backend_xapian_deinit 

The error comes from the fact taht the "get_last_uid" is called without selecting a mailbox first, and therefore there is of course no uid. 

How come ? 

On 2019-01-12 10:50, Aki Tuomi wrote: 
Did you remember to load fts first? 

mail_plugins =$mail_plugins fts fts_xapian 

Aki 
On 12 January 2019 at 10:37 Joan Moreau via dovecot < dovecot@dovecot.org> wrote: 

STATUS 

- Alpha code is written and compiling now. (attached) 

- I would like to start testing. However, there is an error when 
starting dovecot (git) : 

Error: Couldn't load required plugin 
/usr/lib/dovecot/lib21_fts_xapian_plugin.so: dlopen() failed: 
/usr/lib/dovecot/lib21_fts_xapian_plugin.so: undefined symbol: 
_Z30fts_backend_default_can_lookupP11fts_backendPK15mail_search_arg 

ldd shows that fts lib is properly linked: 
# ldd /usr/lib/dovecot/lib21_fts_xapian_plugin.so 
(...) 
lib20_fts_plugin.so => /usr/lib/dovecot/lib20_fts_plugin.so 
(0x7f25f75e) 
(...) 
libxapian.so.30 => /usr/lib/libxapian.so.30 (0x7fe3a51e2000) 

Your help very welcome 

PENDING QUESTIONS 

1 - WHat does represent "subargs" in mail_search_args 

2 - for rescan : who is responsible for passing again the new email ? Is 

the Dovecot core sending again all the emails to index ? or the fts 
shall somehow access the mailbox and read all emails ? Wouldn't just be 
saying "delete all index and get_last_uid is now 0" the easy way ? or 
the fts must process all emails (and block the current thread as a 
mailbx maybe quite large) 

3 - for get_last_uid : this uncertainity is very unclear. "If there is a 

gap, then indexer first indexes all the missing" -> this mean at a 
certain point, indexer maybe rebuilding a previous email, so *last* uid 
is something different than max. And how indexer does know whther there 
is a gap wihtout callong the fts backend (whch it does not as there are 
no function for that) ? 

Thank you 

--- 
Aki Tuomi

Re: [FTS Xapian] Status & Questions

2019-01-12 Thread Joan Moreau via dovecot

The change of "Extern C" suggested by Timo actually solved the situation


Now, further question : 

I put a "i_warning" at each of my functions, and I see in the log : 


Jan 12 10:33:27
indexer-worker(j...@grosjo.net)<30970>:
Warning: fts_backend_xapian_alloc
Jan 12 10:33:27
indexer-worker(j...@grosjo.net)<30970>:
Warning: fts_backend_xapian_init
Jan 12 10:33:27
indexer-worker(j...@grosjo.net)<30970>:
Warning: fts_xapian init (3,25)
Jan 12 10:33:27
indexer-worker(j...@grosjo.net)<30970>:
Warning: fts_backend_xapian_get_last_uid
Jan 12 10:33:27
indexer-worker(j...@grosjo.net)<30970>:
Error: Mailbox XXX: Status lookup failed: Internal error occurred. Refer
to server log for more information. [2019-01-12 10:33:27]
Jan 12 10:33:27
indexer-worker(j...@grosjo.net)<30970>:
Warning: fts_backend_xapian_deinit
Jan 12 10:33:27
indexer-worker(j...@grosjo.net)<30970>:
Warning: fts_backend_xapian_unset_box
Jan 12 10:33:27 lda(j...@grosjo.net)<31367>:
Warning: fts_backend_xapian_deinit 


The error comes from the fact taht the "get_last_uid" is called without
selecting a mailbox first, and therefore there is of course no uid. 

How come ? 


On 2019-01-12 10:50, Aki Tuomi wrote:

Did you remember to load fts first? 

mail_plugins =$mail_plugins fts fts_xapian 

Aki 

On 12 January 2019 at 10:37 Joan Moreau via dovecot < dovecot@dovecot.org> wrote: 

STATUS 

- Alpha code is written and compiling now. (attached) 

- I would like to start testing. However, there is an error when 
starting dovecot (git) : 

Error: Couldn't load required plugin 
/usr/lib/dovecot/lib21_fts_xapian_plugin.so: dlopen() failed: 
/usr/lib/dovecot/lib21_fts_xapian_plugin.so: undefined symbol: 
_Z30fts_backend_default_can_lookupP11fts_backendPK15mail_search_arg 

ldd shows that fts lib is properly linked: 
# ldd /usr/lib/dovecot/lib21_fts_xapian_plugin.so 
(...) 
lib20_fts_plugin.so => /usr/lib/dovecot/lib20_fts_plugin.so 
(0x7f25f75e) 
(...) 
libxapian.so.30 => /usr/lib/libxapian.so.30 (0x7fe3a51e2000) 

Your help very welcome 

PENDING QUESTIONS 

1 - WHat does represent "subargs" in mail_search_args 

2 - for rescan : who is responsible for passing again the new email ? Is 

the Dovecot core sending again all the emails to index ? or the fts 
shall somehow access the mailbox and read all emails ? Wouldn't just be 
saying "delete all index and get_last_uid is now 0" the easy way ? or 
the fts must process all emails (and block the current thread as a 
mailbx maybe quite large) 

3 - for get_last_uid : this uncertainity is very unclear. "If there is a 

gap, then indexer first indexes all the missing" -> this mean at a 
certain point, indexer maybe rebuilding a previous email, so *last* uid 
is something different than max. And how indexer does know whther there 
is a gap wihtout callong the fts backend (whch it does not as there are 
no function for that) ? 


Thank you


--- 
Aki Tuomi

[FTS Xapian] Status & Questions

2019-01-12 Thread Joan Moreau via dovecot
STATUS 

- Alpha code is written and compiling now. (attached) 


- I would like to start testing. However, there is an error when
starting dovecot (git) : 


Error: Couldn't load required plugin
/usr/lib/dovecot/lib21_fts_xapian_plugin.so: dlopen() failed:
/usr/lib/dovecot/lib21_fts_xapian_plugin.so: undefined symbol:
_Z30fts_backend_default_can_lookupP11fts_backendPK15mail_search_arg 

ldd shows that  fts lib is properly linked: 
# ldd /usr/lib/dovecot/lib21_fts_xapian_plugin.so 
(...) 
lib20_fts_plugin.so => /usr/lib/dovecot/lib20_fts_plugin.so

(0x7f25f75e)
(...) 
libxapian.so.30 => /usr/lib/libxapian.so.30 (0x7fe3a51e2000) 

Your help very welcome 

PENDING QUESTIONS 

1 - WHat does represent "subargs" in mail_search_args 


2 - for rescan : who is responsible for passing again the new email ? Is

the Dovecot core sending again all the emails to index ? or the fts 
shall somehow access the mailbox and read all emails ? Wouldn't just be 
saying "delete all index and get_last_uid is now 0" the easy way ? or 
the fts must process all emails (and block the current thread as a 
mailbx maybe quite large) 


3 - for get_last_uid : this uncertainity is very unclear. "If there is a

gap, then indexer first indexes all the missing" -> this mean at a 
certain point, indexer maybe rebuilding a previous email, so *last* uid 
is something different than max. And how indexer does know whther there 
is a gap wihtout callong the fts backend (whch it does not as there are 
no function for that) ? 


Thank you

dovecot-xapian.tar.gz
Description: GNU Zip compressed data


Re: Solr -> Xapian ?

2019-01-11 Thread Joan Moreau via dovecot
The below patch resolves the compilation error 

$ DIFF -P COMPAT.H COMPAT.H.JOAN 
*** compat.h 2019-01-11 20:21:00.726625427 +0100

--- compat.h.joan 2019-01-11 20:14:41.729109919 +0100
*** struct iovec;
*** 202,207 
--- 202,211 
ssize_t i_my_writev(int fd, const struct iovec *iov, int iov_len);
#endif

+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+ 
#if !defined(HAVE_PREAD) || defined(PREAD_WRAPPERS) ||

defined(PREAD_BROKEN)
# ifndef IN_COMPAT_C
# define pread i_my_pread
*** ssize_t i_my_pread(int fd, void *buf, si
*** 211,216 
--- 215,225 
ssize_t i_my_pwrite(int fd, const void *buf, size_t count, off_t
offset);
#endif

+ #ifdef __cplusplus
+ }
+ #endif
+ 
+ 
#ifndef HAVE_SETEUID

# define seteuid i_my_seteuid
int i_my_seteuid(uid_t euid); 


To resolve integration in source tree, the following diff resolve the
case: 

$ DIFF -P CONFIGURE.AC CONFIGURE.AC.JOAN 
*** configure.ac 2019-01-11 20:19:47.905942264 +0100

--- configure.ac.joan 2019-01-11 17:54:58.433381828 +0100
*** AS_HELP_STRING([--with-solr], [Build wit
*** 172,177 
--- 172,184 
TEST_WITH(solr, $withval),
want_solr=no)

+ AC_ARG_WITH(xapian,
+ AS_HELP_STRING([--with-xapian], [Build with Xapian full text search
support]),
+ TEST_WITH(xapian, $withval),
+ want_xapian=auto)
+ AM_CONDITIONAL(BUILD_XAPIAN, test "$want_xapian" = "yes")
+ 
+ 
AC_ARG_WITH(sodium,

AS_HELP_STRING([--with-sodium], [Build with libsodium support (enables
argon2, default: auto)]),
TEST_WITH(sodium, $withval),
*** DOVECOT_WANT_SOLR
*** 746,751 
--- 753,759 
DOVECOT_WANT_CLUCENE
DOVECOT_WANT_STEMMER
DOVECOT_WANT_TEXTCAT
+ DOVECOT_WANT_XAPIAN

DOVECOT_WANT_ICU

*** fi
*** 757,762 
--- 765,774 
if test $have_solr = no; then
not_fts="$not_fts solr"
fi
+ if test $have_xapian = no; then
+ not_fts="$not_fts xapian"
+ fi
+ 


dnl **
dnl ** Settings
*** src/plugins/fs-compress/Makefile
*** 899,904 
--- 911,917 
src/plugins/fts/Makefile
src/plugins/fts-lucene/Makefile
src/plugins/fts-solr/Makefile
+ src/plugins/fts-xapian/Makefile
src/plugins/fts-squat/Makefile
src/plugins/last-login/Makefile
src/plugins/lazy-expunge/Makefile 

$ DIFF -P MAKEFILE.AM MAKEFILE.AM.JOAN 
*** Makefile.am 2019-01-11 20:22:23.910740574 +0100

--- Makefile.am.joan 2019-01-11 17:51:19.051153270 +0100
*** DISTCLEANFILES = \
*** 99,105 
distcheck-hook:
if which scan-build > /dev/null; then \
cd $(distdir)/_build; \
! scan-build -o scan-reports ../configure --with-ldap=auto
--with-pgsql=auto --with-mysql=auto --with-sqlite=auto --with-solr=auto
--with-gssapi=auto --with-libwrap=auto; \
rm -rf scan-reports; \
scan-build -o scan-reports make 2>&1 || exit 1; \
if ! rmdir scan-reports 2>/dev/null; then \
--- 99,105 
distcheck-hook:
if which scan-build > /dev/null; then \
cd $(distdir)/_build; \
! scan-build -o scan-reports ../configure --with-ldap=auto
--with-pgsql=auto --with-mysql=auto --with-sqlite=auto --with-solr=auto
--with-xapian=auto --with-gssapi=auto --with-libwrap=auto; \
rm -rf scan-reports; \
scan-build -o scan-reports make 2>&1 || exit 1; \
if ! rmdir scan-reports 2>/dev/null; then \ 


WHAT ABOUT THE OTHER QUESTIONS ?

1 - WHat does represent "subargs" in mail_search_args 


2 - for rescan : who is responsible for passing again the new email ? Is

the Dovecot core sending again all the emails to index ? or the fts 
shall somehow access the mailbox and read all emails ? Wouldn't just be 
saying "delete all index and get_last_uid is now 0" the easy way ? or 
the fts must process all emails (and block the current thread as a 
mailbx maybe quite large) 


3 - for get_last_uid : this uncertainity is very unclear. "If there is a

gap, then indexer first indexes all the missing" -> this mean at a 
certain point, indexer maybe rebuilding a previous email, so *last* uid 
is something different than max. And how indexer does know whther there 
is a gap wihtout callong the fts backend (whch it does not as there are 
no function for that) ? 

Thank you 


On 2019-01-11 18:27, Joan Moreau wrote:

There is no point into a separate plugin, the purpose is to replace squat as the default fts (solr being a nightmare) 

On 2019-01-11 18:23, Aki Tuomi wrote: 
I would recommend making this a standalone plugin for now instead of trying to keep it in core fts.  

Aki 
On 11 January 2019 at 18:40 Joan Moreau via dovecot < dovecot@dovecot.org> wrote: 

I managed to deal with the namespace issue (updated makefile.am) 

However, I reach : 

../../../src/lib/compat.h:207:19: error: conflicting declaration of 
'ssize_t i_my_pread(int, void*, size_t, __off_t)' with 'C' linkage 
# define pread i_my_pread 
^~ 
../../../src/lib/compat.h:210:9: note: previous declaration with 'C++' 
linkage 
ssize_t i_my_pread(int fd, void *buf, size_t count, off_t offset); 
^~ 

Re: Solr -> Xapian ?

2019-01-11 Thread Joan Moreau via dovecot

There is no point into a separate plugin, the purpose is to replace
squat as the default fts (solr being a nightmare) 


On 2019-01-11 18:23, Aki Tuomi wrote:

I would recommend making this a standalone plugin for now instead of trying to keep it in core fts.  

Aki 

On 11 January 2019 at 18:40 Joan Moreau via dovecot < dovecot@dovecot.org> wrote: 

I managed to deal with the namespace issue (updated makefile.am) 

However, I reach : 

../../../src/lib/compat.h:207:19: error: conflicting declaration of 
'ssize_t i_my_pread(int, void*, size_t, __off_t)' with 'C' linkage 
# define pread i_my_pread 
^~ 
../../../src/lib/compat.h:210:9: note: previous declaration with 'C++' 
linkage 
ssize_t i_my_pread(int fd, void *buf, size_t count, off_t offset); 
^~ 
../../../src/lib/compat.h:208:20: error: conflicting declaration of 
'ssize_t i_my_pwrite(int, const void*, size_t, __off_t)' with 'C' 
linkage 
# define pwrite i_my_pwrite 

Any help welcome 

Hi, 

I figured out the "namespace" issue 

Remaining questions are : 

1 - WHat does represent "subargs" in mail_search_args 

2 - for rescan : who is responsible for passing again the new email ? Is 
the Dovecot core sending again all the emails to index ? or the fts 
shall somehow access the mailbox and read all emails ? Wouldn't just be 
saying "delete all index and get_last_uid is now 0" the easy way ? or 
the fts must process all emails (and block the current thread as a 
mailbx maybe quite large) 

3 - for get_last_uid : this uncertainity is very unclear. "If there is a 
gap, then indexer first indexes all the missing" -> this mean at a 
certain point, indexer maybe rebuilding a previous email, so *last* uid 
is something different than max. And how indexer does know whther there 
is a gap wihtout callong the fts backend (whch it does not as there are 
no function for that) ? 

4 - How to update configure.ac & additional files to add the 
"--with-xapian" wichi will test for libxapian presence and add it to the 
build ? 

Thank you 

On 2019-01-08 04:24, Timo Sirainen wrote: 

On 7 Jan 2019, at 16.05, Joan Moreau via dovecot < dovecot@dovecot.org> 
wrote: 
Hi 

ANyone to answer specifically ? 

Q1 : get_last_uid -> Is this the last UID indexed (which may be not the 
greatest value), or the gratest value (which may not be the latest) (the 
code of existing plugins is unclear about this, Solr looks for the 
greatest for insance) 
All the mails are always supposed to be indexed from the beginning to 
the last indexed mail. If there's a gap, indexer first indexes all the 
missing mails. So the latest UID is supposed to be the greatest UID. 
(Supporting out-of-order indexing would be rather difficult to keep 
track of.) 

Q2 : WHen Indexing an email, the data is not passed by "build_key". Why 
so ? What is the link with "build_more" ? 
The idea is that it calls something like: 

- build_key(type=hdr, hdr_name=From) 
- build_more(" t...@iki.fi") 
- build_key(type=hdr, hdr_name=Subject) 
- build_more("Re: Solr -> Xapian ?") 
- build_key(type=body_part) 
- build_more("message body piece") 
- build_more("message body piece2") 
... 

Q3 : Searching/Lookup : THe fheader in which to llok for (must be a 
least among "cc, to, from, subject, body") is not appearing in the 
'struct' data. WHere to find it ? 
lookup() gets struct mail_search_arg *args, which contains the entire 
IMAP SEARCH query. This could be used for more or less complex query 
builders. 

In case of a single header search, you should have 
args->args->hdr_field_name contain the header name and 
args->args->value.str contain the content you're searching for. 

Q4 : Refresh : this is very unclear. How come there would not be the 
"latest" view on index. What is the real meaning of this function ? 
In case of Xapian it might not matter if it automatically refreshes its 
indexes between each query. But with some other indexes this could 
happen: 

- IMAP session is opened 
- IMAP SEARCH is run, which opens and searches the index 
- a new mail is delivered to the mailbox and indexed 
- IMAP SEARCH is run. Without refresh() it doesn't see the newly 
indexed mail and doesn't include it in the search results. 

Q5 : Rescan : is it just a bout remonving all indexes for a specific 
mailbox ? 
It's run when "doveadm fts rescan" is run manually. Usually that's only 
run manually to fix up some brokenness. So it's intended to verify that 
the current mailbox contents match the FTS indexes: 
- If there are any mails in FTS index that no longer exist in the 
actual mailbox, delete those mails from FTS 
- If FTS is missing any mails in the middle of the mailbox, make sure 
that the next mailbox indexing will index those missing mails. I think 
currently this basically means reindexing all the mails since the first 
missing 

Re: Solr -> Xapian ?

2019-01-11 Thread Joan Moreau via dovecot

I managed to deal with the namespace issue (updated makefile.am)

However, I reach : 


../../../src/lib/compat.h:207:19: error: conflicting declaration of
'ssize_t i_my_pread(int, void*, size_t, __off_t)' with 'C' linkage
# define pread i_my_pread
^~
../../../src/lib/compat.h:210:9: note: previous declaration with 'C++'
linkage
ssize_t i_my_pread(int fd, void *buf, size_t count, off_t offset);
^~
../../../src/lib/compat.h:208:20: error: conflicting declaration of
'ssize_t i_my_pwrite(int, const void*, size_t, __off_t)' with 'C'
linkage
# define pwrite i_my_pwrite 

Any help welcome 

Hi, 

I figured out the "namespace" issue 

Remaining questions are : 

1 - WHat does represent "subargs" in mail_search_args 


2 - for rescan : who is responsible for passing again the new email ? Is
the Dovecot core sending again all the emails to index ? or the fts
shall somehow access the mailbox and read all emails ? Wouldn't just be
saying "delete all index and get_last_uid is now 0" the easy way ? or
the fts must process all emails (and block the current thread as a
mailbx maybe quite large) 


3 - for get_last_uid : this uncertainity is very unclear. "If there is a
gap, then indexer first indexes all the missing" -> this mean at a
certain point, indexer maybe rebuilding a previous email, so *last* uid
is something different than max. And how indexer does know whther there
is a gap wihtout callong the fts backend (whch it does not as there are
no function for that) ?

4 - How to update configure.ac & additional files to add the
"--with-xapian" wichi will test for libxapian presence and add it to the
build ? 

Thank you 


On 2019-01-08 04:24, Timo Sirainen wrote:

On 7 Jan 2019, at 16.05, Joan Moreau via dovecot 
wrote:
Hi

ANyone to answer specifically ?

Q1 : get_last_uid -> Is this the last UID indexed (which may be not the
greatest value), or the gratest value (which may not be the latest) (the
code of existing plugins is unclear about this, Solr looks for the
greatest for insance)
All the mails are always supposed to be indexed from the beginning to
the last indexed mail. If there's a gap, indexer first indexes all the
missing mails. So the latest UID is supposed to be the greatest UID.
(Supporting out-of-order indexing would be rather difficult to keep
track of.)

Q2 : WHen Indexing an email, the data is not passed by "build_key". Why
so ? What is the link with "build_more" ?
The idea is that it calls something like:

- build_key(type=hdr, hdr_name=From)
- build_more("t...@iki.fi")
- build_key(type=hdr, hdr_name=Subject)
- build_more("Re: Solr -> Xapian ?")
- build_key(type=body_part)
- build_more("message body piece")
- build_more("message body piece2")
...

Q3 : Searching/Lookup : THe fheader in which to llok for (must be a
least among "cc, to, from, subject, body") is not appearing in the
'struct' data. WHere to find it ?
lookup() gets struct mail_search_arg *args, which contains the entire
IMAP SEARCH query. This could be used for more or less complex query
builders.

In case of a single header search, you should have
args->args->hdr_field_name contain the header name and
args->args->value.str contain the content you're searching for.

Q4 : Refresh : this is very unclear. How come there would not be the
"latest" view on index. What is the real meaning of this function ?
In case of Xapian it might not matter if it automatically refreshes its
indexes between each query. But with some other indexes this could
happen:

- IMAP session is opened
- IMAP SEARCH is run, which opens and searches the index
- a new mail is delivered to the mailbox and indexed
- IMAP SEARCH is run. Without refresh() it doesn't see the newly
indexed mail and doesn't include it in the search results.

Q5 : Rescan : is it just a bout remonving all indexes for a specific
mailbox ?
It's run when "doveadm fts rescan" is run manually. Usually that's only
run manually to fix up some brokenness. So it's intended to verify that
the current mailbox contents match the FTS indexes:
- If there are any mails in FTS index that no longer exist in the
actual mailbox, delete those mails from FTS
- If FTS is missing any mails in the middle of the mailbox, make sure
that the next mailbox indexing will index those missing mails. I think
currently this basically means reindexing all the mails since the first
missing mail, even the mails that are already in the index.

fts-lucene implements this, but other FTS backends are lazy and simply
rebuild all mails. Actually fts-solr is bad because it doesn't even
delete the extra mails.

Q6 : lokkup_multi : isn't the function the same for all plugnins (see
below) ?and finally , for fts_backend__lookup_multi, why is that
backend dependent ?
This function is called only when searching in virtual folders. So for
example the

Re: Solr -> Xapian ?

2019-01-11 Thread Joan Moreau via dovecot
Also, 

1 - WHat does represent "subargs" in mail_search_args 


2 - I made my first code, and the error I get compiling within the
dovecot architecture is 


"In file included from fts-xapian-plugin.c:4:
fts-xapian-plugin.h:6:1: error: unknown type name 'using'; did you mean
'uint'?
using namespace std;" 


if I remove this, the Xapian library is also complaining about
"namespace" keyword 


In file included from /usr/include/xapian.h:47,
from fts-backend-xapian.c:11:
/usr/include/xapian/types.h:31:1: error: unknown type name 'namespace';
did you mean 'i_isspace'?
namespace Xapian { 

Someone can bring me some light ? 

Thanks 


On 2019-01-09 09:58, Joan Moreau via dovecot wrote:

Ok. 

Additional question : 

- for rescan : who is responsible for passing again the new email ? Is the Dovecot core sending again all the emails to index ? or the fts shall somehow access the mailbox and read all emails ? Wouldn't just be saying "delete all index and get_last_uid is now 0" the easy way ? or the fts must process all emails (and block the current thread as a mailbx maybe quite large) 


- for get_last_uid : this uncertainity is very unclear. "If there is a gap, then 
indexer first indexes all the missing" -> this mean at a certain point, indexer 
maybe rebuilding a previous email, so *last* uid is something different than max. And how 
indexer does know whther there is a gap wihtout callong the fts backend (whch it does not as 
there are no function for that) ?

On 2019-01-08 04:24, Timo Sirainen wrote: 
On 7 Jan 2019, at 16.05, Joan Moreau via dovecot  wrote: 
Hi


ANyone to answer specifically ?

Q1 : get_last_uid -> Is this the last UID indexed (which may be not the greatest value), or the gratest value (which may not be the latest) (the code of existing plugins is unclear about this, Solr looks for the greatest for insance) 
All the mails are always supposed to be indexed from the beginning to the last indexed mail. If there's a gap, indexer first indexes all the missing mails. So the latest UID is supposed to be the greatest UID. (Supporting out-of-order indexing would be rather difficult to keep track of.)


Q2 : WHen Indexing an email, the data is not passed by "build_key". Why so ? What is the link with "build_more" ? 
The idea is that it calls something like:


- build_key(type=hdr, hdr_name=From)
- build_more("t...@iki.fi")
- build_key(type=hdr, hdr_name=Subject)
- build_more("Re: Solr -> Xapian ?")
- build_key(type=body_part)
- build_more("message body piece")
- build_more("message body piece2")
...

Q3 : Searching/Lookup : THe fheader in which to llok for (must be a least among "cc, to, from, subject, body") is not appearing in the 'struct' data. WHere to find it ? 
lookup() gets struct mail_search_arg *args, which contains the entire IMAP SEARCH query. This could be used for more or less complex query builders.


In case of a single header search, you should have args->args->hdr_field_name contain 
the header name and args->args->value.str contain the content you're searching for.

Q4 : Refresh : this is very unclear. How come there would not be the "latest" view on index. What is the real meaning of this function ? 
In case of Xapian it might not matter if it automatically refreshes its indexes between each query. But with some other indexes this could happen:


- IMAP session is opened
- IMAP SEARCH is run, which opens and searches the index
- a new mail is delivered to the mailbox and indexed
- IMAP SEARCH is run. Without refresh() it doesn't see the newly indexed mail 
and doesn't include it in the search results.

Q5 : Rescan : is it just a bout remonving all indexes for a specific mailbox ? 
It's run when "doveadm fts rescan" is run manually. Usually that's only run manually to fix up some brokenness. So it's intended to verify that the current mailbox contents match the FTS indexes:

- If there are any mails in FTS index that no longer exist in the actual 
mailbox, delete those mails from FTS
- If FTS is missing any mails in the middle of the mailbox, make sure that the 
next mailbox indexing will index those missing mails. I think currently this 
basically means reindexing all the mails since the first missing mail, even the 
mails that are already in the index.

fts-lucene implements this, but other FTS backends are lazy and simply rebuild 
all mails. Actually fts-solr is bad because it doesn't even delete the extra 
mails.

Q6 : lokkup_multi : isn't the function the same for all plugnins (see below) ? 
and finally , for fts_backend__lookup_multi, why is that backend dependent ?


This function is called only when searching in virtual folders. So for
example the virtual "All mails" folder, which would contain all mails in
all folders. In that case the boxes[] would contain a list of user's all
folders, except Tras

Re: Solr -> Xapian ?

2019-01-09 Thread Joan Moreau via dovecot
Ok. 

Additional question : 


- for rescan : who is responsible for passing again the new email ? Is
the Dovecot core sending again all the emails to index ? or the fts
shall somehow access the mailbox and read all emails ? Wouldn't just be
saying "delete all index and get_last_uid is now 0" the easy way ? or
the fts must process all emails (and block the current thread as a
mailbx maybe quite large) 


- for get_last_uid : this uncertainity is very unclear. "If there is a
gap, then indexer first indexes all the missing" -> this mean at a
certain point, indexer maybe rebuilding a previous email, so *last* uid
is something different than max. And how indexer does know whther there
is a gap wihtout callong the fts backend (whch it does not as there are
no function for that) ?

On 2019-01-08 04:24, Timo Sirainen wrote:

On 7 Jan 2019, at 16.05, Joan Moreau via dovecot  wrote: 


Hi

ANyone to answer specifically ?

Q1 : get_last_uid -> Is this the last UID indexed (which may be not the 
greatest value), or the gratest value (which may not be the latest) (the code of 
existing plugins is unclear about this, Solr looks for the greatest for insance)


All the mails are always supposed to be indexed from the beginning to the last 
indexed mail. If there's a gap, indexer first indexes all the missing mails. So 
the latest UID is supposed to be the greatest UID. (Supporting out-of-order 
indexing would be rather difficult to keep track of.)


Q2 : WHen Indexing an email, the data is not passed by "build_key". Why so ? What is the 
link with "build_more" ?


The idea is that it calls something like:

- build_key(type=hdr, hdr_name=From)
- build_more("t...@iki.fi")
- build_key(type=hdr, hdr_name=Subject)
- build_more("Re: Solr -> Xapian ?")
- build_key(type=body_part)
- build_more("message body piece")
- build_more("message body piece2")
...


Q3 : Searching/Lookup : THe fheader in which to llok for (must be a least among "cc, 
to, from, subject, body") is not appearing in the 'struct' data. WHere to find it ?


lookup() gets struct mail_search_arg *args, which contains the entire IMAP 
SEARCH query. This could be used for more or less complex query builders.

In case of a single header search, you should have args->args->hdr_field_name contain 
the header name and args->args->value.str contain the content you're searching for.


Q4 : Refresh : this is very unclear. How come there would not be the "latest" 
view on index. What is the real meaning of this function ?


In case of Xapian it might not matter if it automatically refreshes its indexes 
between each query. But with some other indexes this could happen:

- IMAP session is opened
- IMAP SEARCH is run, which opens and searches the index
- a new mail is delivered to the mailbox and indexed
- IMAP SEARCH is run. Without refresh() it doesn't see the newly indexed mail 
and doesn't include it in the search results.


Q5 : Rescan : is it just a bout remonving all indexes for a specific mailbox ?


It's run when "doveadm fts rescan" is run manually. Usually that's only run 
manually to fix up some brokenness. So it's intended to verify that the current mailbox 
contents match the FTS indexes:
- If there are any mails in FTS index that no longer exist in the actual 
mailbox, delete those mails from FTS
- If FTS is missing any mails in the middle of the mailbox, make sure that the 
next mailbox indexing will index those missing mails. I think currently this 
basically means reindexing all the mails since the first missing mail, even the 
mails that are already in the index.

fts-lucene implements this, but other FTS backends are lazy and simply rebuild 
all mails. Actually fts-solr is bad because it doesn't even delete the extra 
mails.

Q6 : lokkup_multi : isn't the function the same for all plugnins (see below) ? 
and finally , for fts_backend__lookup_multi, why is that backend dependent ?


This function is called only when searching in virtual folders. So for
example the virtual "All mails" folder, which would contain all mails in
all folders. In that case the boxes[] would contain a list of user's all
folders, except Trash and Spam. If lookup_multi() isn't implemented
(left to NULL), the search is run separately via lookup() for each
folder. With lookup_multi() there can be just one lookup, and the
backend can filter only the wanted folders and return them directly. So
it's an optimization for FTS indexes that support user-global searches
rather than only per-folder searches.


static int fts_backend_xapian_lookup_multi(struct fts_backend *_backend, struct 
mailbox *const boxes[], struct mail_search_arg *args, enum fts_lookup_flags 
flags, struct fts_multi_result *result)
{
struct xapian_fts_backend_update_context *ctx =
(struct xapian_fts_backend_update_context *)_ctx;

int i=0;

while(boxes[i]!=NULL)
{
if(fts_backen

Re: Solr -> Xapian ?

2019-01-07 Thread Joan Moreau via dovecot
Hi 

ANyone to answer specifically ? 


Q1 : get_last_uid -> Is this the last UID indexed (which may be not the
greatest value), or the gratest value (which may not be the latest) (the
code of existing plugins is unclear about this, Solr looks for the
greatest for insance) 


Q2 : WHen Indexing an email, the data is not passed by "build_key". Why
so ? What is the link with "build_more" ? 


Q3 : Searching/Lookup : THe fheader in which to llok for (must be a
least among "cc, to, from, subject, body") is not appearing in the
'struct' data. WHere to find it ? 


Q4 : Refresh : this is very unclear. How come there would not be the
"latest" view on index. What is the real meaning of this function ? 


Q5 : Rescan : is it just a bout remonving all indexes for a specific
mailbox ? 


Q6 : lokkup_multi : isn't the function the same for all plugnins (see
below) ? 

THank you 


On 2019-01-06 16:50, Joan Moreau via dovecot wrote:

and finally , for fts_backend__lookup_multi, why is that backend dependent ? 

Would- nt the below function below be the same for any backend ? 

Waiting fro your feedback on all those questions 

Thank you 

JM 

- 


static int fts_backend_xapian_lookup_multi(struct fts_backend *_backend, struct 
mailbox *const boxes[], struct mail_search_arg *args, enum fts_lookup_flags 
flags, struct fts_multi_result *result)
{
struct xapian_fts_backend_update_context *ctx =
(struct xapian_fts_backend_update_context *)_ctx; 

int i=0; 


while(boxes[i]!=NULL)
{
if(fts_backend_xapian_lookup(backend,box[i],args,flags,result->box_results[i])<0)
 return -1;
i++;
}
return 0;
}

On 2019-01-06 16:31, Joan Moreau via dovecot wrote: 


for fts_backend_xxx_lookup, where is specidifed in which field (to, cc, 
subject, body, from, all) to lookup ?

On 2019-01-06 16:03, Joan Moreau wrote: 

For "rescan " and "optimize", wouldn't it be the dovecot core who indicate which are to be dismissed (expunged), or re-ask for indexing a particular (or all) uid ? WHy would the backend be aware of the transactions on the mailbox ??? 


There is alredy "fts_backend_xxx_update_expunge", so I beleive the management 
of the expunged messages is *NOT* in the backend, right ?

On 2019-01-06 15:41, Joan Moreau wrote: 

also, for fts_backend_solr_update_set_build_key -> where is the data (of the hdr_name or the body) ? 

On 2019-01-06 14:10, Joan Moreau wrote: 

for the "last uid"-> this is not the last added, but the maximum of the UID in the indexed emails, right ? 

On 2019-01-06 11:53, Joan Moreau via dovecot wrote: 

Thank you 

I still don't get the "build_key" function. The email (body, hearders, .. and the uid) is the one (and only) to index . What "key" is that function referring to ? Or is the "key" here the actual email ? 

On 2019-01-06 08:43, Stephan Bosch wrote: 


Op 06/01/2019 om 01:00 schreef Joan Moreau: Anyone willing to explain those 
functions ?

Most notably " get_last_uid" 
From src/plugins/fts/fts-api.h:


/* Get the last_uid for the mailbox. */
int fts_backend_get_last_uid(struct fts_backend *backend, struct mailbox *box,
uint32_t *last_uid_r);

The solr sources ( src/plugins/fts-solr/fts-backend-solr.c:213) tell me this 
returns the last UID added to the index for the given mailbox and FTS index.

"set_build_key" 
From src/plugins/fts/fts-api.h:


/* Switch to building index for specified key. If backend doesn't want to
index this key, it can return FALSE and caller will skip to next key. */
bool fts_backend_update_set_build_key(struct fts_backend_update_context *ctx,
const struct fts_backend_build_key *key);

Same file provides outline of what a build_key is.

"build_more" , 
/* Add more content to the index for the currently specified build key.

Non-BODY_PART_BINARY data must contain only full valid UTF-8 characters,
but it doesn't need to be NUL-terminated. size contains the data size in
bytes, not characters. This function may be called many times and the data
block sizes may be small. Backend returns 0 if ok, -1 if build should be
aborted. */
int fts_backend_update_build_more(struct fts_backend_update_context *ctx,
const unsigned char *data, size_t size);

You should look at the sources of a few backends like squat and solr to get a 
feel of what exactly this is doing.

what is refresh versus rescan ? 
From fts-api.h:


/* Refresh index to make sure we see latest changes from lookups.
Returns 0 if ok, -1 if error. */
int fts_backend_refresh(struct fts_backend *backend);
/* Go through the entire index and make sure all mails are indexed,
and delete any extra mails in the index. */
int fts_backend_rescan(struct fts_backend *backend);

Regards,

Stepham

On January 5, 2019 14:23:10 Joan Moreau via dovecot  wrote:

Thank Stephan

I basically need to know the role/description of each of the functions of the 
fts_backend:

Re: Solr -> Xapian ?

2019-01-06 Thread Joan Moreau via dovecot

and finally , for fts_backend__lookup_multi, why is that backend
dependent ? 

Would- nt the below function below be the same for any backend ? 

Waiting fro your feedback on all those questions 

Thank you 

JM 

- 


static int fts_backend_xapian_lookup_multi(struct fts_backend *_backend,
struct mailbox *const boxes[], struct mail_search_arg *args, enum
fts_lookup_flags flags, struct fts_multi_result *result)
{
struct xapian_fts_backend_update_context *ctx =
(struct xapian_fts_backend_update_context *)_ctx; 

int i=0; 


while(boxes[i]!=NULL)
{
if(fts_backend_xapian_lookup(backend,box[i],args,flags,result->box_results[i])<0)
return -1;
i++;
}
return 0;
}

On 2019-01-06 16:31, Joan Moreau via dovecot wrote:


for fts_backend_xxx_lookup, where is specidifed in which field (to, cc, 
subject, body, from, all) to lookup ?

On 2019-01-06 16:03, Joan Moreau wrote: 

For "rescan " and "optimize", wouldn't it be the dovecot core who indicate which are to be dismissed (expunged), or re-ask for indexing a particular (or all) uid ? WHy would the backend be aware of the transactions on the mailbox ??? 


There is alredy "fts_backend_xxx_update_expunge", so I beleive the management 
of the expunged messages is *NOT* in the backend, right ?

On 2019-01-06 15:41, Joan Moreau wrote: 

also, for fts_backend_solr_update_set_build_key -> where is the data (of the hdr_name or the body) ? 

On 2019-01-06 14:10, Joan Moreau wrote: 

for the "last uid"-> this is not the last added, but the maximum of the UID in the indexed emails, right ? 

On 2019-01-06 11:53, Joan Moreau via dovecot wrote: 

Thank you 

I still don't get the "build_key" function. The email (body, hearders, .. and the uid) is the one (and only) to index . What "key" is that function referring to ? Or is the "key" here the actual email ? 

On 2019-01-06 08:43, Stephan Bosch wrote: 


Op 06/01/2019 om 01:00 schreef Joan Moreau: Anyone willing to explain those 
functions ?

Most notably " get_last_uid" 
From src/plugins/fts/fts-api.h:


/* Get the last_uid for the mailbox. */
int fts_backend_get_last_uid(struct fts_backend *backend, struct mailbox *box,
uint32_t *last_uid_r);

The solr sources ( src/plugins/fts-solr/fts-backend-solr.c:213) tell me this 
returns the last UID added to the index for the given mailbox and FTS index.

"set_build_key" 
From src/plugins/fts/fts-api.h:


/* Switch to building index for specified key. If backend doesn't want to
index this key, it can return FALSE and caller will skip to next key. */
bool fts_backend_update_set_build_key(struct fts_backend_update_context *ctx,
const struct fts_backend_build_key *key);

Same file provides outline of what a build_key is.

"build_more" , 
/* Add more content to the index for the currently specified build key.

Non-BODY_PART_BINARY data must contain only full valid UTF-8 characters,
but it doesn't need to be NUL-terminated. size contains the data size in
bytes, not characters. This function may be called many times and the data
block sizes may be small. Backend returns 0 if ok, -1 if build should be
aborted. */
int fts_backend_update_build_more(struct fts_backend_update_context *ctx,
const unsigned char *data, size_t size);

You should look at the sources of a few backends like squat and solr to get a 
feel of what exactly this is doing.

what is refresh versus rescan ? 
From fts-api.h:


/* Refresh index to make sure we see latest changes from lookups.
Returns 0 if ok, -1 if error. */
int fts_backend_refresh(struct fts_backend *backend);
/* Go through the entire index and make sure all mails are indexed,
and delete any extra mails in the index. */
int fts_backend_rescan(struct fts_backend *backend);

Regards,

Stepham

On January 5, 2019 14:23:10 Joan Moreau via dovecot  wrote:

Thank Stephan

I basically need to know the role/description of each of the functions of the 
fts_backend:

struct fts_backend fts_backend_xapian = {
.name = "xapian",
.flags = FTS_BACKEND_FLAG_NORMALIZE_INPUT,*-> what other flags ?*

{
fts_backend_xapian_alloc,
fts_backend_xapian_init,
fts_backend_xapian_deinit,
fts_backend_xapian_get_last_uid,
fts_backend_xapian_update_init,
fts_backend_xapian_update_deinit,
fts_backend_xapian_update_set_mailbox,
fts_backend_xapian_update_expunge,
fts_backend_xapian_update_set_build_key,
fts_backend_xapian_update_unset_build_key,
fts_backend_xapian_update_build_more,
fts_backend_xapian_refresh,
fts_backend_xapian_rescan,
fts_backend_xapian_optimize,
fts_backend_default_can_lookup,
fts_backend_xapian_lookup,
fts_backend_xapian_lookup_multi,
fts_backend_xapian_lookup_done
}
};

THank you

On 2019-01-05 08:49, Stephan Bosch wrote:

Op 04/01/2019 om 11:17 schreef Joan Moreau via dovecot: 
Why not, but please guide me about the core structure (mandatory funcitons, etc..) of a typical Dovecot FTS plugin


The Dovecot API documentation is not

Re: Solr -> Xapian ?

2019-01-06 Thread Joan Moreau via dovecot

for fts_backend_xxx_lookup, where is specidifed in which field (to, cc,
subject, body, from, all) to lookup ?

On 2019-01-06 16:03, Joan Moreau wrote:

For "rescan " and "optimize", wouldn't it be the dovecot core who indicate which are to be dismissed (expunged), or re-ask for indexing a particular (or all) uid ? WHy would the backend be aware of the transactions on the mailbox ??? 


There is alredy "fts_backend_xxx_update_expunge", so I beleive the management 
of the expunged messages is *NOT* in the backend, right ?

On 2019-01-06 15:41, Joan Moreau wrote: 

also, for fts_backend_solr_update_set_build_key -> where is the data (of the hdr_name or the body) ? 

On 2019-01-06 14:10, Joan Moreau wrote: 

for the "last uid"-> this is not the last added, but the maximum of the UID in the indexed emails, right ? 

On 2019-01-06 11:53, Joan Moreau via dovecot wrote: 

Thank you 

I still don't get the "build_key" function. The email (body, hearders, .. and the uid) is the one (and only) to index . What "key" is that function referring to ? Or is the "key" here the actual email ? 

On 2019-01-06 08:43, Stephan Bosch wrote: 


Op 06/01/2019 om 01:00 schreef Joan Moreau: Anyone willing to explain those 
functions ?

Most notably " get_last_uid" 
From src/plugins/fts/fts-api.h:


/* Get the last_uid for the mailbox. */
int fts_backend_get_last_uid(struct fts_backend *backend, struct mailbox *box,
uint32_t *last_uid_r);

The solr sources ( src/plugins/fts-solr/fts-backend-solr.c:213) tell me this 
returns the last UID added to the index for the given mailbox and FTS index.

"set_build_key" 
From src/plugins/fts/fts-api.h:


/* Switch to building index for specified key. If backend doesn't want to
index this key, it can return FALSE and caller will skip to next key. */
bool fts_backend_update_set_build_key(struct fts_backend_update_context *ctx,
const struct fts_backend_build_key *key);

Same file provides outline of what a build_key is.

"build_more" , 
/* Add more content to the index for the currently specified build key.

Non-BODY_PART_BINARY data must contain only full valid UTF-8 characters,
but it doesn't need to be NUL-terminated. size contains the data size in
bytes, not characters. This function may be called many times and the data
block sizes may be small. Backend returns 0 if ok, -1 if build should be
aborted. */
int fts_backend_update_build_more(struct fts_backend_update_context *ctx,
const unsigned char *data, size_t size);

You should look at the sources of a few backends like squat and solr to get a 
feel of what exactly this is doing.

what is refresh versus rescan ? 
From fts-api.h:


/* Refresh index to make sure we see latest changes from lookups.
Returns 0 if ok, -1 if error. */
int fts_backend_refresh(struct fts_backend *backend);
/* Go through the entire index and make sure all mails are indexed,
and delete any extra mails in the index. */
int fts_backend_rescan(struct fts_backend *backend);

Regards,

Stepham

On January 5, 2019 14:23:10 Joan Moreau via dovecot  wrote:

Thank Stephan

I basically need to know the role/description of each of the functions of the 
fts_backend:

struct fts_backend fts_backend_xapian = {
.name = "xapian",
.flags = FTS_BACKEND_FLAG_NORMALIZE_INPUT,*-> what other flags ?*

{
fts_backend_xapian_alloc,
fts_backend_xapian_init,
fts_backend_xapian_deinit,
fts_backend_xapian_get_last_uid,
fts_backend_xapian_update_init,
fts_backend_xapian_update_deinit,
fts_backend_xapian_update_set_mailbox,
fts_backend_xapian_update_expunge,
fts_backend_xapian_update_set_build_key,
fts_backend_xapian_update_unset_build_key,
fts_backend_xapian_update_build_more,
fts_backend_xapian_refresh,
fts_backend_xapian_rescan,
fts_backend_xapian_optimize,
fts_backend_default_can_lookup,
fts_backend_xapian_lookup,
fts_backend_xapian_lookup_multi,
fts_backend_xapian_lookup_done
}
};

THank you

On 2019-01-05 08:49, Stephan Bosch wrote:

Op 04/01/2019 om 11:17 schreef Joan Moreau via dovecot: 
Why not, but please guide me about the core structure (mandatory funcitons, etc..) of a typical Dovecot FTS plugin


The Dovecot API documentation is not exhaustive everywhere, but the basics are 
documented. The remaining questions can be answered by looking at examples 
found in similar plugins or the relevant API sources.

I know of one FTS plugin not written by Dovecot developers:

https://github.com/atkinsj/fts-elasticsearch

If you really wish to do something like this, just go ahead. It will not be a 
small effort though. As soon as you have concrete questions, we can help you 
(don't expect rapid responses though).

Regards,

Stephan.

Re: Solr -> Xapian ?

2019-01-06 Thread Joan Moreau via dovecot

For "rescan " and "optimize", wouldn't it be the dovecot core who
indicate which are to be dismissed (expunged), or re-ask for indexing a
particular (or all) uid ? WHy would the backend be aware of the
transactions on the mailbox ??? 


There is alredy "fts_backend_xxx_update_expunge", so I beleive the
management of the expunged messages is *NOT* in the backend, right ?

On 2019-01-06 15:41, Joan Moreau wrote:

also, for fts_backend_solr_update_set_build_key -> where is the data (of the hdr_name or the body) ? 

On 2019-01-06 14:10, Joan Moreau wrote: 

for the "last uid"-> this is not the last added, but the maximum of the UID in the indexed emails, right ? 

On 2019-01-06 11:53, Joan Moreau via dovecot wrote: 

Thank you 

I still don't get the "build_key" function. The email (body, hearders, .. and the uid) is the one (and only) to index . What "key" is that function referring to ? Or is the "key" here the actual email ? 

On 2019-01-06 08:43, Stephan Bosch wrote: 


Op 06/01/2019 om 01:00 schreef Joan Moreau: Anyone willing to explain those 
functions ?

Most notably " get_last_uid" 
From src/plugins/fts/fts-api.h:


/* Get the last_uid for the mailbox. */
int fts_backend_get_last_uid(struct fts_backend *backend, struct mailbox *box,
uint32_t *last_uid_r);

The solr sources ( src/plugins/fts-solr/fts-backend-solr.c:213) tell me this 
returns the last UID added to the index for the given mailbox and FTS index.

"set_build_key" 
From src/plugins/fts/fts-api.h:


/* Switch to building index for specified key. If backend doesn't want to
index this key, it can return FALSE and caller will skip to next key. */
bool fts_backend_update_set_build_key(struct fts_backend_update_context *ctx,
const struct fts_backend_build_key *key);

Same file provides outline of what a build_key is.

"build_more" , 
/* Add more content to the index for the currently specified build key.

Non-BODY_PART_BINARY data must contain only full valid UTF-8 characters,
but it doesn't need to be NUL-terminated. size contains the data size in
bytes, not characters. This function may be called many times and the data
block sizes may be small. Backend returns 0 if ok, -1 if build should be
aborted. */
int fts_backend_update_build_more(struct fts_backend_update_context *ctx,
const unsigned char *data, size_t size);

You should look at the sources of a few backends like squat and solr to get a 
feel of what exactly this is doing.

what is refresh versus rescan ? 
From fts-api.h:


/* Refresh index to make sure we see latest changes from lookups.
Returns 0 if ok, -1 if error. */
int fts_backend_refresh(struct fts_backend *backend);
/* Go through the entire index and make sure all mails are indexed,
and delete any extra mails in the index. */
int fts_backend_rescan(struct fts_backend *backend);

Regards,

Stepham

On January 5, 2019 14:23:10 Joan Moreau via dovecot  wrote:

Thank Stephan

I basically need to know the role/description of each of the functions of the 
fts_backend:

struct fts_backend fts_backend_xapian = {
.name = "xapian",
.flags = FTS_BACKEND_FLAG_NORMALIZE_INPUT,*-> what other flags ?*

{
fts_backend_xapian_alloc,
fts_backend_xapian_init,
fts_backend_xapian_deinit,
fts_backend_xapian_get_last_uid,
fts_backend_xapian_update_init,
fts_backend_xapian_update_deinit,
fts_backend_xapian_update_set_mailbox,
fts_backend_xapian_update_expunge,
fts_backend_xapian_update_set_build_key,
fts_backend_xapian_update_unset_build_key,
fts_backend_xapian_update_build_more,
fts_backend_xapian_refresh,
fts_backend_xapian_rescan,
fts_backend_xapian_optimize,
fts_backend_default_can_lookup,
fts_backend_xapian_lookup,
fts_backend_xapian_lookup_multi,
fts_backend_xapian_lookup_done
}
};

THank you

On 2019-01-05 08:49, Stephan Bosch wrote:

Op 04/01/2019 om 11:17 schreef Joan Moreau via dovecot: 
Why not, but please guide me about the core structure (mandatory funcitons, etc..) of a typical Dovecot FTS plugin


The Dovecot API documentation is not exhaustive everywhere, but the basics are 
documented. The remaining questions can be answered by looking at examples 
found in similar plugins or the relevant API sources.

I know of one FTS plugin not written by Dovecot developers:

https://github.com/atkinsj/fts-elasticsearch

If you really wish to do something like this, just go ahead. It will not be a 
small effort though. As soon as you have concrete questions, we can help you 
(don't expect rapid responses though).

Regards,

Stephan.

Re: Solr -> Xapian ?

2019-01-05 Thread Joan Moreau via dovecot

also, for fts_backend_solr_update_set_build_key -> where is the data (of
the hdr_name or the body) ? 


On 2019-01-06 14:10, Joan Moreau wrote:

for the "last uid"-> this is not the last added, but the maximum of the UID in the indexed emails, right ? 

On 2019-01-06 11:53, Joan Moreau via dovecot wrote: 

Thank you 

I still don't get the "build_key" function. The email (body, hearders, .. and the uid) is the one (and only) to index . What "key" is that function referring to ? Or is the "key" here the actual email ? 

On 2019-01-06 08:43, Stephan Bosch wrote: 


Op 06/01/2019 om 01:00 schreef Joan Moreau: Anyone willing to explain those 
functions ?

Most notably " get_last_uid" 
From src/plugins/fts/fts-api.h:


/* Get the last_uid for the mailbox. */
int fts_backend_get_last_uid(struct fts_backend *backend, struct mailbox *box,
uint32_t *last_uid_r);

The solr sources ( src/plugins/fts-solr/fts-backend-solr.c:213) tell me this 
returns the last UID added to the index for the given mailbox and FTS index.

"set_build_key" 
From src/plugins/fts/fts-api.h:


/* Switch to building index for specified key. If backend doesn't want to
index this key, it can return FALSE and caller will skip to next key. */
bool fts_backend_update_set_build_key(struct fts_backend_update_context *ctx,
const struct fts_backend_build_key *key);

Same file provides outline of what a build_key is.

"build_more" , 
/* Add more content to the index for the currently specified build key.

Non-BODY_PART_BINARY data must contain only full valid UTF-8 characters,
but it doesn't need to be NUL-terminated. size contains the data size in
bytes, not characters. This function may be called many times and the data
block sizes may be small. Backend returns 0 if ok, -1 if build should be
aborted. */
int fts_backend_update_build_more(struct fts_backend_update_context *ctx,
const unsigned char *data, size_t size);

You should look at the sources of a few backends like squat and solr to get a 
feel of what exactly this is doing.

what is refresh versus rescan ? 
From fts-api.h:


/* Refresh index to make sure we see latest changes from lookups.
Returns 0 if ok, -1 if error. */
int fts_backend_refresh(struct fts_backend *backend);
/* Go through the entire index and make sure all mails are indexed,
and delete any extra mails in the index. */
int fts_backend_rescan(struct fts_backend *backend);

Regards,

Stepham

On January 5, 2019 14:23:10 Joan Moreau via dovecot  wrote:

Thank Stephan

I basically need to know the role/description of each of the functions of the 
fts_backend:

struct fts_backend fts_backend_xapian = {
.name = "xapian",
.flags = FTS_BACKEND_FLAG_NORMALIZE_INPUT,*-> what other flags ?*

{
fts_backend_xapian_alloc,
fts_backend_xapian_init,
fts_backend_xapian_deinit,
fts_backend_xapian_get_last_uid,
fts_backend_xapian_update_init,
fts_backend_xapian_update_deinit,
fts_backend_xapian_update_set_mailbox,
fts_backend_xapian_update_expunge,
fts_backend_xapian_update_set_build_key,
fts_backend_xapian_update_unset_build_key,
fts_backend_xapian_update_build_more,
fts_backend_xapian_refresh,
fts_backend_xapian_rescan,
fts_backend_xapian_optimize,
fts_backend_default_can_lookup,
fts_backend_xapian_lookup,
fts_backend_xapian_lookup_multi,
fts_backend_xapian_lookup_done
}
};

THank you

On 2019-01-05 08:49, Stephan Bosch wrote:

Op 04/01/2019 om 11:17 schreef Joan Moreau via dovecot: 
Why not, but please guide me about the core structure (mandatory funcitons, etc..) of a typical Dovecot FTS plugin


The Dovecot API documentation is not exhaustive everywhere, but the basics are 
documented. The remaining questions can be answered by looking at examples 
found in similar plugins or the relevant API sources.

I know of one FTS plugin not written by Dovecot developers:

https://github.com/atkinsj/fts-elasticsearch

If you really wish to do something like this, just go ahead. It will not be a 
small effort though. As soon as you have concrete questions, we can help you 
(don't expect rapid responses though).

Regards,

Stephan.

Re: Solr -> Xapian ?

2019-01-05 Thread Joan Moreau via dovecot

for the "last uid"-> this is not the last added, but the maximum of the
UID in the indexed emails, right ? 


On 2019-01-06 11:53, Joan Moreau via dovecot wrote:

Thank you 

I still don't get the "build_key" function. The email (body, hearders, .. and the uid) is the one (and only) to index . What "key" is that function referring to ? Or is the "key" here the actual email ? 

On 2019-01-06 08:43, Stephan Bosch wrote: 


Op 06/01/2019 om 01:00 schreef Joan Moreau: Anyone willing to explain those 
functions ?

Most notably " get_last_uid" 
From src/plugins/fts/fts-api.h:


/* Get the last_uid for the mailbox. */
int fts_backend_get_last_uid(struct fts_backend *backend, struct mailbox *box,
uint32_t *last_uid_r);

The solr sources ( src/plugins/fts-solr/fts-backend-solr.c:213) tell me this 
returns the last UID added to the index for the given mailbox and FTS index.

"set_build_key" 
From src/plugins/fts/fts-api.h:


/* Switch to building index for specified key. If backend doesn't want to
index this key, it can return FALSE and caller will skip to next key. */
bool fts_backend_update_set_build_key(struct fts_backend_update_context *ctx,
const struct fts_backend_build_key *key);

Same file provides outline of what a build_key is.

"build_more" , 
/* Add more content to the index for the currently specified build key.

Non-BODY_PART_BINARY data must contain only full valid UTF-8 characters,
but it doesn't need to be NUL-terminated. size contains the data size in
bytes, not characters. This function may be called many times and the data
block sizes may be small. Backend returns 0 if ok, -1 if build should be
aborted. */
int fts_backend_update_build_more(struct fts_backend_update_context *ctx,
const unsigned char *data, size_t size);

You should look at the sources of a few backends like squat and solr to get a 
feel of what exactly this is doing.

what is refresh versus rescan ? 
From fts-api.h:


/* Refresh index to make sure we see latest changes from lookups.
Returns 0 if ok, -1 if error. */
int fts_backend_refresh(struct fts_backend *backend);
/* Go through the entire index and make sure all mails are indexed,
and delete any extra mails in the index. */
int fts_backend_rescan(struct fts_backend *backend);

Regards,

Stepham

On January 5, 2019 14:23:10 Joan Moreau via dovecot  wrote:

Thank Stephan

I basically need to know the role/description of each of the functions of the 
fts_backend:

struct fts_backend fts_backend_xapian = {
.name = "xapian",
.flags = FTS_BACKEND_FLAG_NORMALIZE_INPUT,*-> what other flags ?*

{
fts_backend_xapian_alloc,
fts_backend_xapian_init,
fts_backend_xapian_deinit,
fts_backend_xapian_get_last_uid,
fts_backend_xapian_update_init,
fts_backend_xapian_update_deinit,
fts_backend_xapian_update_set_mailbox,
fts_backend_xapian_update_expunge,
fts_backend_xapian_update_set_build_key,
fts_backend_xapian_update_unset_build_key,
fts_backend_xapian_update_build_more,
fts_backend_xapian_refresh,
fts_backend_xapian_rescan,
fts_backend_xapian_optimize,
fts_backend_default_can_lookup,
fts_backend_xapian_lookup,
fts_backend_xapian_lookup_multi,
fts_backend_xapian_lookup_done
}
};

THank you

On 2019-01-05 08:49, Stephan Bosch wrote:

Op 04/01/2019 om 11:17 schreef Joan Moreau via dovecot: 
Why not, but please guide me about the core structure (mandatory funcitons, etc..) of a typical Dovecot FTS plugin


The Dovecot API documentation is not exhaustive everywhere, but the basics are 
documented. The remaining questions can be answered by looking at examples 
found in similar plugins or the relevant API sources.

I know of one FTS plugin not written by Dovecot developers:

https://github.com/atkinsj/fts-elasticsearch

If you really wish to do something like this, just go ahead. It will not be a 
small effort though. As soon as you have concrete questions, we can help you 
(don't expect rapid responses though).

Regards,

Stephan.

Re: Solr -> Xapian ?

2019-01-05 Thread Joan Moreau via dovecot
Thank you 


I still don't get the "build_key" function. The email (body, hearders,
.. and the uid) is the one (and only) to index . What "key" is that
function referring to ? Or is the "key" here the actual email ? 


On 2019-01-06 08:43, Stephan Bosch wrote:

Op 06/01/2019 om 01:00 schreef Joan Moreau: 


Anyone willing to explain those functions ?

Most notably " get_last_uid"


From src/plugins/fts/fts-api.h:

/* Get the last_uid for the mailbox. */
int fts_backend_get_last_uid(struct fts_backend *backend, struct mailbox *box,
uint32_t *last_uid_r);

The solr sources ( src/plugins/fts-solr/fts-backend-solr.c:213) tell me this 
returns the last UID added to the index for the given mailbox and FTS index.


"set_build_key"


From src/plugins/fts/fts-api.h:

/* Switch to building index for specified key. If backend doesn't want to
index this key, it can return FALSE and caller will skip to next key. */
bool fts_backend_update_set_build_key(struct fts_backend_update_context *ctx,
const struct fts_backend_build_key *key);

Same file provides outline of what a build_key is.


"build_more" ,


/* Add more content to the index for the currently specified build key.
Non-BODY_PART_BINARY data must contain only full valid UTF-8 characters,
but it doesn't need to be NUL-terminated. size contains the data size in
bytes, not characters. This function may be called many times and the data
block sizes may be small. Backend returns 0 if ok, -1 if build should be
aborted. */
int fts_backend_update_build_more(struct fts_backend_update_context *ctx,
const unsigned char *data, size_t size);

You should look at the sources of a few backends like squat and solr to get a 
feel of what exactly this is doing.


what is refresh versus rescan ?


From fts-api.h:

/* Refresh index to make sure we see latest changes from lookups.
Returns 0 if ok, -1 if error. */
int fts_backend_refresh(struct fts_backend *backend);
/* Go through the entire index and make sure all mails are indexed,
and delete any extra mails in the index. */
int fts_backend_rescan(struct fts_backend *backend);

Regards,

Stepham

On January 5, 2019 14:23:10 Joan Moreau via dovecot  wrote:

Thank Stephan

I basically need to know the role/description of each of the functions of the 
fts_backend:

struct fts_backend fts_backend_xapian = {
.name = "xapian",
.flags = FTS_BACKEND_FLAG_NORMALIZE_INPUT,*-> what other flags ?*

{
fts_backend_xapian_alloc,
fts_backend_xapian_init,
fts_backend_xapian_deinit,
fts_backend_xapian_get_last_uid,
fts_backend_xapian_update_init,
fts_backend_xapian_update_deinit,
fts_backend_xapian_update_set_mailbox,
fts_backend_xapian_update_expunge,
fts_backend_xapian_update_set_build_key,
fts_backend_xapian_update_unset_build_key,
fts_backend_xapian_update_build_more,
fts_backend_xapian_refresh,
fts_backend_xapian_rescan,
fts_backend_xapian_optimize,
fts_backend_default_can_lookup,
fts_backend_xapian_lookup,
fts_backend_xapian_lookup_multi,
fts_backend_xapian_lookup_done
}
};

THank you

On 2019-01-05 08:49, Stephan Bosch wrote:

Op 04/01/2019 om 11:17 schreef Joan Moreau via dovecot: 
Why not, but please guide me about the core structure (mandatory funcitons, etc..) of a typical Dovecot FTS plugin


The Dovecot API documentation is not exhaustive everywhere, but the basics are 
documented. The remaining questions can be answered by looking at examples 
found in similar plugins or the relevant API sources.

I know of one FTS plugin not written by Dovecot developers:

https://github.com/atkinsj/fts-elasticsearch

If you really wish to do something like this, just go ahead. It will not be a 
small effort though. As soon as you have concrete questions, we can help you 
(don't expect rapid responses though).

Regards,

Stephan.

Re: Solr -> Xapian ?

2019-01-05 Thread Joan Moreau via dovecot




Anyone willing to explain those functions ?

Most notably " get_last_uid" "set_build_key" "build_more" , what is refresh 
versus rescan ?




On January 5, 2019 14:23:10 Joan Moreau via dovecot  
wrote:

Thank Stephan
I basically need to know the role/description of each of the functions of 
the fts_backend:


struct fts_backend fts_backend_xapian = {
.name = "xapian",
.flags = FTS_BACKEND_FLAG_NORMALIZE_INPUT, -> what other flags ?
{
fts_backend_xapian_alloc,
fts_backend_xapian_init,
fts_backend_xapian_deinit,
fts_backend_xapian_get_last_uid,
fts_backend_xapian_update_init,
fts_backend_xapian_update_deinit,
fts_backend_xapian_update_set_mailbox,
fts_backend_xapian_update_expunge,
fts_backend_xapian_update_set_build_key,
fts_backend_xapian_update_unset_build_key,
fts_backend_xapian_update_build_more,
fts_backend_xapian_refresh,
fts_backend_xapian_rescan,
fts_backend_xapian_optimize,
fts_backend_default_can_lookup,
fts_backend_xapian_lookup,
fts_backend_xapian_lookup_multi,
fts_backend_xapian_lookup_done
}
};

THank you
On 2019-01-05 08:49, Stephan Bosch wrote:


Op 04/01/2019 om 11:17 schreef Joan Moreau via dovecot:


Why not, but please guide me about the core structure (mandatory funcitons, 
etc..) of a typical Dovecot FTS plugin
The Dovecot API documentation is not exhaustive everywhere, but the basics 
are documented. The remaining questions can be answered by looking at 
examples found in similar plugins or the relevant API sources.


I know of one FTS plugin not written by Dovecot developers:

https://github.com/atkinsj/fts-elasticsearch

If you really wish to do something like this, just go ahead. It will not be 
a small effort though. As soon as you have concrete questions, we can help 
you (don't expect rapid responses though).


Regards,

Stephan.





Re: Solr -> Xapian ?

2019-01-05 Thread Joan Moreau via dovecot


Anyone willing to explain those functions ?

On January 5, 2019 14:23:10 Joan Moreau via dovecot  
wrote:

Thank Stephan
I basically need to know the role/description of each of the functions of 
the fts_backend:


struct fts_backend fts_backend_xapian = {
.name = "xapian",
.flags = FTS_BACKEND_FLAG_NORMALIZE_INPUT, -> what other flags ?
{
fts_backend_xapian_alloc,
fts_backend_xapian_init,
fts_backend_xapian_deinit,
fts_backend_xapian_get_last_uid,
fts_backend_xapian_update_init,
fts_backend_xapian_update_deinit,
fts_backend_xapian_update_set_mailbox,
fts_backend_xapian_update_expunge,
fts_backend_xapian_update_set_build_key,
fts_backend_xapian_update_unset_build_key,
fts_backend_xapian_update_build_more,
fts_backend_xapian_refresh,
fts_backend_xapian_rescan,
fts_backend_xapian_optimize,
fts_backend_default_can_lookup,
fts_backend_xapian_lookup,
fts_backend_xapian_lookup_multi,
fts_backend_xapian_lookup_done
}
};

THank you
On 2019-01-05 08:49, Stephan Bosch wrote:


Op 04/01/2019 om 11:17 schreef Joan Moreau via dovecot:


Why not, but please guide me about the core structure (mandatory funcitons, 
etc..) of a typical Dovecot FTS plugin
The Dovecot API documentation is not exhaustive everywhere, but the basics 
are documented. The remaining questions can be answered by looking at 
examples found in similar plugins or the relevant API sources.


I know of one FTS plugin not written by Dovecot developers:

https://github.com/atkinsj/fts-elasticsearch

If you really wish to do something like this, just go ahead. It will not be 
a small effort though. As soon as you have concrete questions, we can help 
you (don't expect rapid responses though).


Regards,

Stephan.




Re: Solr -> Xapian ?

2019-01-04 Thread Joan Moreau via dovecot
Thank Stephan 


I basically need to know the role/description of each of the functions
of the fts_backend: 


struct fts_backend fts_backend_xapian = {
.name = "xapian",
.flags = FTS_BACKEND_FLAG_NORMALIZE_INPUT, -> WHAT OTHER FLAGS ? 


{
fts_backend_xapian_alloc,
fts_backend_xapian_init,
fts_backend_xapian_deinit,
fts_backend_xapian_get_last_uid,
fts_backend_xapian_update_init,
fts_backend_xapian_update_deinit,
fts_backend_xapian_update_set_mailbox,
fts_backend_xapian_update_expunge,
fts_backend_xapian_update_set_build_key,
fts_backend_xapian_update_unset_build_key,
fts_backend_xapian_update_build_more,
fts_backend_xapian_refresh,
fts_backend_xapian_rescan,
fts_backend_xapian_optimize,
fts_backend_default_can_lookup,
fts_backend_xapian_lookup,
fts_backend_xapian_lookup_multi,
fts_backend_xapian_lookup_done
}
}; 

THank you 


On 2019-01-05 08:49, Stephan Bosch wrote:

Op 04/01/2019 om 11:17 schreef Joan Moreau via dovecot: 


Why not, but please guide me about the core structure (mandatory funcitons, 
etc..) of a typical Dovecot FTS plugin

The Dovecot API documentation is not exhaustive everywhere, but the basics are 
documented. The remaining questions can be answered by looking at examples 
found in similar plugins or the relevant API sources.

I know of one FTS plugin not written by Dovecot developers:

https://github.com/atkinsj/fts-elasticsearch

If you really wish to do something like this, just go ahead. It will not be a 
small effort though. As soon as you have concrete questions, we can help you 
(don't expect rapid responses though).

Regards,

Stephan.

Re: Solr -> Xapian ?

2019-01-04 Thread Joan Moreau via dovecot
Also, a description of the "to be" functions of the backend: 


struct fts_backend fts_backend_xapian = {
.name = "xapian",
.flags = FTS_BACKEND_FLAG_NORMALIZE_INPUT, -> WHAT OTHER FLAGS ? 


{
fts_backend_xapian_alloc,
fts_backend_xapian_init,
fts_backend_xapian_deinit,
fts_backend_xapian_get_last_uid,
fts_backend_xapian_update_init,
fts_backend_xapian_update_deinit,
fts_backend_xapian_update_set_mailbox,
fts_backend_xapian_update_expunge,
fts_backend_xapian_update_set_build_key,
fts_backend_xapian_update_unset_build_key,
fts_backend_xapian_update_build_more,
fts_backend_xapian_refresh,
fts_backend_xapian_rescan,
fts_backend_xapian_optimize,
fts_backend_default_can_lookup,
fts_backend_xapian_lookup,
fts_backend_xapian_lookup_multi,
fts_backend_xapian_lookup_done
}
};

On 2019-01-04 20:33, Joan Moreau via dovecot wrote:

Yes but: 

1 - is there a documentation of the main object ? (fts_backend, mail_user, mailbox, etc..) 

2 - What are the mandatory functions ? 

3 - Search : Supposedly, the FTS shall have several parameters : the keyword(s), the user & mailbox, and the fields (to, from, body, etc..) to be includude in the search. What is the function called in the plugin ? 

4 - Indexing : Somehow, what is the logic ? fts core just ask to "index me this email of this mailbox" ? or this is delegated to the plugin to sort out which emails it has indexed yet or not ? 

Thank you 

On 2019-01-04 18:49, admin wrote: 
A starting point would be to have a look at the current FTS plugins: 

https://github.com/dovecot/core/tree/master/src/plugins/fts-solr 
and 
https://github.com/dovecot/core/tree/master/src/plugins/fts-squat 

-M 

Am Freitag, den 04.01.2019, 18:17 +0800 schrieb Joan Moreau via dovecot: 

Why not, but please guide me about the core structure (mandatory funcitons, etc..) of a typical Dovecot FTS plugin 

On 2019-01-04 17:20, Aki Tuomi wrote: 
I hope you are aware that "linking with Xapian" requires somewhat more work than just -lxapian in linker? If you or someone feels like writing fts_xapian, go for it. 


Aki

On 04 January 2019 at 08:20 Joan Moreau via dovecot  wrote:

What about consedering linking Dovecot with Xapian librairies instead of
going to nightmare Solr ? 


https://xapian.org/features

On 2019-01-02 17:10, John Tulp wrote:

On Wed, 2019-01-02 at 00:59 -0800, M. Balridge wrote: The main problem is : 
After some time of indexing from Dovecot, Dovecot
returns errors (invalid SID, etc...) and Solr return "out of range
indexes" errors 
I've been watching the progress of this thread with no small concern, mainly

because I've been tasked with providing a server-side email search facility
with a budget and manpower level that comes down to mainly *1*, i.e., me.

I was expecting, given the strongly worded language about "just use
lucene/SOLR" and "ignore squat", that I should invest time + effort into this
JAVA nightmare that is SOLR.

I started with squat and another word-indexor system that used out-of-band
(not a dovecot plugin) software to provide rapid (sub-second) searches through
tens-of-GB-scale mailboxes.

Unlike what I was led to believe, the squat indexes worked surprisingly well,
once you sorted out the odd resource size (ulimit-related) issues (vsz &
friends) limitations. I did notice the "worst-case" search performance have
worryingly high O(x) increases in time, but I'd not seen anything that was a
dealbreaker. It goes without saying that various substring searches worked as
expected, for the most part.

My experiences with SOLR were similar to Messr. Moreau's: lots of startup
errors with provided schemata files. Lots of JAVA nonsense issues. Lots of
sensitivity to WHICH Java runtime, etc, etc. I finally fixated a specific JVM,
version of SOLR, and dovecot to find the "best" working combination, only to
find that the searches didn't work out as expected. I expected to be able to
do date-ranging based searches. Didn't work. I expected to search CONTENTS of
emails, and despite many days of tweaks, I couldn't get it to index even the
basics like filenames/types of attachments, so I could exposed
attachment-based searching to my users.

So, without rancour or antipathy, I ask the entire list: has ANYONE gotten a
Dovecot/solr-fts-plugin setup to work that provides as a BASELINE, all of the
following functionality:

1) The ability to search for a string within any of the structured fields
(from/subject) that returns correct results?

2) The ability to search for any string within the BODY of emails, including
the MIME attachment boundaries?

3) The ability to do "ranging" searches for structures within emails that
decompose to "dates" or other simple-numeric data?

OPTIONALLY, and this is probably way outside of the scope of the above,
despite the fact that it's listed as a "selling point" of SOLR versus other
full text search engines:

4) The abi

Re: Solr -> Xapian ?

2019-01-04 Thread Joan Moreau via dovecot
Yes but: 


1 - is there a documentation of the main object ? (fts_backend,
mail_user, mailbox, etc..) 

2 - What are the mandatory functions ? 


3 - Search : Supposedly, the FTS shall have several parameters : the
keyword(s), the user & mailbox, and the fields (to, from, body, etc..)
to be includude in the search. What is the function called in the plugin
? 


4 - Indexing : Somehow, what is the logic ? fts core just ask to "index
me this email of this mailbox" ? or this is delegated to the plugin to
sort out which emails it has indexed yet or not ? 

Thank you 


On 2019-01-04 18:49, admin wrote:

A starting point would be to have a look at the current FTS plugins: 

https://github.com/dovecot/core/tree/master/src/plugins/fts-solr 
and 
https://github.com/dovecot/core/tree/master/src/plugins/fts-squat 

-M 

Am Freitag, den 04.01.2019, 18:17 +0800 schrieb Joan Moreau via dovecot: 

Why not, but please guide me about the core structure (mandatory funcitons, etc..) of a typical Dovecot FTS plugin 

On 2019-01-04 17:20, Aki Tuomi wrote: 
I hope you are aware that "linking with Xapian" requires somewhat more work than just -lxapian in linker? If you or someone feels like writing fts_xapian, go for it. 


Aki

On 04 January 2019 at 08:20 Joan Moreau via dovecot  wrote:

What about consedering linking Dovecot with Xapian librairies instead of
going to nightmare Solr ? 


https://xapian.org/features

On 2019-01-02 17:10, John Tulp wrote:

On Wed, 2019-01-02 at 00:59 -0800, M. Balridge wrote: The main problem is : 
After some time of indexing from Dovecot, Dovecot
returns errors (invalid SID, etc...) and Solr return "out of range
indexes" errors 
I've been watching the progress of this thread with no small concern, mainly

because I've been tasked with providing a server-side email search facility
with a budget and manpower level that comes down to mainly *1*, i.e., me.

I was expecting, given the strongly worded language about "just use
lucene/SOLR" and "ignore squat", that I should invest time + effort into this
JAVA nightmare that is SOLR.

I started with squat and another word-indexor system that used out-of-band
(not a dovecot plugin) software to provide rapid (sub-second) searches through
tens-of-GB-scale mailboxes.

Unlike what I was led to believe, the squat indexes worked surprisingly well,
once you sorted out the odd resource size (ulimit-related) issues (vsz &
friends) limitations. I did notice the "worst-case" search performance have
worryingly high O(x) increases in time, but I'd not seen anything that was a
dealbreaker. It goes without saying that various substring searches worked as
expected, for the most part.

My experiences with SOLR were similar to Messr. Moreau's: lots of startup
errors with provided schemata files. Lots of JAVA nonsense issues. Lots of
sensitivity to WHICH Java runtime, etc, etc. I finally fixated a specific JVM,
version of SOLR, and dovecot to find the "best" working combination, only to
find that the searches didn't work out as expected. I expected to be able to
do date-ranging based searches. Didn't work. I expected to search CONTENTS of
emails, and despite many days of tweaks, I couldn't get it to index even the
basics like filenames/types of attachments, so I could exposed
attachment-based searching to my users.

So, without rancour or antipathy, I ask the entire list: has ANYONE gotten a
Dovecot/solr-fts-plugin setup to work that provides as a BASELINE, all of the
following functionality:

1) The ability to search for a string within any of the structured fields
(from/subject) that returns correct results?

2) The ability to search for any string within the BODY of emails, including
the MIME attachment boundaries?

3) The ability to do "ranging" searches for structures within emails that
decompose to "dates" or other simple-numeric data?

OPTIONALLY, and this is probably way outside of the scope of the above,
despite the fact that it's listed as a "selling point" of SOLR versus other
full text search engines:

4) The ability to do searches against any attachments that are able to be
post-processed and hyper-indexed by SOLR+Tika?

-

SOLR seems to have "brand cachet", so presumably it actually works (for 
somebody).

Dovecot has not a little "brand cachet", and for me, I have innate faith and
trust in Timo and his software. I am no stranger to the "costs" of "free"
software, in that you sacrifice your own blood, sweat, and tears just to get
these disparate pieces to work together.

I *DO* respect that Timo has to keep the lights (and sauna) on in Finland.
Maybe there's a super-secret (no advertised prices, "carrier-only" price list)
with _Dovecot, Oy_ wherein the above ARE actually available for something less
than 6.022 x 10^23 Euros per centi-second of licencing fees.

But please, level with

Re: Solr -> Xapian ?

2019-01-04 Thread Joan Moreau via dovecot

Why not, but please guide me about the core structure (mandatory
funcitons, etc..) of a typical Dovecot FTS plugin 


On 2019-01-04 17:20, Aki Tuomi wrote:

I hope you are aware that "linking with Xapian" requires somewhat more work than just -lxapian in linker? If you or someone feels like writing fts_xapian, go for it. 


Aki

On 04 January 2019 at 08:20 Joan Moreau via dovecot  wrote:

What about consedering linking Dovecot with Xapian librairies instead of
going to nightmare Solr ? 


https://xapian.org/features

On 2019-01-02 17:10, John Tulp wrote:

On Wed, 2019-01-02 at 00:59 -0800, M. Balridge wrote: The main problem is : 
After some time of indexing from Dovecot, Dovecot
returns errors (invalid SID, etc...) and Solr return "out of range
indexes" errors 
I've been watching the progress of this thread with no small concern, mainly

because I've been tasked with providing a server-side email search facility
with a budget and manpower level that comes down to mainly *1*, i.e., me.

I was expecting, given the strongly worded language about "just use
lucene/SOLR" and "ignore squat", that I should invest time + effort into this
JAVA nightmare that is SOLR.

I started with squat and another word-indexor system that used out-of-band
(not a dovecot plugin) software to provide rapid (sub-second) searches through
tens-of-GB-scale mailboxes.

Unlike what I was led to believe, the squat indexes worked surprisingly well,
once you sorted out the odd resource size (ulimit-related) issues (vsz &
friends) limitations. I did notice the "worst-case" search performance have
worryingly high O(x) increases in time, but I'd not seen anything that was a
dealbreaker. It goes without saying that various substring searches worked as
expected, for the most part.

My experiences with SOLR were similar to Messr. Moreau's: lots of startup
errors with provided schemata files. Lots of JAVA nonsense issues. Lots of
sensitivity to WHICH Java runtime, etc, etc. I finally fixated a specific JVM,
version of SOLR, and dovecot to find the "best" working combination, only to
find that the searches didn't work out as expected. I expected to be able to
do date-ranging based searches. Didn't work. I expected to search CONTENTS of
emails, and despite many days of tweaks, I couldn't get it to index even the
basics like filenames/types of attachments, so I could exposed
attachment-based searching to my users.

So, without rancour or antipathy, I ask the entire list: has ANYONE gotten a
Dovecot/solr-fts-plugin setup to work that provides as a BASELINE, all of the
following functionality:

1) The ability to search for a string within any of the structured fields
(from/subject) that returns correct results?

2) The ability to search for any string within the BODY of emails, including
the MIME attachment boundaries?

3) The ability to do "ranging" searches for structures within emails that
decompose to "dates" or other simple-numeric data?

OPTIONALLY, and this is probably way outside of the scope of the above,
despite the fact that it's listed as a "selling point" of SOLR versus other
full text search engines:

4) The ability to do searches against any attachments that are able to be
post-processed and hyper-indexed by SOLR+Tika?

-

SOLR seems to have "brand cachet", so presumably it actually works (for 
somebody).

Dovecot has not a little "brand cachet", and for me, I have innate faith and
trust in Timo and his software. I am no stranger to the "costs" of "free"
software, in that you sacrifice your own blood, sweat, and tears just to get
these disparate pieces to work together.

I *DO* respect that Timo has to keep the lights (and sauna) on in Finland.
Maybe there's a super-secret (no advertised prices, "carrier-only" price list)
with _Dovecot, Oy_ wherein the above ARE actually available for something less
than 6.022 x 10^23 Euros per centi-second of licencing fees.

But please, level with us faithful users.  Does this morass of Java B.S.
actually work, and if not, please just deprecate and remove this moribund
software, and stop trying to bury the only FTS plugin many of us HAVE actually
gotten to work.  (Pretty please?)

I respect that Messr. Moreau has made an earnest effort to get this JAVA B.S.
to actually work, as I have. 


He persevered where I'd given up. He's vocal about it, and now I'm chiming in
that this ornate collection of switchblades only cuts those who try to use them.

Respectfully,
=M=  Fascinating...

SOLR says the following are powered by SOLR...

https://wiki.apache.org/solr/PublicServers

Perhaps if you could find out from that list which of them are using
SOLR in conjunction with Dovecot...

food for thought...

Solr -> Xapian ?

2019-01-03 Thread Joan Moreau via dovecot

What about consedering linking Dovecot with Xapian librairies instead of
going to nightmare Solr ? 


https://xapian.org/features

On 2019-01-02 17:10, John Tulp wrote:


On Wed, 2019-01-02 at 00:59 -0800, M. Balridge wrote: The main problem is : 
After some time of indexing from Dovecot, Dovecot
returns errors (invalid SID, etc...) and Solr return "out of range
indexes" errors 
I've been watching the progress of this thread with no small concern, mainly

because I've been tasked with providing a server-side email search facility
with a budget and manpower level that comes down to mainly *1*, i.e., me.

I was expecting, given the strongly worded language about "just use
lucene/SOLR" and "ignore squat", that I should invest time + effort into this
JAVA nightmare that is SOLR.

I started with squat and another word-indexor system that used out-of-band
(not a dovecot plugin) software to provide rapid (sub-second) searches through
tens-of-GB-scale mailboxes.

Unlike what I was led to believe, the squat indexes worked surprisingly well,
once you sorted out the odd resource size (ulimit-related) issues (vsz &
friends) limitations. I did notice the "worst-case" search performance have
worryingly high O(x) increases in time, but I'd not seen anything that was a
dealbreaker. It goes without saying that various substring searches worked as
expected, for the most part.

My experiences with SOLR were similar to Messr. Moreau's: lots of startup
errors with provided schemata files. Lots of JAVA nonsense issues. Lots of
sensitivity to WHICH Java runtime, etc, etc. I finally fixated a specific JVM,
version of SOLR, and dovecot to find the "best" working combination, only to
find that the searches didn't work out as expected. I expected to be able to
do date-ranging based searches. Didn't work. I expected to search CONTENTS of
emails, and despite many days of tweaks, I couldn't get it to index even the
basics like filenames/types of attachments, so I could exposed
attachment-based searching to my users.

So, without rancour or antipathy, I ask the entire list: has ANYONE gotten a
Dovecot/solr-fts-plugin setup to work that provides as a BASELINE, all of the
following functionality:

1) The ability to search for a string within any of the structured fields
(from/subject) that returns correct results?

2) The ability to search for any string within the BODY of emails, including
the MIME attachment boundaries?

3) The ability to do "ranging" searches for structures within emails that
decompose to "dates" or other simple-numeric data?

OPTIONALLY, and this is probably way outside of the scope of the above,
despite the fact that it's listed as a "selling point" of SOLR versus other
full text search engines:

4) The ability to do searches against any attachments that are able to be
post-processed and hyper-indexed by SOLR+Tika?

-

SOLR seems to have "brand cachet", so presumably it actually works (for 
somebody).

Dovecot has not a little "brand cachet", and for me, I have innate faith and
trust in Timo and his software. I am no stranger to the "costs" of "free"
software, in that you sacrifice your own blood, sweat, and tears just to get
these disparate pieces to work together.

I *DO* respect that Timo has to keep the lights (and sauna) on in Finland.
Maybe there's a super-secret (no advertised prices, "carrier-only" price list)
with _Dovecot, Oy_ wherein the above ARE actually available for something less
than 6.022 x 10^23 Euros per centi-second of licencing fees.

But please, level with us faithful users.  Does this morass of Java B.S.
actually work, and if not, please just deprecate and remove this moribund
software, and stop trying to bury the only FTS plugin many of us HAVE actually
gotten to work.  (Pretty please?)

I respect that Messr. Moreau has made an earnest effort to get this JAVA B.S.
to actually work, as I have. 


He persevered where I'd given up. He's vocal about it, and now I'm chiming in
that this ornate collection of switchblades only cuts those who try to use them.

Respectfully,
=M=

Fascinating...

SOLR says the following are powered by SOLR...

https://wiki.apache.org/solr/PublicServers

Perhaps if you could find out from that list which of them are using
SOLR in conjunction with Dovecot...

food for thought...

Solr - complete setup (update)

2019-01-03 Thread Joan Moreau via dovecot
Hi 


This is the summary of my work with SOLR-Dovecot, in my QUEST TO
REPRODUCE THE PREVIOULSY EXCELLENT WORK OF FTS_SQUAT 


@Aki : Based on the time I have spent on this, I would love to see you
updating the Wiki with those improvements, and adding my name somewhere 

@All : Hope it helps 

- INSTALLATION: 


-> Create a clean install using the default, (at least in the Archlinux
package), and do a "sudo -u solr solr create -c dovecot ". The config
files are then in /opt/solr/server/solr/dovecot/conf and datafiles in
/opt/solr/server/solr/dovecot/data 

-> In /opt/solr/server/solr/dovecot/conf/solrconfig.xml: 


* around line 313, change false to
true 


* around line 147, set 2000
(or above) 

* around line 696 : uncomment hdr 


* around line 1127, before , add
 


* around line 1161, delete the whole name="add-schema-fields"> 


   * around line 1192, remove the whole name="add-unknown-fields-to-the-schema" ... /> 

-> Remove /opt/solr/server/solr/dovecot/conf/managed-schema 

-> Change "schema.xml" by the one below to reproduce fts_squat behavior 
(equivalent to " fts_squat = partial=3 full=25" in dovecot.conf) (note :
such a huge trouble to replace a single line setup, anyway...) 


-> Move /opt/solr/server/solr (or the subfolder data) to a partition
with *space*, ideally ext4 or faster file system (it looks like Solr is
not considering using a simple mysql database, which would make sense to
avoid all the fuzz and let it transit to a non-java state, but that is
another story) 

-> Config of dovecot.conf is as below 


-> The systemd unit shall specify high ulimit for files and proc (see
below) 


-> Increase the memory available for the JavaVM (I put 12Gb as I have
quite a space on my server, but you may adapt it as per your specs) : in
/opt/solr/bin/solr.in.sh, set SOLR_HEAP="12288m" 


-> As Solr is complaining a lot, you may consider a filter for it in
your syslog-ng or journald as it pollutes greatly your audit files 

-> (re)Start solr (first) and dovecot by systemctl 

-> Launch redindex ( doveadm fts rescan -u  ) 

-> wait for a big while to let the system re-index all your mail boxes 

- BUGS SO FAR 


-> Line 620 of fts_solr dovecot plugin : the size oof header is
improperly calculated ("huge header" warning for a simple email, which
kilss the index of that considered email, so basically MOST emails as
the calculation is wrong) 


-> The UID returned by SOlr is to be considered as a STRING (and that is
maybe the source of problem of the "out of bound" errors in fts_solr
dovecot, as "long" is not enough) 


-> Java errors : A lot of non sense for me, I am not expert in Java.
But, with increased memory, it seems not crashing, even if complaining
quite a lot in the logs 

---SCHEMA.XML IN /OPT/SOLR/SERVER/SOLR/DOVECOT/CONF 




id






























 















 

-- DOVECOT.CONF 

mail_plugins = fts fts_solr 


plugin {
plugin = fts fts_solr managesieve sieve 


fts = solr
fts_autoindex = yes
fts_enforced = yes
fts_solr = url=http://127.0.0.1:8983/solr/dovecot/ 


(replace 127.0.0.1 by your solr server if you want to use an external
server)
(...) 

} 

-- /ETC/SYSTEMD/SYSTEM/MULTI-USER.TARGET.WANTS/SOLR.SERVICE 


[Unit]
Description=Solr full text search engine
After=network.target 


[Service]
Type=simple
User=solr
Group=solr
PrivateTmp=yes
WorkingDirectory=/opt/solr
LIMITNOFILE=65000
LIMITNPROC=65000
ExecStart=/opt/solr/bin/solr start -f 


[Install]
WantedBy=multi-user.target

Solr - complete setup

2019-01-03 Thread Joan Moreau via dovecot
Hi 


This is the summary of my work with SOLR-Dovecot, in my QUEST TO
REPRODUCE THE PREVIOULSY EXCELLENT WORK OF FTS_SQUAT 


@Aki : Based on the time I have spent on this, I would love to see you
updating the Wiki with those improvements, and adding my name somewhere 

@All : Hope it helps 

- INSTALLATION: 


-> Create a clean install using the default, (at least in the Archlinux
package), and do a "sudo -u solr solr create -c dovecot ". The config
files are then in /opt/solr/server/solr/dovecot/conf and datafiles in
/opt/solr/server/solr/dovecot/data 

-> In /opt/solr/server/solr/dovecot/conf/solrconfig.xml: 


* around line 313, change false to
true 


* around line 147, set 2000
(or above) 


* around line 1127, before , add
 


* around line 1161, delete the whole name="add-schema-fields"> 


   * around line 1192, remove the whole name="add-unknown-fields-to-the-schema" ... /> 

-> Remove /opt/solr/server/solr/dovecot/conf/managed-schema 

-> Change "schema.xml" by the one below to reproduce fts_squat behavior 
(equivalent to " fts_squat = partial=3 full=25" in dovecot.conf) (note :
such a huge trouble to replace a single line setup, anyway...) 


-> Move /opt/solr/server/solr (or the subfolder data) to a partition
with *space*, ideally ext4 or faster file system (it looks like Solr is
not considering using a simple mysql database, which would make sense to
avoid all the fuzz and let it transit to a non-java state, but that is
another story) 

-> Config of dovecot.conf is as below 


-> The systemd unit shall specify high ulimit for files and proc (see
below) 


-> Increase the memory available for the JavaVM (I put 12Gb as I have
quite a space on my server, but you may adapt it as per your specs) : in
/opt/solr/bin/solr.in.sh, set SOLR_HEAP="12288m" 


-> As Solr is complaining a lot, you may consider a filter for it in
your syslog-ng or journald as it pollutes greatly your audit files 

-> (re)Start solr (first) and dovecot by systemctl 

-> Launch redindex ( doveadm fts rescan -u  ) 

-> wait for a big while to let the system re-index all your mail boxes 

- BUGS SO FAR 


-> Line 620 of fts_solr dovecot plugin : the size oof header is
improperly calculated ("huge header" warning for a simple email, which
kilss the index of that considered email, so basically MOST emails as
the calculation is wrong) 


-> The UID returned by SOlr is to be considered as a STRING (and that is
maybe the source of problem of the "out of bound" errors in fts_solr
dovecot, as "long" is not enough) 


-> Java errors : A lot of non sense for me, I am not expert in Java.
But, with increased memory, it seems not crashing, even if complaining
quite a lot in the logs 

---SCHEMA.XML IN /OPT/SOLR/SERVER/SOLR/DOVECOT/CONF 




id






























 















 

-- DOVECOT.CONF 

mail_plugins = fts fts_solr 


plugin {
plugin = fts fts_solr managesieve sieve 


fts = solr
fts_autoindex = yes
fts_enforced = yes
fts_solr = url=http://127.0.0.1:8983/solr/dovecot/ 


(replace 127.0.0.1 by your solr server if you want to use an external
server)
(...) 

} 

-- /ETC/SYSTEMD/SYSTEM/MULTI-USER.TARGET.WANTS/SOLR.SERVICE 


[Unit]
Description=Solr full text search engine
After=network.target 


[Service]
Type=simple
User=solr
Group=solr
PrivateTmp=yes
WorkingDirectory=/opt/solr
LIMITNOFILE=65000
LIMITNPROC=65000
ExecStart=/opt/solr/bin/solr start -f 


[Install]
WantedBy=multi-user.target

Solr - schema.xml

2019-01-02 Thread Joan Moreau via dovecot
Hi, 


This is the best I can do for having a SCHEMA.XML matching the needs of
an email user. Use case on Solr 7.5.0 


(note : this does not solve any of the bugs previously mentionned, but
at least, the logic of Solr is back on track) 

--- 




id






























 

















Re: Solr

2019-01-02 Thread Joan Moreau via dovecot
In the code, it says 

#define SOLR_HEADER_MAX_SIZE (1024*1024) 

and line 620 


if (!ctx->truncate_header &&
str_len(ctx->cur_value) >= SOLR_HEADER_MAX_SIZE) {
/* a large header */ 

so this is a 1Mo header. This is of course completely wrong. 


Maybe this is not the root cause of the errors of fts_solr, but maybe
this will help 


On 2019-01-02 18:00, Joan Moreau via dovecot wrote:

Another bug appearing today: 

Jan 02 09:59:08 indexer-worker(j...@grosjo.net)<6777>: Warning: FTS-SOLR(j...@grosjo.net): Mailbox XX UID=121635 HEADER SIZE IS HUGE, TRUNCATING 


header of the said email has nothing of "huge"

On 2019-01-02 15:22, Joan Moreau via dovecot wrote:

Refinement of the schema.xml (below) 

THis however does not solve the "no results" and "Out of range" errors in Dovecot and Solr 




id






















 

















Re: Solr

2019-01-02 Thread Joan Moreau via dovecot
Another bug appearing today: 


Jan 02 09:59:08
indexer-worker(j...@grosjo.net)<6777>:
Warning: FTS-SOLR(j...@grosjo.net): Mailbox XX UID=121635 HEADER SIZE
IS HUGE, TRUNCATING 


header of the said email has nothing of "huge"

On 2019-01-02 15:22, Joan Moreau via dovecot wrote:

Refinement of the schema.xml (below) 

THis however does not solve the "no results" and "Out of range" errors in Dovecot and Solr 




id






















 

















Re: Solr

2019-01-01 Thread Joan Moreau via dovecot
The real main differecne seems coming from "diffconfig.xml" 


When I put yours, Solr delete (!) schema.xml and create a
"manage-schema" and starts complaining about useless types (tdates,
booleans, etc..) that are not needed for Mail fileds 


When I put mine (from standard distribution of Arch), it keeps things as
they are (yeah !), does not complains about those useless types and
startup properly. 

I attach my diffconfig 


But these are the configurations that one should adjust as per his/her
own use. 


The main problem is : After some time of indexing from Dovecot, Dovecot
returns errors (invalid SID, etc...) and Solr return "out of range
indexes" errors 


On 2019-01-02 07:49, Joan Moreau wrote:

Hi 

Solr is a standard package in ArchLinux. ("pacman -S solr") . the systemd installation script is included (and it is launching /opt/solr/bin/solr.in.sh) 

Instance : sudo -u solr /opt/solr/bin/solr create -c dovecot -> this creates a separate folder with default solrconfig.xml, schema.xml, etc.. 

I made a symlink of the data folder to a second drive (ext4) much bigger 

On 2018-12-31 14:09, Daniel Miller wrote: 
On 12/29/2018 4:49 PM, Joan Moreau wrote: 
Also :


- Java is 10.0.2

Same as me. 
- If i delete schema.xml but create only managed-schema, the solr refuses to start with a java error "schema.xml missing"


Ok...so we need to do some more digging.

How did you install Solr? (I downloaded a "binary" installation and unpacked it)

How did you create the dovecot instance?  (I've provided explicit instructions 
for how I did it - did you follow those exactly or something different)?

How are you starting Solr?  (I use the provided "solr/bin/solr start" command, 
wrapped inside a systemd service).

--
Daniel




  

  
  7.5.0

  

  
  
  

  
  

  
  

  
  
  
  

  
  ${solr.data.dir:}


  
  

  
  

  
  


2000















${solr.lock.type:native}













  


  
  
  
  
  
  

  
  



  ${solr.ulog.dir:}
  ${solr.ulog.numVersionBuckets:65536}




  ${solr.autoCommit.maxTime:15000}
  false





  ${solr.autoSoftCommit.maxTime:-1}




  

  
  

  
  


1024























true





20


200




  

  


  

  



false

  


  
  








  

  
  
  


  explicit
  10
 hdr 
 xml 








  

  
  

  explicit
  json
  true

  


  
  

  explicit

  

  

  _text_

  

  
  

  true
  ignored_
  _text_

  

  

  
  

text_general





  default
  _text_
  solr.DirectSolrSpellChecker
  
  internal
  
  0.5
  
  2
  
  1
  
  5
  
  4
  
  0.01
  




  

  
  

  
  default
  on
  true
  10
  5
  5
  true
  true
  10
  5


  spellcheck

  

  
  

  
  

  true


  tvComponent

  

  

  
  

  
  

  true
  false


  terms

  


  
  

string
  

  
  

  explicit


  elevator

  

  
  

  
  
  

  100

  

  
  

  
  70
  
  0.5
  
  [-\w ,/\n\]{20,200}

  

  
  

  
  

  

  
  

  
  

  
  

  
  

  
  

  

  
  

  
  

  

  

  10
  .,!? 

  

  

  
  WORD
  
  
  en
  US

  

  

  

  
  
  
  
  
[^\w-\.]
_
  
  
  
  
  

  -MM-dd'T'HH:mm:ss.SSSZ
  -MM-dd'T'HH:mm:ss,SSSZ
  -MM-dd'T'HH:mm:ss.SSS
  -MM-dd'T'HH:mm:ss,SSS
  -MM-dd'T'HH:mm:ssZ
  -MM-dd'T'HH:mm:ss
  -MM-dd'T'HH:mmZ
  -MM-dd'T'HH:mm
  -MM-dd HH:mm:ss.SSSZ
  -MM-dd HH:mm:ss,SSSZ
  -MM-dd HH:mm:ss.SSS
  -MM-dd HH:mm:ss,SSS
  -MM-dd HH:mm:ssZ
  -MM-dd HH:mm:ss
  -MM-dd HH:mmZ
  -MM-dd HH:mm
  -MM-dd

  

  

  
  

  
  

  
  

  
  
 
 
 
 
 
 
 
 

  

text/plain; charset=UTF-8
  
 
  
  
${velocity.template.base.dir:}
${velocity.solr.resource.loader.enabled:true}
${velocity.params.resource.loader.enabled:false}
  

  
  
5
  

  
  
  

  
  
  


  
  



Re: Solr

2019-01-01 Thread Joan Moreau via dovecot
Refinement of the schema.xml (below) 


THis however does not solve the "no results" and "Out of range" errors
in Dovecot and Solr 




id






















 

















Re: Solr

2019-01-01 Thread Joan Moreau via dovecot
Other use case : 


I type "must" in the search filed-> I have some returns , but very not
all, for instance "solarmust" is not in the results 

If I type "solarmust" -> then I have the solarmust mail 


Honestly, this is highly unstable. Not sure whereas bugs come from Solr
or Dovecot 


Below my adjusted (corrections from the one of Daniel who is definitely
not working) schema.xml 




id





























 


On 2019-01-02 10:04, Joan Moreau wrote:

The first result show "no results" in dovecot for any search by header (I typed an email add in RoundCube search box, using Dovecot as back end, using Solr as own backend) 

So many efforts for crappy results. 

Can't we really revive Squat ? It is 2 lines of config, and no single problems 

On January 2, 2019 08:16:33 Joan Moreau via dovecot  wrote: 

and the first line of the diff is : 

< this file, see http://wiki.apache.org/solr/SolrConfigXml. 
---

this file, see http://wiki.apache.org/solr/SolrConfigXml.

38c38
< 6.4.1
---

7.5.0


So, are you running 6.4.1 or 7.5.0  

On 2019-01-02 08:12, Joan Moreau wrote: 

The real main differecne seems coming from "diffconfig.xml" 

When I put yours, Solr delete (!) schema.xml and create a "manage-schema" and starts complaining about useless types (tdates, booleans, etc..) that are not needed for Mail fileds 

When I put mine (from standard distribution of Arch), it keeps things as they are (yeah !), does not complains about those useless types and startup properly. 

I attach my diffconfig 

But these are the configurations that one should adjust as per his/her own use. 

The main problem is : After some time of indexing from Dovecot, Dovecot returns errors (invalid SID, etc...) and Solr return "out of range indexes" errors 

On 2019-01-02 07:49, Joan Moreau wrote: 

Hi 

Solr is a standard package in ArchLinux. ("pacman -S solr") . the systemd installation script is included (and it is launching /opt/solr/bin/solr.in.sh) 

Instance : sudo -u solr /opt/solr/bin/solr create -c dovecot -> this creates a separate folder with default solrconfig.xml, schema.xml, etc.. 

I made a symlink of the data folder to a second drive (ext4) much bigger 

On 2018-12-31 14:09, Daniel Miller wrote: 
On 12/29/2018 4:49 PM, Joan Moreau wrote: 
Also :


- Java is 10.0.2

Same as me. 
- If i delete schema.xml but create only managed-schema, the solr refuses to start with a java error "schema.xml missing"


Ok...so we need to do some more digging.

How did you install Solr? (I downloaded a "binary" installation and unpacked it)

How did you create the dovecot instance?  (I've provided explicit instructions 
for how I did it - did you follow those exactly or something different)?

How are you starting Solr?  (I use the provided "solr/bin/solr start" command, 
wrapped inside a systemd service).

--
Daniel

Re: Solr

2019-01-01 Thread Joan Moreau via dovecot


The first result show "no results" in dovecot for any search by header (I 
typed an email add in RoundCube search box, using Dovecot as back end, 
using Solr as own backend)


So many efforts for crappy results.

Can't we really revive Squat ? It is 2 lines of config, and no single problems


On January 2, 2019 08:16:33 Joan Moreau via dovecot  
wrote:

and the first line of the diff is :
< this file, see http://wiki.apache.org/solr/SolrConfigXml.
---

this file, see http://wiki.apache.org/solr/SolrConfigXml.

38c38
< 6.4.1
---

7.5.0


So, are you running 6.4.1 or 7.5.0 

On 2019-01-02 08:12, Joan Moreau wrote:

The real main differecne seems coming from "diffconfig.xml"

When I put yours, Solr delete (!) schema.xml and create a "manage-schema" 
and starts complaining about useless types (tdates, booleans, etc..) that 
are not needed for Mail fileds


When I put mine (from standard distribution of Arch), it keeps things as 
they are (yeah !), does not complains about those useless types and startup 
properly.


I attach my diffconfig



But these are the configurations that one should adjust as per his/her own use.

The main problem is : After some time of indexing from Dovecot, Dovecot 
returns errors (invalid SID, etc...) and Solr return "out of range indexes" 
errors







On 2019-01-02 07:49, Joan Moreau wrote:

Hi

Solr is a standard package in ArchLinux. ("pacman -S solr") . the systemd 
installation script is included (and it is launching /opt/solr/bin/solr.in.sh)


Instance : sudo -u solr /opt/solr/bin/solr create -c dovecot -> this 
creates a separate folder with default solrconfig.xml, schema.xml, etc..


I made a symlink of the data folder to a second drive (ext4) much bigger










On 2018-12-31 14:09, Daniel Miller wrote:

On 12/29/2018 4:49 PM, Joan Moreau wrote:

Also :

- Java is 10.0.2

Same as me.

- If i delete schema.xml but create only managed-schema, the solr refuses 
to start with a java error "schema.xml missing"


Ok...so we need to do some more digging.

How did you install Solr? (I downloaded a "binary" installation and 
unpacked it)


How did you create the dovecot instance?  (I've provided explicit 
instructions for how I did it - did you follow those exactly or something 
different)?


How are you starting Solr?  (I use the provided "solr/bin/solr start" 
command, wrapped inside a systemd service).


--
Daniel




Re: Solr

2019-01-01 Thread Joan Moreau via dovecot
and the first line of the diff is : 

< this file, see http://wiki.apache.org/solr/SolrConfigXml. 
---

this file, see http://wiki.apache.org/solr/SolrConfigXml.

38c38
< 6.4.1
---

7.5.0


So, are you running 6.4.1 or 7.5.0  


On 2019-01-02 08:12, Joan Moreau wrote:

The real main differecne seems coming from "diffconfig.xml" 

When I put yours, Solr delete (!) schema.xml and create a "manage-schema" and starts complaining about useless types (tdates, booleans, etc..) that are not needed for Mail fileds 

When I put mine (from standard distribution of Arch), it keeps things as they are (yeah !), does not complains about those useless types and startup properly. 

I attach my diffconfig 

But these are the configurations that one should adjust as per his/her own use. 

The main problem is : After some time of indexing from Dovecot, Dovecot returns errors (invalid SID, etc...) and Solr return "out of range indexes" errors 

On 2019-01-02 07:49, Joan Moreau wrote: 

Hi 

Solr is a standard package in ArchLinux. ("pacman -S solr") . the systemd installation script is included (and it is launching /opt/solr/bin/solr.in.sh) 

Instance : sudo -u solr /opt/solr/bin/solr create -c dovecot -> this creates a separate folder with default solrconfig.xml, schema.xml, etc.. 

I made a symlink of the data folder to a second drive (ext4) much bigger 

On 2018-12-31 14:09, Daniel Miller wrote: 
On 12/29/2018 4:49 PM, Joan Moreau wrote: 
Also :


- Java is 10.0.2

Same as me. 
- If i delete schema.xml but create only managed-schema, the solr refuses to start with a java error "schema.xml missing"


Ok...so we need to do some more digging.

How did you install Solr? (I downloaded a "binary" installation and unpacked it)

How did you create the dovecot instance?  (I've provided explicit instructions 
for how I did it - did you follow those exactly or something different)?

How are you starting Solr?  (I use the provided "solr/bin/solr start" command, 
wrapped inside a systemd service).

--
Daniel

Re: Solr

2019-01-01 Thread Joan Moreau via dovecot
Hi 


Solr is a standard package in ArchLinux. ("pacman -S solr") . the
systemd installation script is included (and it is launching
/opt/solr/bin/solr.in.sh) 


Instance : sudo -u solr /opt/solr/bin/solr create -c dovecot -> this
creates a separate folder with default solrconfig.xml, schema.xml, etc..


I made a symlink of the data folder to a second drive (ext4) much bigger


On 2018-12-31 14:09, Daniel Miller wrote:

On 12/29/2018 4:49 PM, Joan Moreau wrote: 


Also :

- Java is 10.0.2
Same as me. 


- If i delete schema.xml but create only managed-schema, the solr refuses to start with a 
java error "schema.xml missing"

Ok...so we need to do some more digging.

How did you install Solr? (I downloaded a "binary" installation and unpacked it)

How did you create the dovecot instance?  (I've provided explicit instructions 
for how I did it - did you follow those exactly or something different)?

How are you starting Solr?  (I use the provided "solr/bin/solr start" command, 
wrapped inside a systemd service).

--
Daniel

Re: Solr

2018-12-29 Thread Joan Moreau via dovecot
wrong - but it appears your view towards the situation is there is a bug in Dovecot related to this problem.  That may well be - but I generally approach these matters from the assumption that *I* made the error in configuration and go from there.  I'm not an official rep for any product nor claim to be any form of expert in these matters - but I do have a working setup and I'd like to help you if I can.  If you're willing to - take a deep breath and let's try starting over. 

Looking back through your emails there were two items that stood out - your Dovecot config has two settings I don't use: "fts_decoder" and "fts_enforced".  I also asked you earlier whether or not NFS is involved here and I didn't see an answer - please clarify. 


I suggest you try once more: delete Solr completely.  Re-install per the directions and use *my* 
managed-schema.  Also comment out the Dovecot directives for "fts_decoder" and 
"fts_enforced" so you're closer to my setup.  Try running again and then post back - I'll 
do what I can.  Based on the fact that Dovecot+Solr 7.5+my schema is working for me leads me to 
believe we can get it working for you as well.

Daniel

On 12/15/2018 2:42 PM, Joan Moreau wrote: 

here my latest schema.xml (remove the "long" type hich seems to be very deprecated in 7.x) 




id








 








 























 

On 2018-12-15 20:54, Joan Moreau wrote: 

Daniel, 

I have done that so any times (deleteing the data folders, recreating the instance, restarting etc...) 

But this is really not the issue 

The issue is 
1 - fts_solr reports errors in the log file (this is a pure dovecot issue) : how to have much more details on what fts_solr sends to Slor server and what does it returns ? 
2 - Solr returns properly for a few hours, then starts crashing or responding non-sense after some time  

Additionally, is there a doc of fts-squat in order to adjust the code to new releases of dovect ? 


On December 12, 2018 4:44:10 PM Daniel Miller via dovecot  
wrote: On 12/11/2018 4:46 AM, Joan Moreau via dovecot wrote:

I shared the errors already so many times (check this mailinling for "solr" in teh title) 

Contrary to what you say, with SOlr 7.5 and Dovecot git,  I had to remove the "managed-schema" to make solr respond a bit properly. It relies on schema.xml 

In order to create the instance, no, it copies  the default config in the dovecot instance. 

I'm not a Solr expert by any means but I believe you are incorrect. 

As of Solr 5.x the managed-schema file is the primary method for configuration.  The method I detailed previously for setting up a config helps automate creating new Solr instances - but as I stated you can either setup a Solr template and then create the instance from that or create an instance using the default template and then adjust it. 

The part that you *must* do after creating from the default template is stop the server, delete the entire "/solr/dovecot/data" folder, then install the correct managed-schema file, then restart the server.  The server will not function with mismatched schema/data. 


If you'll try that - explicitly "rm -rf /solr/dovecot/data", copy the 
managed-schema file into the conf folder, and restart - things will either work or there's 
something else that needs correction. --
Daniel

Re: Solr

2018-12-29 Thread Joan Moreau via dovecot
at *I* made the error in configuration and go from there.  I'm not an official rep for any product nor claim to be any form of expert in these matters - but I do have a working setup and I'd like to help you if I can.  If you're willing to - take a deep breath and let's try starting over. 

Looking back through your emails there were two items that stood out - your Dovecot config has two settings I don't use: "fts_decoder" and "fts_enforced".  I also asked you earlier whether or not NFS is involved here and I didn't see an answer - please clarify. 


I suggest you try once more: delete Solr completely.  Re-install per the directions and use *my* 
managed-schema.  Also comment out the Dovecot directives for "fts_decoder" and 
"fts_enforced" so you're closer to my setup.  Try running again and then post back - I'll 
do what I can.  Based on the fact that Dovecot+Solr 7.5+my schema is working for me leads me to 
believe we can get it working for you as well.

Daniel

On 12/15/2018 2:42 PM, Joan Moreau wrote: 

here my latest schema.xml (remove the "long" type hich seems to be very deprecated in 7.x) 




id








 








 























 

On 2018-12-15 20:54, Joan Moreau wrote: 

Daniel, 

I have done that so any times (deleteing the data folders, recreating the instance, restarting etc...) 

But this is really not the issue 

The issue is 
1 - fts_solr reports errors in the log file (this is a pure dovecot issue) : how to have much more details on what fts_solr sends to Slor server and what does it returns ? 
2 - Solr returns properly for a few hours, then starts crashing or responding non-sense after some time  

Additionally, is there a doc of fts-squat in order to adjust the code to new releases of dovect ? 


On December 12, 2018 4:44:10 PM Daniel Miller via dovecot  
wrote: On 12/11/2018 4:46 AM, Joan Moreau via dovecot wrote:

I shared the errors already so many times (check this mailinling for "solr" in teh title) 

Contrary to what you say, with SOlr 7.5 and Dovecot git,  I had to remove the "managed-schema" to make solr respond a bit properly. It relies on schema.xml 

In order to create the instance, no, it copies  the default config in the dovecot instance. 

I'm not a Solr expert by any means but I believe you are incorrect. 

As of Solr 5.x the managed-schema file is the primary method for configuration.  The method I detailed previously for setting up a config helps automate creating new Solr instances - but as I stated you can either setup a Solr template and then create the instance from that or create an instance using the default template and then adjust it. 

The part that you *must* do after creating from the default template is stop the server, delete the entire "/solr/dovecot/data" folder, then install the correct managed-schema file, then restart the server.  The server will not function with mismatched schema/data. 


If you'll try that - explicitly "rm -rf /solr/dovecot/data", copy the 
managed-schema file into the conf folder, and restart - things will either work or there's 
something else that needs correction. --
Daniel

Re: Solr

2018-12-21 Thread Joan Moreau via dovecot
Dear Daniel. 

Thank you for your kind reply. 

Regarding NFS, no, there is nothing like this in my setup. 

Deleteing SOLR and recreating it, I did it so  many times already. 


I started with *your* setup in the first place, as FTS_squat (which
actually works very well and very straightforward, I have no clue why
going for SOlr which is just a pain and not maintaining squat), and it
leads to totally funny results (for instance, I type "emirates" in my
"Air Companies" subfolder and get a lot of results .. but of competing
companies :D ) 

I added the fts_enforce following AKi advice. 

I removed fts_decoder for the time being. 


I don't know where to go now. Dovcot still returning errors and SOlr
still companinig with "Out of range" and other Java errors. 


Bottom line, I am back to squat, but as it is not maintained so crashed
also times to times. 

I think we should discuss on 


(1) Why the damn choice of Solr has been main. As you empahised,
maintainend so many independent software is a pain 


(2) If there is a real reason why going for SOlr, how to have a working
(i.e. getting the right results to the end user) setup ? 


(3) If there iare no tangible reason, what about maintaining fts_squat ,
which did the job nicely for years and no complains about. 


On 2018-12-16 08:51, Daniel Miller via dovecot wrote:

Joan, 

I understand and sympathize with your frustration - trying to get multiple applications to work together, particularly given the lack of documentation for some of them, can be extremely challenging.  That said, I suggest you consider an alternative viewpoint.  Frequently being misunderstood myself I apologize in advance if I'm reading you wrong - but it appears your view towards the situation is there is a bug in Dovecot related to this problem.  That may well be - but I generally approach these matters from the assumption that *I* made the error in configuration and go from there.  I'm not an official rep for any product nor claim to be any form of expert in these matters - but I do have a working setup and I'd like to help you if I can.  If you're willing to - take a deep breath and let's try starting over. 

Looking back through your emails there were two items that stood out - your Dovecot config has two settings I don't use: "fts_decoder" and "fts_enforced".  I also asked you earlier whether or not NFS is involved here and I didn't see an answer - please clarify. 


I suggest you try once more: delete Solr completely.  Re-install per the directions and use *my* 
managed-schema.  Also comment out the Dovecot directives for "fts_decoder" and 
"fts_enforced" so you're closer to my setup.  Try running again and then post back - I'll 
do what I can.  Based on the fact that Dovecot+Solr 7.5+my schema is working for me leads me to 
believe we can get it working for you as well.

Daniel

On 12/15/2018 2:42 PM, Joan Moreau wrote: 

here my latest schema.xml (remove the "long" type hich seems to be very deprecated in 7.x) 




id








 








 























 

On 2018-12-15 20:54, Joan Moreau wrote: 

Daniel, 

I have done that so any times (deleteing the data folders, recreating the instance, restarting etc...) 

But this is really not the issue 

The issue is 
1 - fts_solr reports errors in the log file (this is a pure dovecot issue) : how to have much more details on what fts_solr sends to Slor server and what does it returns ? 
2 - Solr returns properly for a few hours, then starts crashing or responding non-sense after some time  

Additionally, is there a doc of fts-squat in order to adjust the code to new releases of dovect ? 


On December 12, 2018 4:44:10 PM Daniel Miller via dovecot  
wrote: On 12/11/2018 4:46 AM, Joan Moreau via dovecot wrote:

I shared the errors already so many times (check this mailinling for "solr" in teh title) 

Contrary to what you say, with SOlr 7.5 and Dovecot git,  I had to remove the "managed-schema" to make solr respond a bit properly. It relies on schema.xml 

In order to create the instance, no, it copies  the default config in the dovecot instance. 

I'm not a Solr expert by any means but I believe you are incorrect. 

As of Solr 5.x the managed-schema file is the primary method for configuration.  The method I detailed previously for setting up a config helps automate creating new Solr instances - but as I stated you can either setup a Solr template and then create the instance from that or create an instance using the default template and then adjust it. 

The part that you *must* do after creating from the default template is stop the server, delete the entire "/solr/dovecot/data" folder, then install the correct managed-schema file, then restart the server.  The server will not function with mismatched schema/data. 


If you'll try that - explicitly "rm -rf /solr/dovecot/data", copy the 
managed-schema file into the conf folder, and restart - things will either work or there's 
something else that needs correction. --
Daniel

Re: Solr

2018-12-15 Thread Joan Moreau via dovecot

here my latest schema.xml (remove the "long" type hich seems to be very
deprecated in 7.x) 




id








 








 























 


On 2018-12-15 20:54, Joan Moreau wrote:

Daniel, 

I have done that so any times (deleteing the data folders, recreating the instance, restarting etc...) 

But this is really not the issue 

The issue is 
1 - fts_solr reports errors in the log file (this is a pure dovecot issue) : how to have much more details on what fts_solr sends to Slor server and what does it returns ? 
2 - Solr returns properly for a few hours, then starts crashing or responding non-sense after some time  

Additionally, is there a doc of fts-squat in order to adjust the code to new releases of dovect ? 


On December 12, 2018 4:44:10 PM Daniel Miller via dovecot  
wrote: On 12/11/2018 4:46 AM, Joan Moreau via dovecot wrote:

I shared the errors already so many times (check this mailinling for "solr" in teh title) 

Contrary to what you say, with SOlr 7.5 and Dovecot git,  I had to remove the "managed-schema" to make solr respond a bit properly. It relies on schema.xml 

In order to create the instance, no, it copies  the default config in the dovecot instance. 

I'm not a Solr expert by any means but I believe you are incorrect. 

As of Solr 5.x the managed-schema file is the primary method for configuration.  The method I detailed previously for setting up a config helps automate creating new Solr instances - but as I stated you can either setup a Solr template and then create the instance from that or create an instance using the default template and then adjust it. 

The part that you *must* do after creating from the default template is stop the server, delete the entire "/solr/dovecot/data" folder, then install the correct managed-schema file, then restart the server.  The server will not function with mismatched schema/data. 


If you'll try that - explicitly "rm -rf /solr/dovecot/data", copy the 
managed-schema file into the conf folder, and restart - things will either work or there's 
something else that needs correction. --
Daniel

  1   2   >