groupoffice icon indicating copy to clipboard operation
groupoffice copied to clipboard

Search Folder Mail / Search All

Open migoe101 opened this issue 4 years ago • 11 comments

It would be nice to have an option to search in more than one only IMAP connected Mailbox.

migoe101 avatar Dec 20 '21 16:12 migoe101

Agreed, technically its complicated and performance will be an issue when having lots of mailboxes. We'll look into this when refactoring the mail module.

mschering avatar Jan 03 '22 09:01 mschering

Would also be nice to reduce the amount of clicks to search in all folders, from 4 to 0 (remember the configuration)

tmikaeld avatar Mar 08 '22 09:03 tmikaeld

Perhaps some kind of workaround could be a virtual all folder in dovecot automatically generated for all users.

Tried this with these two docs https://doc.dovecot.org/configuration_manual/virtual_plugin/ Seems that ox have the virtual/all folder integrated in the webclient. https://documentation.open-xchange.com/7.8.2/middleware/components/search/crossfolder_fts_in_mail.html

thomasgg23 avatar Dec 11 '22 16:12 thomasgg23

The virtual folder looks promising. Did that work out for you?

mschering avatar Dec 12 '22 07:12 mschering

Kind of, have to do some more testing with dovecot.

But first need to setup a test machine, can't do this on production ;-) Have a busy week so this might take some time. Will report back.

thomasgg23 avatar Dec 12 '22 07:12 thomasgg23

Hows the current state on this? Currently I will switch from OX to groupoffice but the unified mail inbox and the search within this inbox is one of my mostly used features. I have a lot of mail addresses and currently finding a specific mail is in groupoffice a real pain.

SchroeerM avatar Jan 03 '24 11:01 SchroeerM

Hi,

It's not a Group-Office feature at the moment. But the IMAP server dovecot can make it work by implementing that virtual folder. If you run dovecot you can set this up. See:

https://doc.dovecot.org/configuration_manual/virtual_plugin/

mschering avatar Jan 04 '24 09:01 mschering

Got it running with the following config and tools for fulltextsearch (Ubuntu 22.04 LTS) Xapian Search Engine and fts-xapian plugin for dovecot (https://github.com/grosjo/fts-xapian).

Be carefull when changing the config files, those are the settings that worked on our installations.

Fulltext search engine Install packages apt-get install dovecot-dev libxapian30 dovecot-fts-xapian

Configuration of dovecot /etc/dovecot/99-groupoffice.conf mail_plugins = (...) fts fts_xapian

plugin {  
      fts = xapian fts_xapian = partial=2 full=20 attachments=0 verbose=0  
      fts_autoindex = yes fts_enforced = yes  
      fts_autoindex_exclude = \\Trash  
      }

      service indexer-worker {  
      #Increase vsz_limit to 2GB or above.  
      #Or 0 if you have rather large memory usable on your server, which is preferred for performance)  
      vsz_limit = 2G  
      process_limit = 0  
      }
}

Restart dovecot. Reindex all mailboxes with doveadm index -A -q \*

Virtual All folder Add an virtual all folder, for showing all messages regardless of folders etc.

Create an folder for all users with the settings for the All folder

  • mkdir -p /var/mail/virtual/All
  • chown vmail:vmail -R /var/mail/virtual/All
  • create an file /var/mail/virtual/All/dovecot-virtual with the following content
*  
-INBOX/Trash  
-INBOX/Trash/*  
-INBOX/Spam  
-INBOX/Spam/*  
  all

This will show all mails except those in Trash or Spam, be carefull to add a whitespace before the last all

Configuration of dovecot /etc/dovecot/99-groupoffice.conf

  • Add virtual to mail_plugins
  • uncomment the lines
mailbox virtual/All {  
 special_use = \All  
}
  • Insert the following lines
        prefix = virtual/  
        separator = /  
        hidden = no  
        list = yes  
        subscriptions = no  
        location = virtual:/var/mail/virtual:INDEX=/var/mail/vhosts/%d/%n/virtual  
        }

This will add the virtual/all folder to every user and show all emails in their folders.

thomasgg23 avatar Mar 14 '24 10:03 thomasgg23

Nice! Got to get that into the main package.

mschering avatar Mar 14 '24 14:03 mschering

One thing I encountered today is the following:

  • We have an user who uses multiple email mailboxes on different servers. Now our server supports fulltextsearch on our imap server, but on the other mailboxses there is no server-side search on their imap server.
  • It would be nice if the mail client in groupoffice could remember the last search option per mailbox or put it back to the default "all fields". Otherwise switching between mailboxes keeps timeouting the client because GO always switches back to search the "whole message"

image

thomasgg23 avatar Mar 14 '24 14:03 thomasgg23

I've made some progress on implementing this in the groupoffice-mailserver package. I made some changes to your example:

  1. I've hidden the "virtual/All" folder. When a user chooses to search all folders it will use this folder automatically server side.
  2. To make the above easier I added the folder option to the submenu: image
  3. I removed the "Full message" option from the menu above. Instead I determine server side to use the FTS when the imap server supports it. I've made this by adding a custom IMAP capability flag "XFTS" when it's enabled. If the flag is enabled or the config.php option "email_allow_body_search" is true then it will use FTS. Otherwise it will use a header search for from, subject, to and cc. This way the user doesn't have to care about choosing "All fields" or "Full message".
  4. FTS can be enabled per user in the postfixadmin GUI.

In case you're interested in the configuration you can find that here:

https://github.com/Intermesh/docker-groupoffice-mailserver/tree/master/etc/dovecot

All this nice stuff will be available in the next 6.8 release. Thanks for posting your wonderful example.

Best regards, Merijn

mschering avatar Apr 23 '24 09:04 mschering

Very good solution for the users.

Will try to test it on the weekend on my second server.

thomasgg23 avatar Apr 23 '24 11:04 thomasgg23