Contact Collector & Use Count deprecated
Introduction & General Concept
The contact collector is a system which helps users to find relevant contacts more easily. This includes normal contacts, user groups and resources. This makes it possible through two functionalities. For one the contact collector as the name suggest collects used contacts and provides them as a collection to the user. So everytime the user uses a new email address the contact collector create a new contact for this mail address. The user can find those contacts in the "Collected addresses" address book. On the other hand the contact collector also counts the usage of those as well as all other stored contacts and allows to sort them according to this usage. For example if a user uses a certain contact more often than others then this contact will come up first in autocomplete results.
Internal & External Contact Sources
Under the hood the contact collector actually consists of different subsystems for storing previously unknown contacts on the one hand, and managing the usage frequency of these as well as other contacts, groups, and resources individually for each user. This also include contacts in addressbooks from external sources.
Configuration
In this section we will take a closer look at how to configure the contact collector. For this you can find the documentation of all relevant configuration settings here and here.
First of all the contact collector is enabled by default, but if you want to disable it you can do so: com.openexchange.contactcollector.enabled=false
It is also possible to prevent users from deleting the collected addresses folder:
com.openexchange.contactcollector.folder.deleteDenied=true
Sometimes multiple contacts share the same email address. In those cases the usage is only increased for the first five found contacts. Usually this covers most cases but if you want to adjust this number you can do so with the com.openexchange.contactcollector.searchLimit
property.
Housekeeping and Clean-Up
Collected Contacts
With time the amount of collected contacts can grow to a significant size. Especially contacts which where only used once or twice. It is possible to clean up those contacts by configuring the com.openexchange.contactcollector.cleanupUnusedAfter
property. This property defines a time span after which a collected contact is removed if it only has a use count value of less than two. This time span is checked against the last time a collected contact is updated/used. So for example with a value of 4W
the contact collector removes every collected contact which has not been used in the last four weeks and which has a use count of less than two. This makes sure that only recent and most used contacts are left. This clean-up procedure only runs in case the user accesses the contact collector.
Use Counts
Besides removing collected contacts that have not been used further, the individual use counts of the contacts are also dynamic in a way that the counters are not only incremented, but also decremented if not being used for a certain time. Doing so, orphaned counters are purged eventually. Alongside, this implicitly adds some "recently used" semantics into use count sorting, which yields better results from the end user's perspective.
Similar as with purging collected contacts, you also define a time span via the property com.openexchange.objectusecount.cleanupTimespan
. Equally to the other one this time span defines the time after the last usage but it differs in that regard that the task runs daily instead of after each access. It also don't delete contacts entirely but instead reduces the use count by one and removes only the use count entries for all contacts which have a use count of 0, i.e. only the order of results sorted by use count is affected implicitly through this process.
Contact folder
Whenever a user performs a login and if the user has the COLLECT_EMAIL_ADDRESSES user permission the "Collected addresses" folder is created.
Contact Collection
Per default the contact collection is triggered whenever the user uses the email address of a contact (e.g. in case he creates an appointment with a contact) with the exception of email operations. You can however configure that operations in the mail module trigger contact collection with these properties. For example to collect both on access and on transport:
com.openexchange.user.contactCollectOnMailAccess=true
com.openexchange.user.contactCollectOnMailTransport=true
These settings can also be adjusted by the user himself in the mail settings.