<<< Date Index >>>     <<< Thread Index >>>

Re: Auto-complete address when sending email



Ok I've created this sh script in case anybody else is looking for what
I am:
    #!/bin/bash

    grep $1 
~/.mutt/cache/bodies/imap\:lmatteis\@imap.bioversity.cgiar.org/INBOX/* | awk -F 
\< '{print $2}' | awk 'NF != 0 {print}' | awk -F \> '{print $1}' |awk 'NF != 0 
{print}'

You can modify the INBOX path part. The rest is just a bunch of awk
commands to filter out the email part and to make it as clean as
possible.

You can add this to make it work in your .muttrc

    set query_command="~/.mutt/imapquery.sh '%s'"

And to use it just type ^t (Ctrl+t) when you're composing an email.

Hope this helps.

Luca


On Wed, Jan 19, 2011 at 04:08:26PM +0100, Luca Matteis wrote:
> This is what I got so far, it sort of works, no need of lbdb, just awk
> and grep.
> 
>     grep luca ~/.mutt/cache/bodies/imap\:lmatteis\@smtpyserver.org/INBOX/* | 
> awk -F \< '{print $2}' | awk -F \> '{print $1}'
> 
> Any help in cleaning it up a little?
> 
> On Wed, Jan 19, 2011 at 03:42:48PM +0100, Luca Matteis wrote:
> > Maybe I can just use a combination of grep and awk to filter my imap
> > cache/INBOX folder and use Mutts *query_command* tool, instead of all
> > this lbdb confusion.
> > 
> > What does query_command need to return so that auto-complete works?
> > 
> > 
> > On Wed, Jan 19, 2011 at 03:34:38PM +0100, Luca Matteis wrote:
> > > On Wed, Jan 19, 2011 at 09:15:17AM -0500, Patrick Shanahan wrote:
> > > > I use lbdb which iirc was included with the mutt package or at least
> > > > recommended at one time way back; I plead oldtimers  :^)
> > > 
> > > Can I use this with IMAP? I don't have procmail.