Coder Social home page Coder Social logo

notmuch-addrlookup-c's Introduction

Notmuch Address Lookup tool — in C

This is an address lookup tool similar to the addrlookup one found in the (apparently unmaintained) Vala Notmuch binding, using the Notmuch database as source.

The one and only feature is accepting a string as first argument, and it will use the Notmuch database to output the names and e-mail addresses of the people you have exchanged e-mails with, most used ones first. This works neatly as address completer for the Notmuch Emacs interface.

One more thing: I plan to keep the tool up-to-date when new Notmuch releases change the API of the library. Precisely the reasons why this small project was started are:

  • Lack of maintenance of the Vala version.
  • The Python version included with Notmuch can be a tad slow when working with big amounts of messages (over tens of thousands).
  • The Go implementation included with Notmuch insists in outputting all the text in lowercase. Plus, requires a working Go development setup to build it.

Building

Make sure you have the following installed, plus their development packages:

  • libnotmuch — Included with Notmuch.
  • GLib — It is a dependency of Notmuch as well.
  • pkg-config
  • GNU Make and a working C compiler.

Then just build and install it:

make
sudo cp notmuch-addrlookup /usr/local/bin

Using

You can check that the program works by invoking from a shell. The only argument it takes is a string, which is searched for in the e-mail addresses contained in the headers of the messages indexed by Notmuch. Example output (names and addresses are not real):

% notmuch-addrlookup peter
Peter Jones <[email protected]>
John Peters <[email protected]>
Peter Tosh <[email protected]>
Noren Petersen <[email protected]>
%

Emacs UI

The Emacs Notmuch UI can be configured to use the tool for completing addresses when composing.

Mutt

The Mutt UA can be configured to use notmuch-addrlookup by setting the following options:

set query_command="notmuch-addrlookup --mutt '%s'"

License

This software is distributed under the terms of the MIT license:

Copyright (c) 2014 Adrian Perez de Castro <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

notmuch-addrlookup-c's People

Contributors

aperezdc avatar cellscape avatar curiousleo avatar james-w avatar jtsymon avatar lelit avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.