muttvcardsearch is a small mutt carddav search utility for your Owncloud or SOGo server. It is written in C++ and depends only on libcurl and sqlite3. It supports multiple servers, i.e. you can have as many carddav resources (url's) as you like.
The vcard code is entirely based on libvcard, but does not need QT and also fixes some major bugs I found in libvcard (parsing vcards from file, parsing attribute values containing a colon...). It is not feature complete, i.e. not all functions from libvcard are implemented at this time but it works quiet well for me. I plan to implement all features from the original libvcard-library (currently 1.0.2).
You can use one of the following tools to build the project
- QtCreator
- cmake
first, install
- libcurl / libcurl-dev
- sqlite3 / sqlite3-dev
then
- clone the repository
- cd into the new repository
- compile
- for QtCreator execute
qmake; make; sudo make install
- for cmake execute
mkdir build; cd build; cmake -DCMAKE_BUILD_TYPE=Release ..; make; sudo make install
- for QtCreator execute
Call muttvcardsearch without arguments to see how to configure it. There are 4 options to add/edit carddav url's
--name=
- set a label under which this entry will be stored and identified for updates--server=
- provide the carddav url here--username=
- your username--password=
- your secret password
There is one option which can be used to create a local cache
--create-local-cache
This will download all your contacts into ~/.config/muttvcardsearch/cache.sqlite3. A new search should then search the local cache first and if your query does not return any data it will search the server(s). The cache will combine all results found in all your servers / carddav resources
Note:
- Include the values in double quotes if you have whitespace in it.
- The options don't have to be in a particular order
- To change a setting just reconfigure and pass
--name=your-label
to identify the entry and then apply the changes you have. Always provide all settings - even if you only would like to change a single one. - To add an entry (i.e. a new vcard list) provide a new label, i.e.
--name=your-new-label
, and then pass the rest as shown above. - There is currently no option to show a single entry, show all entries or delete one (or all). This can all be done manually using your favorite editor... see TODO.
Set your query command in your .muttrc
-
set query_command = "muttvcardsearch '%s'"
-
the value in %s will used to search for
- firstname
- lastname
- email address(es)
in each vcard
-
muttvcardsearch will print out Search returned no results
if
- property first name is empty or
- property last name is empty or
- vcard has no email address(es)
If there is a cache file muttvcardsearch will automatically insert new records not found in the cache but found online.
If you upgrade from version 1.4 or earlier, remove your config file first and reconfigure the application.
- add option --update-local-cache to refresh the cache instead to force you to re-create it every time you made a change on your server. This will only work after the migration away from libvcard (this requirement has been met with version 1.4)
- add option to save a contact into your vcard store (just like abook)
- add option to show a config entry (or all entries) and delete an entry