Re: ANNOUNCE: nottoomuch-addresses.pl version 1.4

Subject: Re: ANNOUNCE: nottoomuch-addresses.pl version 1.4

Date: Fri, 16 Dec 2011 16:18:22 +0200

To: Philipp Überbacher, Tomi Ollila, notmuch@notmuchmail.org

Cc:

From: Tomi Ollila


On Fri, 16 Dec 2011 14:01:26 +0100, Philipp Überbacher <murks@lavabit.com> wrote:
> Quoting Tomi Ollila (2011-12-14 21:10:28)
> 
> Hi Tomi,
> can this be used to automatically populate abook?
> I wonder because alot uses abook for addresses, and this could be handy.

Converter from 'flat list of email-addresses' in
$HOME/.config/nottoomuch/addresses to abook format is probably pretty
trivial (unless it is binary which lessens triviality...)... But there
could be (updating) issues.

Alternative would be to run something like

  notmuch search --sort=newest-first --output=files '*' | 
  while read file; do abook --add-email "$file"; done

initially. then register current date using date=`$date +%s`

and, in following rounds run

  notmuch search --sort=newest-first --output=files $(($date - 604800)).. | 
  while read file; do abook --add-email "$file"; done

(604800 == 86400 * 7 -- 7 days -- just analogous what nottoomuch-addresses.sh
does)

Note that this is just untested example (read abook.1 a bit)


An alternative would be to make 'abook' run nottoomuch-addresses.sh for
address completion (then get it's output order for matches (email addresses
from recent messages first)) -- or even just run

  grep -aiF "$string" "${XDG_CONFIG_HOME:-$HOME/.config}/nottoomuch/addresses"

(this is what nottoomuch-addresses.sh does when finding matches for given
search string. One can imagine how fast this approach is...)

> Regards,
> Philipp

Tomi

Thread: