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

Re: specifying generic save-hook



G'day Chris,

* Chris Grossmann <chris@xxxxxxxxxxxx> [040406 17:01]:
> Having the outside contacts sorted by name is actually
> rather inconvenient, it's a lot easier to have them sorted
> by company.  I have a folder for all "companyA" contacts,
> and another for "companyB" contacts.  Whether or not the
> email is actually from "Joe" or "Larry" isn't near as
> useful, especially for retrieval of old messages.

That's what I was guessing.  I suppose an easy(ish) solution would be
to have a mutt macro (^n for New Customer maybe...) which:
  1) Pipes the message into a script which
   a) Grabs the 'From' address
   b) Strips everything before and including the @ and leaves the rest
      (I'm not sure what you would want to do with non-US companies
      (i.e. stripping '\.com$' won't work with amazon.co.uk and you
      probably don't want to strip '\.co.*$' as you would then have
      problems with foreign.correspondent.com (for example))
   c) _Appends_ the new mailbox to a auto-generated file in your .mutt/
      directory (I'd use a fcc-save-hook, but your taste may vary)
  2) Re-Source the auto-generated file

Then you should be able to save the new companies correspondence...

Of course, the implementation is left as an exercise for the reader.

However do post it and then someone in the future will be saved the
trouble!  ;-)

> As I said, I can do what I want, it just means adding
> another .muttrc entry every time a new customer pops up..
> Which, incidentally, I already have to do for colorizing my
> inbox with different colors for customers.  :)

Ah.  Combine them both into the same script!  :)


Cheers and good luck,

S.

Attachment: signature.asc
Description: Digital signature