On Wed, Dec 20, 2000 at 09:59:58PM +0530, Suresh Ramasubramanian wrote:
> Christian Ordig proclaimed on mutt-users that: 

> > I prefer using an external query script I made with Perl. Using this script
> > is more comfortable and I can search for full names and even on comments
> > I save to every address... so I am not forced to memory any alias name ...
> > If anyone is interested in this little thing I made ... simply ask ...
>  
>  please post it / put it up on your webpage and post a link ;)
ok here we go ...

I recognized it is only about 1kBytes ... so I'll post it here.

Install:
--------

It's only a quick and dirty hack I did some Sunday afternoon ... so 
please don't blame me for any damages or datalosses ... or exploding
cats or whatever.

I am using an extra account for eMailing, so these scripts are simply
in ~/ on my system. You might want to install them in ~/bin or something
like that. But be careful when doing so: pathes are still hardcoded
(but it shouldn't be a problem in a 500bytes script, should it? ;_)

1. simply copy the attached perl scripts to your home directory and make
   them executable.

2. the address database file will also reside in ~/ and is called "addresses"
   by default.
   It has the following format:
   
   Full Name;[EMAIL PROTECTED];comment1 comment2 comment3
   
   one line per record and table columns delimited by ";"

3. there will be a file called ~/addresses.added which holds newly added
   addresses (they can simply be appended to the main database using
   cat ~/addresses.added >> ~/addresses;rm ~/addresses.added
   this file is created by mutt_add.pl - which is called by pressing "a"
   in the index or pager view. (look at my .muttrc parts below) and adds
   the eMail address under the cursor to the address database.
   mutt_add.pl needs a temporary file ~/msg.txt ! If this file exists it'll
   be deleted !
   The brave of you can also add the new addresses directly to ~/adresses
   simply change the filename in ~/mutt_add.pl accordingly...

4. change your .muttrc:
   ------------------------ SNIP --------------------
   macro index "a" "\eC~/msg.txt\n\n!~/mutt_add.pl\n"
   macro pager "a" "\eC~/msg.txt\n\n!~/mutt_add.pl\n"      
   set query_command = "~/mutt_query.pl '%s'"
   ------------------------ SNAP --------------------
   
   this will allow:
       - searching thru the addressbook using "Q"
       - email address completation using ^T
       - adding new eMail addresses with comments to the addressbook 
         using "a" (Full name and eMail address are seperated automaticly.
         you'll be presented with the result and will be asked for comments.)
   - "Q" and ^T search the whole record for matching strings ... so you can
     also search for comments
   - to list the whole address book use Q or ^T without query string.

5. There's no tool for editing the address book, yet. But vi should do it...

I am using those scripts with mutt 1.1.11i

Any hints are welcome. You may also ask if you have any problems 
using these scripts.

Hope to help making everyday's live a little easier ... 

I am using this script with about 200 addresses and it's nicer then
aliases ever could be ,-))

--
Christian Ordig             | Homepage: http://thor.prohosting.com/~chrordig/ 
Germany                     |    eMail: Christian Ordig <[EMAIL PROTECTED]>

mutt_add.pl

mutt_query.pl

PGP signature

Reply via email to