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

Re: aliasing mailing lists



On 17May2006 16:05, cga2000 <cga2000@xxxxxxxxxxxxx> wrote:
| Is there any way I can make mutt even more effective by aliasing
| mailing lists on the fly? Same as using the default 'a' for private
| parties.
| 
| The messages from the mailing lists in my setup have headers like:
| 
| 'From: the OP'
| 'To:   the mailing list'
| 
| So it obviously won't work with the 'a' command.
| 
| Has anyone concocted a simple strategy that would save me the trouble
| of entering all these mailing lists I am subscribed to in my alias file?

Well, it's not quite what you want, but I have a script I use for a
similar purpose. I have a cross referencing system in my inbound and
outbound mail filing that copies messages to special xref-foo folders
based on addresses in the headers. So I have a frequent need to add new
messages to the cross references, and have bound "A" to this task.

The macro looks like this:

  <pipe-message>grabaliases -<enter><copy-message>+spool-refile<enter>

You are interested in doing the first part, somewhat modified.

Grabaliases is here:

  http://www.cskk.ezoshosting.com/cs/css/bin/grabaliases

It gets the addresses from the headers, inserts them in my xref tabel and
fires up an editor. What you probably want to do is get the addresses
from the To: line, append them to your list subscription file as mutt
subscribe commands (which you should keep separate for this purpose,
and just "source" it from your main muttrc), then run up an editor to
tidy up.

For that purpose maybe you might like this script:

  http://www.cskk.ezoshosting.com/cs/css/bin/grabaddrs-all

which pulls all the addresses from all the address-like headers; cut
it back to grab just from To: (and maybe CC:). Then turn them into
subscribe lines with some awk, append to file, and edit. So a short
script like this:

  #!/bin/sh
  grabaddrs-tocc | awk '{print "subscribe", $1}' >>your-subscriptions.txt
  ${EDITOR:-vi} your-subscriptions.txt </dev/tty >/dev/tty 2>&1

where "grabaddrs-tocc" is the cut back "grabaddrs-all" script.
Then your macro would be something like:

  <pipe-message>grab-mlist -<enter>

where "grab-mlist" is the short shell script above.

Note that grabaddrs-all is not a complete RFC822 address parser; it
just does ok with the command address renderings seen.  There are legal
addresses it won't recognise, but those seem to be very rare.

Cheers,
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

California is proud to be the home of the freeway.      - Ronald Reagan