Re: aliasing mailing lists
On (14:58 18/05/06), David Woodfall <dave@xxxxxxxxxxxxxxx> put forth the
proposition:
> On (03:25 18/05/06), cga2000 <cga2000@xxxxxxxxxxxxx> put forth the
> proposition:
> > I already have a procmail set of rules that selects messages from
> > mailing lists and automatically copies them to an mbox in ~/mail/lists
> > whose name is the full name of the mailing list.
> >
> > ie.
> >
> > $ ls -1 ~/mail/lists
> >
> > bug-bash@xxxxxxx
> > debian-laptop@xxxxxxxxxxxxxxxx
> > debian-printing@xxxxxxxxxxxxxxxx
> > debian-user@xxxxxxxxxxxxxxxx
> > ...
> >
> > And naturally, my .muttrc has the subscribe commands to define as a
> > mailing list each file in the mail/lists directory.
> >
> > So, in order to generate a typo-free alias file for my mailing lists
> > I wrote a one-line script that pipes the above through awk like so:
> >
> > ls -1 ~/mail/lists | grep @ |awk -F@ '{print "alias" " " $1 " " "<" $1 "@"
> > $2 ">"}'
>
> Nice. I've just tried out this as shell script/key bind but made an extra
> line:
>
> ls -1 ~/mail/lists | grep @ |awk -F@ '{print "alias" " " $1 " " "<" $1 "@" $2
> ">"}' > ~/.mutt/lists
> ls -1 ~/mail/lists | awk '{print "mailboxes +lists/" $1}' >> ~/.mutt/lists
This is more complete I think;
ls -1 ~/mail/lists | grep @ |awk -F@ '{print "alias" " " $1 " " "<" $1 "@" $2
">"}' > ~/.mutt/lists
ls -1 ~/mail/lists | awk '{print "mailboxes +lists/" $1}' >> ~/.mutt/lists
ls -1 ~/mail/lists | awk '{print "subscribe " $1}' >> ~/.mutt/lists
>
> And in my binds file:
>
> macro generic \ca "!~/scripts/listalias\n:source ~/.mutt/lists\n"
>
> Now the mailboxes commands are sourced from my lists file too. So all I do is
> keep .procmailrc updated with new list rules and hit ^a in mutt to auto update
> the aliases and mailboxes.
>
> --
> With a gentleman I try to be a gentleman and a half, and with a fraud I
> try to be a fraud and a half.
> -- Otto von Bismark
>
--
Atlee is a very modest man. And with reason.
-- Winston Churchill