Skip to content

Drop support for automatic_addressbook plugin #267

@JocelynDelalande

Description

@JocelynDelalande

automatic_addressbook plugin has received no commit since 2020.
It has an open issue about upgrade since 2021 without any answer from maintainers.

Moreover, automatic contacts collection has been integrated into core since Roundcube 1.5. Which might explain maintainers lack of interest.

So IMHO there is no need to keep this plugin in roundcube_ynh

Actually, on my ynh instance, it seems that the plugin has been accidentaly disabled on upgrade. I don't think this is intended as roundcube_ynh still mentions automatic_addressbook plugin in its doc.

The result of this plugin being disabled is that the collected contacts vanished (actualy the db table is still present, but its content is not accessible to user).

Difference between core-feature and automatic_addressbook feature

Core-feature (since RC 1.5)

simple db schema with only name and email fields, this collected contacts addressbook is read-only.

automatic_addressbook plugin feature

Regular addressbook entry with all regular contact fields available (phone, postall address, whatever). They can be edited.

A migration path ?

Here is a simple SQL to migrate the plugin addressbook (tabe collected_contacts) to the core-feature collected addresses (table collected_addresses). Such migration could be added to the ynh package upgrade script.

INSERT INTO collected_addresses (
  changed,
  email,
  name,
  user_id,
  type
) SELECT  
   MAX(cc.changed),
   cc.email,
   cc.name,
   cc.user_id,
   1
FROM collected_contacts cc 
LEFT JOIN collected_addresses ca 
ON (cc.email = ca.email) AND (cc.user_id = ca.user_id) 
WHERE ca.email IS  NULL
GROUP BY cc.user_id, cc.email;

the JOIN/WHERE part is to avoid duplicates.

drawback : if a contact collected via plugin was edited, enriched with additional information (phone, postal address, whatever), extra info is lost by this migration.

An alternative but more complex approach would be to differentiate « bare addresses » from « enriched contacts » by inspecting the content of collected_contacts.vcard and migrating the contact either to collected_addresses (bare addresses) or to contacts (enriched contact).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions