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

Re: Using Mairix



On Thu, Oct 18, 2007 at 04:55:37PM +0200, Eyolf ?strem wrote:
> On 17.10.2007 (20:50), Rem P Roberti wrote:
> > I just installed Mairix, and the program works fine, except that I don't
> > seem to be able to access the mfolder from within Mutt.  When I do a
> > search Mairix creates the requiste "mfolder" containing cur, new, and
> > tmp, and the result of the search is placed in the "new" subdirectory.
> > But I am unable to access the results of the search in the Mutt index.
> > The mfolder shows up in the index, but it is empty.  Anyone tell me what
> > I am doing wrong?
> 
> I remember having the same kind of problem in the beginning, but I
> can't remember how I solved it. I *think* it was down to having a bad
> syntax in my search terms, so that the search didn't catch anything.
> Perhaps also because I hadn't set the search areas properly. 
> Here's what I have in my .mairixrc:
> 
>     base=~/Mail
>     maildir=*...
>     omit=spam
>     omit=trash
>     omit=mairix
>     database=~/.mutt/mairix-db
>     mfolder=mairix
> 
> And the macros in .muttrc: 
> 
>     macro index,pager \em "<shell-escape>mairix " "Run a Mairix search"
>     macro index,pager \ef "<change-folder-readonly>=mairix\n" "Search results"
> 
> On that note: can someone tell me if there is a way to combine the two
> into one? I would like to go automatically to the mairix folder once
> the search is over, instead of having to go there manually. Is that
> possible?

Yes, it's possible -- I've done it using namazu instead of mairix and it
works well, and AFAICT a solution using mairix will be very similar (but
apparently without the hassle of building a folder of search results
manually -- namazu doesn't do this for you).  Here's an excerpt from my
.muttrc, adapted to more closely fit your situation:

macro index,pager ,f 
"<shell-escape>findmail<return><change-folder-readonly>=mairix<return>" "Search 
all e-mail using mairix"

(That's all one line, of course.)

`findmail' is a script I wrote, which for you would be something like
this:

#!/bin/sh
query="$1"
if [ "x$query" = "x" ]; then
    # Prompt user for the query
    echo -n "Find: " && read query
fi
if [ "x$query" = "x" ]; then
    # User entered an empty query
    exit 0
fi
mairix "$query"

If you like, I can post the whole kit and kaboodle so you can see
exactly how I do it using namazu.

> Eyolf

HTH,

Paul.

-- 
Paul Hoffman <nkuitse@xxxxxxxxxxx>