Where does Horde keep its address book? How to restore it?

Created:

2016-11-16 13:13:16 UTC

Modified:

2017-08-16 17:32:38 UTC

1

Was this article helpful?


Have more questions?

Submit a request

Where does Horde keep its address book? How to restore it?

Applicable to:

  • Plesk 11.x for Linux
  • Plesk 12.0 for Linux

Symptoms

  • Where does Horde webmail application keep its address book?
  • Some mail accounts have lost their address book. How do I restore them?

Resolution

Horde webmail keeps its address books in its own database.

This scheme has the advantage of independence from mail servers. So if we switch mail servers (from QMail to Postfix, for example), users have their address books preserved.

Horde uses Turba as its address book manager. Turba has its own tables in horde database:

turba_objects
turba_shares
turba_shares_groups
turba_shares_users

Address books are stored in turba_objects table. This table has a pretty complicated structure to accomodate all fields for an address book entry:

+-----------------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------------+--------------+------+-----+---------+-------+
| object_id | varchar(32) | NO | PRI | NULL | |
| owner_id | varchar(255) | NO | MUL | NULL | |
| object_type | varchar(255) | NO | | Object | |
| object_uid | varchar(255) | YES | | NULL | |
| object_members | blob | YES | | NULL | |
| object_firstname | varchar(255) | YES | MUL | NULL | |
| object_lastname | varchar(255) | YES | MUL | NULL | |
| object_middlenames | varchar(255) | YES | | NULL | |
| object_nameprefix | varchar(32) | YES | | NULL | |
| object_namesuffix | varchar(32) | YES | | NULL | |
| object_alias | varchar(32) | YES | | NULL | |
| object_photo | blob | YES | | NULL | |
| object_phototype | varchar(10) | YES | | NULL | |
| object_bday | varchar(10) | YES | | NULL | |
| object_homestreet | varchar(255) | YES | | NULL | |
| object_homepob | varchar(10) | YES | | NULL | |
| object_homecity | varchar(255) | YES | | NULL | |
| object_homeprovince | varchar(255) | YES | | NULL | |
| object_homepostalcode | varchar(10) | YES | | NULL | |
| object_homecountry | varchar(255) | YES | | NULL | |
| object_workstreet | varchar(255) | YES | | NULL | |
| object_workpob | varchar(10) | YES | | NULL | |
| object_workcity | varchar(255) | YES | | NULL | |
| object_workprovince | varchar(255) | YES | | NULL | |
| object_workpostalcode | varchar(10) | YES | | NULL | |
| object_workcountry | varchar(255) | YES | | NULL | |
| object_tz | varchar(32) | YES | | NULL | |
| object_geo | varchar(255) | YES | | NULL | |
| object_email | varchar(255) | YES | MUL | NULL | |
| object_homephone | varchar(25) | YES | | NULL | |
| object_workphone | varchar(25) | YES | | NULL | |
| object_cellphone | varchar(25) | YES | | NULL | |
| object_fax | varchar(25) | YES | | NULL | |
| object_pager | varchar(25) | YES | | NULL | |
| object_title | varchar(255) | YES | | NULL | |
| object_role | varchar(255) | YES | | NULL | |
| object_logo | blob | YES | | NULL | |
| object_logotype | varchar(10) | YES | | NULL | |
| object_company | varchar(255) | YES | | NULL | |
| object_category | varchar(80) | YES | | NULL | |
| object_notes | text | YES | | NULL | |
| object_url | varchar(255) | YES | | NULL | |
| object_freebusyurl | varchar(255) | YES | | NULL | |
| object_pgppublickey | text | YES | | NULL | |
| object_smimepublickey | text | YES | | NULL | |
+-----------------------+--------------+------+-----+---------+-------+

If a user has suddenly lost his addres book, it can be restored.

Plesk takes daily database dumps, that are available here:

/var/lib/psa/dumps

Any other dumps can also be used, as long as they contain horde database.

After the dump is found, you can grep for address book entries for user like this:

grep -oP "'user@domain.tld','Object'" <mysql_dump_file>

This works because 'user@domain.tld','Object' is a pretty unique combination that rarely gives false positives.

Additionally, the dumps can be opened with Unix less pager and then, its / and ? commands can be used for the search:

CREATE TABLE `turba_objects` (

This string defines the place in a dump, where all address book entries are stored. the mail user search can be started from there by using forward lookup again: /

Have more questions? Submit a request
Please sign in to leave a comment.